本文整理汇总了Java中org.jfree.chart.TestUtilities类的典型用法代码示例。如果您正苦于以下问题:Java TestUtilities类的具体用法?Java TestUtilities怎么用?Java TestUtilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestUtilities类属于org.jfree.chart包,在下文中一共展示了TestUtilities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSerialization4
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* This test ensures that a plot with markers is serialized correctly.
*/
@Test
public void testSerialization4() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
JFreeChart chart = ChartFactory.createBarChart(
"Test Chart", "Category Axis", "Value Axis",
dataset, PlotOrientation.VERTICAL, true, true, false);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.addRangeMarker(new ValueMarker(1.1), Layer.FOREGROUND);
plot.addRangeMarker(new IntervalMarker(2.2, 3.3), Layer.BACKGROUND);
JFreeChart chart2 = (JFreeChart) TestUtilities.serialised(chart);
assertEquals(chart, chart2);
// now check that the chart is usable...
try {
chart2.createBufferedImage(300, 200);
}
catch (Exception e) {
fail("No exception should be thrown.");
}
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:CategoryPlotTest.java
示例2: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset(
"Series");
d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0,
6.0, 7.0, 8.0, new ArrayList()));
DefaultBoxAndWhiskerXYDataset d2 = (DefaultBoxAndWhiskerXYDataset)
TestUtilities.serialised(d1);
assertEquals(d1, d2);
// test independence
d1.add(new Date(2L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0,
6.0, 7.0, 8.0, new ArrayList()));
assertFalse(d1.equals(d2));
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:19,代码来源:DefaultBoxAndWhiskerXYDatasetTest.java
示例3: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* 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);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:21,代码来源:StandardDialScaleTest.java
示例4: testSerialization3
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization3() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
JFreeChart chart = ChartFactory.createBarChart(
"Test Chart", "Category Axis", "Value Axis", dataset,
PlotOrientation.VERTICAL, true, true, false);
JFreeChart chart2 = (JFreeChart) TestUtilities.serialised(chart);
// now check that the chart is usable...
try {
chart2.createBufferedImage(300, 200);
}
catch (Exception e) {
fail("No exception should be thrown.");
}
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:20,代码来源:CategoryPlotTest.java
示例5: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
// test a default instance
DialTextAnnotation a1 = new DialTextAnnotation("A1");
DialTextAnnotation a2 = (DialTextAnnotation) TestUtilities.serialised(a1);
assertEquals(a1, a2);
// test a custom instance
a1 = new DialTextAnnotation("A1");
a1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
Color.blue));
a2 = (DialTextAnnotation) TestUtilities.serialised(a1);
assertEquals(a1, a2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:19,代码来源:DialTextAnnotationTest.java
示例6: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
// test a default instance
DialBackground b1 = new DialBackground();
DialBackground b2 = (DialBackground) TestUtilities.serialised(b1);
assertEquals(b1, b2);
// test a customised instance
b1 = new DialBackground();
b1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
Color.green));
b1.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_VERTICAL));
b2 = (DialBackground) TestUtilities.serialised(b1);
assertEquals(b1, b2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:21,代码来源:DialBackgroundTest.java
示例7: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
DefaultTableXYDataset d1 = new DefaultTableXYDataset();
d1.addSeries(createSeries2());
DefaultTableXYDataset d2 = (DefaultTableXYDataset)
TestUtilities.serialised(d1);
assertEquals(d1, d2);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:12,代码来源:TableXYDatasetTest.java
示例8: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
Vector v1 = new Vector(1.0, 2.0);
Vector v2 = (Vector) TestUtilities.serialised(v1);
assertEquals(v1, v2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:10,代码来源:VectorTest.java
示例9: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
CombinedRangeXYPlot plot1 = createPlot();
CombinedRangeXYPlot plot2 = (CombinedRangeXYPlot)
TestUtilities.serialised(plot1);
assertEquals(plot1, plot2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:11,代码来源:CombinedRangeXYPlotTest.java
示例10: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
XYItemEntity e1 = new XYItemEntity(new Rectangle2D.Double(1.0, 2.0,
3.0, 4.0), new TimeSeriesCollection(), 1, 9, "ToolTip", "URL");
XYItemEntity e2 = (XYItemEntity) TestUtilities.serialised(e1);
assertEquals(e1, e2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:11,代码来源:XYItemEntityTest.java
示例11: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0,
2.0, 3.0, 4.0), new DefaultPieDataset(), 1, 2, "Key",
"ToolTip", "URL");
PieSectionEntity e2 = (PieSectionEntity) TestUtilities.serialised(e1);
assertEquals(e1, e2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:12,代码来源:PieSectionEntityTest.java
示例12: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* 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);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:11,代码来源:TickUnitsTest.java
示例13: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
ItemLabelPosition p1 = new ItemLabelPosition();
ItemLabelPosition p2 = (ItemLabelPosition) TestUtilities.serialised(p1);
assertEquals(p1, p2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:10,代码来源:ItemLabelPositionTest.java
示例14: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
KeyedObjects ko1 = new KeyedObjects();
ko1.addObject("Key 1", "Object 1");
ko1.addObject("Key 2", null);
ko1.addObject("Key 3", "Object 2");
KeyedObjects ko2 = (KeyedObjects) TestUtilities.serialised(ko1);
assertEquals(ko1, ko2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:13,代码来源:KeyedObjectsTest.java
示例15: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
Stroke s = new BasicStroke(1.23f);
LegendGraphic g1 = new LegendGraphic(new Rectangle2D.Double(1.0, 2.0,
3.0, 4.0), Color.black);
g1.setOutlineStroke(s);
LegendGraphic g2 = (LegendGraphic) TestUtilities.serialised(g1);
assertTrue(g1.equals(g2));
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:13,代码来源:LegendGraphicTest.java
示例16: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
YWithXInterval i1 = new YWithXInterval(1.0, 0.5, 1.5);
YWithXInterval i2 = (YWithXInterval) TestUtilities.serialised(i1);
assertEquals(i1, i2);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:10,代码来源:YWithXIntervalTest.java
示例17: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* 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);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:10,代码来源:MillisecondTest.java
示例18: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
Minute m1 = new Minute();
Minute m2 = (Minute) TestUtilities.serialised(m1);
assertEquals(m1, m2);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:10,代码来源:MinuteTest.java
示例19: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
LookupPaintScale g1 = new LookupPaintScale();
LookupPaintScale g2 = (LookupPaintScale) TestUtilities.serialised(g1);
assertEquals(g1, g2);
g1 = new LookupPaintScale(1.0, 2.0, new GradientPaint(1.0f, 2.0f,
Color.red, 3.0f, 4.0f, Color.yellow));
g1.add(1.5, new GradientPaint(1.1f, 2.2f, Color.red, 3.3f, 4.4f,
Color.blue));
g2 = (LookupPaintScale) TestUtilities.serialised(g1);
assertEquals(g1, g2);
}
开发者ID:mdzio,项目名称:ccu-historian,代码行数:17,代码来源:LookupPaintScaleTest.java
示例20: testSerialization
import org.jfree.chart.TestUtilities; //导入依赖的package包/类
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
StandardPieSectionLabelGenerator g1
= new StandardPieSectionLabelGenerator();
StandardPieSectionLabelGenerator g2 = (StandardPieSectionLabelGenerator)
TestUtilities.serialised(g1);
assertEquals(g1, g2);
}
开发者ID:nick-paul,项目名称:aya-lang,代码行数:12,代码来源:StandardPieSectionLabelGeneratorTest.java
注:本文中的org.jfree.chart.TestUtilities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论