use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryLines in project beakerx by twosigma.
the class PlotObjectSerializerTest method serializeCategoryGraphics_returnTrue.
@Test
public void serializeCategoryGraphics_returnTrue() throws Exception {
// when
boolean result = plotObjectSerializer.writeObject(new CategoryLines(), jgen, true);
// then
Assertions.assertThat(result).isTrue();
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryLines in project beakerx by twosigma.
the class CategoryLinesSerializerTest method serializeWidthCategoryLines_resultJsonHasWidth.
@Test
public void serializeWidthCategoryLines_resultJsonHasWidth() throws IOException {
// when
CategoryLines categoryLines = new CategoryLines();
categoryLines.setWidth(11f);
categoryLinesSerializer.serialize(categoryLines, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("width")).isTrue();
Assertions.assertThat(actualObj.get("width").asInt()).isEqualTo(11);
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryLines in project beakerx by twosigma.
the class CategoryLinesSerializerTest method serializeStrokeTypeStems_resultJsonHasStyle.
@Test
public void serializeStrokeTypeStems_resultJsonHasStyle() throws IOException {
// when
CategoryLines categoryLines = new CategoryLines();
categoryLines.setStyle(StrokeType.SOLID);
categoryLinesSerializer.serialize(categoryLines, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("style")).isTrue();
Assertions.assertThat(actualObj.get("style").asText()).isEqualTo("SOLID");
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryLines in project beakerx by twosigma.
the class CategoryLinesSerializerTest method serializeInterpolationCategoryLines_resultJsonHasInterpolation.
@Test
public void serializeInterpolationCategoryLines_resultJsonHasInterpolation() throws IOException {
// when
CategoryLines categoryLines = new CategoryLines();
categoryLines.setInterpolation(1);
categoryLinesSerializer.serialize(categoryLines, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("interpolation")).isTrue();
Assertions.assertThat(actualObj.get("interpolation").asInt()).isEqualTo(1);
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryLines in project beakerx by twosigma.
the class CategoryLinesSerializerTest method serializeStrokeTypeListStems_resultJsonHasStyles.
@Test
public void serializeStrokeTypeListStems_resultJsonHasStyles() throws IOException {
// when
CategoryLines categoryLines = new CategoryLines();
categoryLines.setStyle(Arrays.asList(StrokeType.SOLID, StrokeType.DASHDOT));
categoryLinesSerializer.serialize(categoryLines, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("styles")).isTrue();
ArrayNode arrayNode = (ArrayNode) actualObj.get("styles");
Assertions.assertThat(arrayNode.get(1).asText()).isEqualTo("DASHDOT");
}
Aggregations