use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars in project beakerx by twosigma.
the class CategoryBarsSerializerTest method serializeDrawOutlinesCategoryBars_resultJsonHasDrawOutlines.
@Test
public void serializeDrawOutlinesCategoryBars_resultJsonHasDrawOutlines() throws IOException {
// when
CategoryBars categoryBars = new CategoryBars();
categoryBars.setDrawOutline(Arrays.asList(false, true, false));
categoryBarsSerializer.serialize(categoryBars, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("outlines")).isTrue();
ArrayNode arrayNode = (ArrayNode) actualObj.get("outlines");
Assertions.assertThat(arrayNode.get(1).asBoolean()).isTrue();
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars in project beakerx by twosigma.
the class CategoryBarsSerializerTest method serializeFillsCategoryBars_resultJsonHasFills.
@Test
public void serializeFillsCategoryBars_resultJsonHasFills() throws IOException {
// when
CategoryBars categoryBars = new CategoryBars();
categoryBars.setFill(Arrays.asList(false, true, false));
categoryBarsSerializer.serialize(categoryBars, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("fills")).isTrue();
ArrayNode arrayNode = (ArrayNode) actualObj.get("fills");
Assertions.assertThat(arrayNode.get(1).asBoolean()).isTrue();
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars in project beakerx by twosigma.
the class CategoryPlotSerializerTest method serializeGraphicsListCategoryPlot_resultJsonHasGraphicsList.
@Test
public void serializeGraphicsListCategoryPlot_resultJsonHasGraphicsList() throws IOException {
// when
CategoryPlot categoryPlot = new CategoryPlot();
categoryPlot.add(Arrays.asList(new CategoryBars(), new CategoryPoints()));
categoryPlotSerializer.serialize(categoryPlot, jgen, new DefaultSerializerProvider.Impl());
jgen.flush();
// then
JsonNode actualObj = mapper.readTree(sw.toString());
Assertions.assertThat(actualObj.has("graphics_list")).isTrue();
ArrayNode arrayNode = (ArrayNode) actualObj.get("graphics_list");
Assertions.assertThat(arrayNode.size()).isEqualTo(2);
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars in project beakerx by twosigma.
the class ItemLabelBuilderTest method setUp.
@Before
public void setUp() throws Exception {
categoryGraphics = new CategoryBars();
categoryGraphics.setValue(new Integer[] { new Integer(1), new Integer(2) });
categoryGraphics.setSeriesNames(Arrays.asList("test series name"));
categoryPlot = new CategoryPlot();
categoryPlot.setCategoryNames(Arrays.asList("test category name"));
categoryPlot.add(Arrays.asList(categoryGraphics));
}
use of com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars in project beakerx by twosigma.
the class CategoryPlotTest method initStubData.
@Before
public void initStubData() {
array1 = new Integer[] { new Integer(1), new Integer(2) };
array2 = new Integer[] { new Integer(3), new Integer(4) };
categoryBars = new CategoryBars();
categoryBars.setValue(new List[] { Arrays.asList(array1), Arrays.asList(array2) });
categoryLines = new CategoryLines();
categoryLines.setValue(new List[] { Arrays.asList(array1), Arrays.asList(array2) });
categoryPoints = new CategoryPoints();
categoryPoints.setValue(new List[] { Arrays.asList(array1), Arrays.asList(array2) });
categoryStems = new CategoryStems();
categoryStems.setValue(new List[] { Arrays.asList(array1), Arrays.asList(array2) });
}
Aggregations