/** * Test that the equals() method works for a TimeSeriesURLGenerator. */ @Test public void testEquals2() { XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer(); XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer(); assertEquals(r1, r2); assertEquals(r2, r1); r1.setURLGenerator(new TimeSeriesURLGenerator()); assertFalse(r1.equals(r2)); r2.setURLGenerator(new TimeSeriesURLGenerator()); assertTrue(r1.equals(r2)); }
/** * Test that the equals() method works for a TimeSeriesURLGenerator. */ public void testEquals2() { XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer(); XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer(); assertEquals(r1, r2); assertEquals(r2, r1); r1.setBaseURLGenerator(new TimeSeriesURLGenerator()); assertFalse(r1.equals(r2)); r2.setBaseURLGenerator(new TimeSeriesURLGenerator()); assertTrue(r1.equals(r2)); }
/** * A basic check for the generateURL() method. */ public void testGenerateURL() { TimeSeriesURLGenerator g = new TimeSeriesURLGenerator(); DefaultXYDataset dataset = new DefaultXYDataset(); dataset.addSeries("Series '1'", new double[][] {{1.0, 2.0}, {3.0, 4.0}}); String s = g.generateURL(dataset, 0, 0); assertTrue(s.startsWith("index.html?series=Series+%271%27&item=")); }
/** * Checks that the class does not implement PublicCloneable (the generator * is immutable). */ public void testPublicCloneable() { TimeSeriesURLGenerator g1 = new TimeSeriesURLGenerator(); assertFalse(g1 instanceof PublicCloneable); }