Exemplo n.º 1
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   GradientPaint gp = new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue);
   ColorBlock b1 = new ColorBlock(gp, 1.0, 2.0);
   ColorBlock b2 = (ColorBlock) TestUtilities.serialised(b1);
   assertEquals(b1, b2);
 }
Exemplo n.º 2
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   TickUnits t1 = new TickUnits();
   t1.add(new NumberTickUnit(10, new DecimalFormat("0.00")));
   TickUnits t2 = (TickUnits) TestUtilities.serialised(t1);
   assertEquals(t1, t2);
 }
  /** Serialize an instance, restore it, and check for equality. */
  @Test
  public void testSerialization() {
    // try a default instance
    StandardDialScale s1 = new StandardDialScale();
    StandardDialScale s2 = (StandardDialScale) TestUtilities.serialised(s1);
    assertEquals(s1, s2);

    // try a customised instance
    s1 = new StandardDialScale();
    s1.setExtent(123.4);
    s1.setMajorTickPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.white));
    s1.setMajorTickStroke(new BasicStroke(2.0f));

    s2 = (StandardDialScale) TestUtilities.serialised(s1);
    assertEquals(s1, s2);
  }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   StatisticalLineAndShapeRenderer r1 = new StatisticalLineAndShapeRenderer();
   StatisticalLineAndShapeRenderer r2 =
       (StatisticalLineAndShapeRenderer) TestUtilities.serialised(r1);
   assertEquals(r1, r2);
 }
Exemplo n.º 5
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   XYTextAnnotation a1 = new XYTextAnnotation("Text", 10.0, 20.0);
   a1.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue));
   XYTextAnnotation a2 = (XYTextAnnotation) TestUtilities.serialised(a1);
   assertEquals(a1, a2);
 }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   IntervalCategoryItemLabelGenerator g1 =
       new IntervalCategoryItemLabelGenerator("{3} - {4}", DateFormat.getInstance());
   IntervalCategoryItemLabelGenerator g2 =
       (IntervalCategoryItemLabelGenerator) TestUtilities.serialised(g1);
   assertEquals(g1, g2);
 }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   TimeSeries s1 = new TimeSeries("A test");
   s1.add(new Year(2000), 13.75);
   s1.add(new Year(2001), 11.90);
   s1.add(new Year(2002), null);
   s1.add(new Year(2005), 19.32);
   s1.add(new Year(2007), 16.89);
   TimeSeries s2 = (TimeSeries) TestUtilities.serialised(s1);
   assertTrue(s1.equals(s2));
 }
Exemplo n.º 8
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   BoxAndWhiskerItem i1 =
       new BoxAndWhiskerItem(
           new Double(1.0),
           new Double(2.0),
           new Double(3.0),
           new Double(4.0),
           new Double(5.0),
           new Double(6.0),
           new Double(7.0),
           new Double(8.0),
           new ArrayList());
   BoxAndWhiskerItem i2 = (BoxAndWhiskerItem) TestUtilities.serialised(i1);
   assertEquals(i1, i2);
 }
Exemplo n.º 9
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   StandardDialFrame f1 = new StandardDialFrame();
   StandardDialFrame f2 = (StandardDialFrame) TestUtilities.serialised(f1);
   assertEquals(f1, f2);
 }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", new Double(25.3));
   DefaultKeyedValueDataset d2 = (DefaultKeyedValueDataset) TestUtilities.serialised(d1);
   assertEquals(d1, d2);
 }
Exemplo n.º 11
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   XYAreaRenderer r1 = new XYAreaRenderer();
   XYAreaRenderer r2 = (XYAreaRenderer) TestUtilities.serialised(r1);
   assertEquals(r1, r2);
 }
Exemplo n.º 12
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   TimeSeriesDataItem item1 = new TimeSeriesDataItem(new Day(23, 9, 2001), 99.7);
   TimeSeriesDataItem item2 = (TimeSeriesDataItem) TestUtilities.serialised(item1);
   assertEquals(item1, item2);
 }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   NormalDistributionFunction2D f1 = new NormalDistributionFunction2D(1.0, 2.0);
   NormalDistributionFunction2D f2 = (NormalDistributionFunction2D) TestUtilities.serialised(f1);
   assertEquals(f1, f2);
 }
Exemplo n.º 14
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   RangeType r1 = RangeType.FULL;
   RangeType r2 = (RangeType) TestUtilities.serialised(r1);
   assertSame(r1, r2);
 }
Exemplo n.º 15
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   Millisecond m1 = new Millisecond();
   Millisecond m2 = (Millisecond) TestUtilities.serialised(m1);
   assertEquals(m1, m2);
 }
Exemplo n.º 16
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
   IntervalMarker m2 = (IntervalMarker) TestUtilities.serialised(m1);
   assertEquals(m1, m2);
 }
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   DefaultDrawingSupplier r1 = new DefaultDrawingSupplier();
   DefaultDrawingSupplier r2 = (DefaultDrawingSupplier) TestUtilities.serialised(r1);
   assertEquals(r1, r2);
 }
Exemplo n.º 18
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   DateAxis a1 = new DateAxis("Test Axis");
   DateAxis a2 = (DateAxis) TestUtilities.serialised(a1);
   assertEquals(a1, a2);
 }
Exemplo n.º 19
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
   NumberTickUnit t2 = (NumberTickUnit) TestUtilities.serialised(t1);
   assertEquals(t1, t2);
 }
Exemplo n.º 20
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   NumberAxis a1 = new NumberAxis("Test Axis");
   NumberAxis a2 = (NumberAxis) TestUtilities.serialised(a1);
   assertEquals(a1, a2);
 }
Exemplo n.º 21
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   ArrowNeedle n1 = new ArrowNeedle(false);
   ArrowNeedle n2 = (ArrowNeedle) TestUtilities.serialised(n1);
   assertTrue(n1.equals(n2));
 }
Exemplo n.º 22
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   YInterval i1 = new YInterval(1.0, 0.5, 1.5);
   YInterval i2 = (YInterval) TestUtilities.serialised(i1);
   assertEquals(i1, i2);
 }
Exemplo n.º 23
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   VectorDataItem v1 = new VectorDataItem(1.0, 2.0, 3.0, 4.0);
   VectorDataItem v2 = (VectorDataItem) TestUtilities.serialised(v1);
   assertEquals(v1, v2);
 }
Exemplo n.º 24
0
 /** Serialize an instance, restore it, and check for equality. */
 @Test
 public void testSerialization() {
   DialValueIndicator i1 = new DialValueIndicator(0);
   DialValueIndicator i2 = (DialValueIndicator) TestUtilities.serialised(i1);
   assertEquals(i1, i2);
 }