Java源码示例:org.jfree.chart.urls.TimeSeriesURLGenerator

示例1
/**
 * 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));
}
 
示例2
/**
 * 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));
}
 
示例3
/**
 * 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));
}
 
示例4
/**
 * 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));
}
 
示例5
/**
 * 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));
}
 
示例6
/**
 * 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="));
}
 
示例7
/**
 * 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));
}
 
示例8
/**
 * 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="));
}
 
示例9
/**
 * 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));
}
 
示例10
/**
 * Checks that the class does not implement PublicCloneable (the generator
 * is immutable).
 */
public void testPublicCloneable() {
    TimeSeriesURLGenerator g1 = new TimeSeriesURLGenerator();
    assertFalse(g1 instanceof PublicCloneable);
}