1 42 43 package org.jfree.chart.renderer.xy.junit; 44 45 import junit.framework.Test; 46 import junit.framework.TestCase; 47 import junit.framework.TestSuite; 48 49 import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; 50 import org.jfree.chart.renderer.xy.StandardXYItemRenderer; 51 import org.jfree.data.Range; 52 import org.jfree.data.xy.XYDataset; 53 import org.jfree.data.xy.XYSeries; 54 import org.jfree.data.xy.XYSeriesCollection; 55 56 59 public class AbstractXYItemRendererTests extends TestCase { 60 61 66 public static Test suite() { 67 return new TestSuite(AbstractXYItemRendererTests.class); 68 } 69 70 75 public AbstractXYItemRendererTests(String name) { 76 super(name); 77 } 78 79 84 private XYDataset createDataset1() { 85 XYSeries series = new XYSeries("Series"); 86 series.add(1.0, 1.0); 87 series.add(2.0, 2.0); 88 series.add(3.0, 3.0); 89 XYSeriesCollection dataset = new XYSeriesCollection(); 90 dataset.addSeries(series); 91 return dataset; 92 } 93 94 private static final double EPSILON = 0.0000000001; 95 96 99 public void testFindDomainBounds() { 100 AbstractXYItemRenderer renderer = new StandardXYItemRenderer(); 101 102 XYDataset dataset = createDataset1(); 104 Range r = renderer.findDomainBounds(dataset); 105 assertEquals(1.0, r.getLowerBound(), EPSILON); 106 assertEquals(3.0, r.getUpperBound(), EPSILON); 107 108 assertTrue(renderer.findDomainBounds(null) == null); 110 } 111 112 115 public void testFindRangeBounds() { 116 AbstractXYItemRenderer renderer = new StandardXYItemRenderer(); 117 assertTrue(renderer.findRangeBounds(null) == null); 119 } 120 121 } 122 | Popular Tags |