Example usage for org.jfree.chart TestUtilities serialised

List of usage examples for org.jfree.chart TestUtilities serialised

Introduction

In this page you can find the example usage for org.jfree.chart TestUtilities serialised.

Prototype

public static Object serialised(Object original) 

Source Link

Usage

From source file:org.jfree.data.xy.DefaultWindDatasetTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *//*from  w w w.j av a2 s. c  o m*/
@Test
public void testSerialization() {
    DefaultWindDataset d1 = new DefaultWindDataset();
    DefaultWindDataset d2 = (DefaultWindDataset) TestUtilities.serialised(d1);
    assertEquals(d1, d2);

    // try a dataset with some content...
    d1 = createSampleDataset1();
    d2 = (DefaultWindDataset) TestUtilities.serialised(d1);
    assertEquals(d1, d2);
}

From source file:org.jfree.data.KeyedObjects2DTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from   w  w w .  j a v a  2 s.c o m
@Test
public void testSerialization() {
    KeyedObjects2D ko2D1 = new KeyedObjects2D();
    ko2D1.addObject(new Double(234.2), "Row1", "Col1");
    ko2D1.addObject(null, "Row1", "Col2");
    ko2D1.addObject(new Double(345.9), "Row2", "Col1");
    ko2D1.addObject(new Double(452.7), "Row2", "Col2");

    KeyedObjects2D ko2D2 = (KeyedObjects2D) TestUtilities.serialised(ko2D1);
    assertEquals(ko2D1, ko2D2);
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDatasetTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from w  ww.  jav a 2  s.  c  o  m
@Test
public void testSerialization() {
    DefaultBoxAndWhiskerCategoryDataset d1 = new DefaultBoxAndWhiskerCategoryDataset();
    d1.add(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()), "ROW1",
            "COLUMN1");
    DefaultBoxAndWhiskerCategoryDataset d2 = (DefaultBoxAndWhiskerCategoryDataset) TestUtilities.serialised(d1);
    assertEquals(d1, d2);
}

From source file:org.jfree.data.ComparableObjectItemTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from w  ww.j  av  a2s .c o m
@Test
public void testSerialization() {
    ComparableObjectItem item1 = new ComparableObjectItem(new Integer(1), "XYZ");
    ComparableObjectItem item2 = (ComparableObjectItem) TestUtilities.serialised(item1);
    assertEquals(item1, item2);
}

From source file:org.jfree.data.general.DefaultKeyedValueDatasetTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from  ww  w.  jav  a  2  s  . c o m
@Test
public void testSerialization() {
    DefaultKeyedValueDataset d1 = new DefaultKeyedValueDataset("Test", new Double(25.3));
    DefaultKeyedValueDataset d2 = (DefaultKeyedValueDataset) TestUtilities.serialised(d1);
    assertEquals(d1, d2);
}

From source file:org.jfree.data.xy.VectorDataItemTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from ww w. ja  v  a2  s  .  c  o  m
@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);
}

From source file:org.jfree.data.function.PolynomialFunction2DTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from   w  w  w .jav  a2 s  .c o m
@Test
public void testSerialization() {
    PolynomialFunction2D f1 = new PolynomialFunction2D(new double[] { 1.0, 2.0 });
    PolynomialFunction2D f2 = (PolynomialFunction2D) TestUtilities.serialised(f1);
    assertEquals(f1, f2);
}

From source file:org.jfree.data.xy.IntervalXYDelegateTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *//*from www . j av  a 2 s .  com*/
@Test
public void testSerialization() {
    XYSeries s1 = new XYSeries("Series");
    s1.add(1.2, 3.4);
    XYSeriesCollection c1 = new XYSeriesCollection();
    c1.addSeries(s1);
    IntervalXYDelegate d1 = new IntervalXYDelegate(c1);
    IntervalXYDelegate d2 = (IntervalXYDelegate) TestUtilities.serialised(d1);
    assertEquals(d1, d2);
}

From source file:org.jfree.data.xy.MatrixSeriesCollectionTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *//*from  w ww.j  a  v  a 2s .  c  o m*/
@Test
public void testSerialization() {
    MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
    s1.update(0, 0, 1.1);
    MatrixSeriesCollection c1 = new MatrixSeriesCollection();
    c1.addSeries(s1);
    MatrixSeriesCollection c2 = (MatrixSeriesCollection) TestUtilities.serialised(c1);
    assertEquals(c1, c2);
}

From source file:org.jfree.data.xy.TableXYDatasetTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///from   w w w  .j a v a2  s.  c o  m
@Test
public void testSerialization() {
    DefaultTableXYDataset d1 = new DefaultTableXYDataset();
    d1.addSeries(createSeries2());
    DefaultTableXYDataset d2 = (DefaultTableXYDataset) TestUtilities.serialised(d1);
    assertEquals(d1, d2);
}