use of com.twosigma.beakerx.chart.xychart.CombinedPlot in project beakerx by twosigma.
the class CombinedPlotSerializerTest method serializeWeightsOfCombinedPlot_resultJsonHasWeights.
@Test
public void serializeWeightsOfCombinedPlot_resultJsonHasWeights() throws IOException {
// when
CombinedPlot combinedPlot = new CombinedPlot();
combinedPlot.add(new Plot(), 3);
combinedPlot.add(new Plot(), 3);
combinedPlotSerializer.serialize(combinedPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("weights")).isTrue();
Assertions.assertThat(actualObj.get("weights")).isNotEmpty();
}
use of com.twosigma.beakerx.chart.xychart.CombinedPlot in project beakerx by twosigma.
the class CombinedPlotSerializerTest method serializeTitleOfCombinedPlot_resultJsonHasTitle.
@Test
public void serializeTitleOfCombinedPlot_resultJsonHasTitle() throws IOException {
// when
CombinedPlot combinedPlot = new CombinedPlot();
combinedPlot.setTitle("Some title");
combinedPlotSerializer.serialize(combinedPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("title")).isTrue();
Assertions.assertThat(actualObj.get("title").asText()).isEqualTo("Some title");
}
use of com.twosigma.beakerx.chart.xychart.CombinedPlot in project beakerx by twosigma.
the class CombinedPlotSerializerTest method serializeCombinedPlot_resultJsonHasType.
@Test
public void serializeCombinedPlot_resultJsonHasType() throws IOException {
// when
CombinedPlot combinedPlot = new CombinedPlot();
combinedPlotSerializer.serialize(combinedPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("type")).isTrue();
Assertions.assertThat(actualObj.get("type").asText()).isEqualTo("CombinedPlot");
}
use of com.twosigma.beakerx.chart.xychart.CombinedPlot in project beakerx by twosigma.
the class CombinedPlotSerializerTest method serializeXLabelNameOfCombinedPlot_resultJsonHasXLabelName.
@Test
public void serializeXLabelNameOfCombinedPlot_resultJsonHasXLabelName() throws IOException {
// when
CombinedPlot combinedPlot = new CombinedPlot();
combinedPlot.setXLabel("X label name");
combinedPlotSerializer.serialize(combinedPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("x_label")).isTrue();
Assertions.assertThat(actualObj.get("x_label").asText()).isEqualTo("X label name");
}
use of com.twosigma.beakerx.chart.xychart.CombinedPlot in project beakerx by twosigma.
the class CombinedPlotSerializerTest method serializeYTickLabelsVisibleOfCombinedPlot_resultJsonHasYTickLabelsVisible.
@Test
public void serializeYTickLabelsVisibleOfCombinedPlot_resultJsonHasYTickLabelsVisible() throws IOException {
// when
CombinedPlot combinedPlot = new CombinedPlot();
combinedPlot.setyTickLabelsVisible(true);
combinedPlotSerializer.serialize(combinedPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("y_tickLabels_visible")).isTrue();
Assertions.assertThat(actualObj.get("y_tickLabels_visible").asBoolean()).isTrue();
}
Aggregations