use of com.twosigma.beakerx.chart.histogram.Histogram in project beakerx by twosigma.
the class PlotObjectSerializerTest method serializeHistogram_returnTrue.
@Test
public void serializeHistogram_returnTrue() throws Exception {
// when
boolean result = plotObjectSerializer.writeObject(new Histogram(), jgen, true);
// then
Assertions.assertThat(result).isTrue();
}
use of com.twosigma.beakerx.chart.histogram.Histogram in project beakerx by twosigma.
the class HistogramSerializerTest method initTestStubData.
@Before
public void initTestStubData() throws IOException {
KernelManager.register(new KernelTest());
sw = new StringWriter();
jgen = mapper.getJsonFactory().createJsonGenerator(sw);
histogram = new Histogram();
}
use of com.twosigma.beakerx.chart.histogram.Histogram in project beakerx by twosigma.
the class GroovyEvaluatorChartTest method parseHistogramScript_returnHistogramObject.
@Test
public void parseHistogramScript_returnHistogramObject() {
// when
Object result = parseClassFromScript("Random random = new Random();\n" + "data3 = [];\n" + "(1..10000).each { data3 << random.nextGaussian();}\n" + "new Histogram(data: data3, binCount: 25);");
// then
Assertions.assertThat(result instanceof Histogram).isTrue();
Histogram histogram = (Histogram) result;
Assertions.assertThat(histogram.getData()).isNotEmpty();
}
Aggregations