use of org.jfree.data.category.CategoryDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testFindMaximumRangeValue.
/**
* Some tests for the findMaximumRangeValue() method.
*/
@Test
public void testFindMaximumRangeValue() {
CategoryDataset d1 = createCategoryDataset1();
Number max1 = DatasetUtilities.findMaximumRangeValue(d1);
assertEquals(new Double(6.0), max1);
XYDataset dataset = createXYDataset1();
Number maximum = DatasetUtilities.findMaximumRangeValue(dataset);
assertEquals(new Double(105.0), maximum);
}
use of org.jfree.data.category.CategoryDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testCreateCategoryDataset2.
/**
* Test the creation of a dataset from an array. This time is should fail
* because the array dimensions are around the wrong way.
*/
@Test
public void testCreateCategoryDataset2() {
boolean pass = false;
String[] rowKeys = { "R1", "R2", "R3" };
String[] columnKeys = { "C1", "C2" };
double[][] data = new double[2][];
data[0] = new double[] { 1.1, 1.2, 1.3 };
data[1] = new double[] { 2.1, 2.2, 2.3 };
CategoryDataset dataset = null;
try {
dataset = DatasetUtilities.createCategoryDataset(rowKeys, columnKeys, data);
} catch (IllegalArgumentException e) {
// got it!
pass = true;
}
assertTrue(pass);
assertTrue(dataset == null);
}
use of org.jfree.data.category.CategoryDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testFindStackedRangeBounds_CategoryDataset1.
/**
* Some checks for the findStackedRangeBounds() method.
*/
@Test
public void testFindStackedRangeBounds_CategoryDataset1() {
CategoryDataset d1 = createCategoryDataset1();
Range r = DatasetUtilities.findStackedRangeBounds(d1);
assertEquals(0.0, r.getLowerBound(), EPSILON);
assertEquals(15.0, r.getUpperBound(), EPSILON);
d1 = createCategoryDataset2();
r = DatasetUtilities.findStackedRangeBounds(d1);
assertEquals(-2.0, r.getLowerBound(), EPSILON);
assertEquals(2.0, r.getUpperBound(), EPSILON);
}
use of org.jfree.data.category.CategoryDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testStackedRangeWithMap.
/**
* Tests the stacked range extent calculation.
*/
@Test
public void testStackedRangeWithMap() {
CategoryDataset d = createCategoryDataset1();
KeyToGroupMap map = new KeyToGroupMap("G0");
map.mapKeyToGroup("R2", "G1");
Range r = DatasetUtilities.findStackedRangeBounds(d, map);
assertEquals(0.0, r.getLowerBound(), EPSILON);
assertEquals(9.0, r.getUpperBound(), EPSILON);
}
use of org.jfree.data.category.CategoryDataset in project SIMVA-SoS by SESoS.
the class DatasetUtilitiesTest method testIterateRangeBounds_CategoryDataset.
/**
* Some tests for the iterateRangeBounds() method.
*/
@Test
public void testIterateRangeBounds_CategoryDataset() {
CategoryDataset dataset = createCategoryDataset1();
Range r = DatasetUtilities.iterateRangeBounds(dataset, false);
assertEquals(1.0, r.getLowerBound(), EPSILON);
assertEquals(6.0, r.getUpperBound(), EPSILON);
}
Aggregations