Skip to content

Commit

Permalink
Merge pull request #58 from pacbeckh/master
Browse files Browse the repository at this point in the history
Added missing @test annotations
  • Loading branch information
jfree committed Nov 5, 2017
2 parents 9c9bf60 + 0c86a5c commit 513bebe
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void testEquals() {
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashCode() {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.RED, Color.BLUE);
Expand All @@ -137,6 +138,7 @@ public void testHashCode() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.RED, Color.BLUE);
Expand All @@ -149,6 +151,7 @@ public void testCloning() throws CloneNotSupportedException {
/**
* Checks that this class implements PublicCloneable.
*/
@Test
public void testPublicCloneable() {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.RED, Color.BLUE);
Expand All @@ -158,6 +161,7 @@ public void testPublicCloneable() {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.RED, Color.BLUE);
Expand All @@ -169,6 +173,7 @@ public void testSerialization() {
* Draws the chart with a {@code null} info object to make sure that
* no exceptions are thrown.
*/
@Test
public void testDrawWithNullInfo() {
try {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public void testSizing() {
/**
* Run some checks on sizing when there is a fixed width constraint.
*/
@Test
public void testSizingWithWidthConstraint() {
RectangleConstraint constraint = new RectangleConstraint(
10.0, new Range(10.0, 10.0), LengthConstraintType.FIXED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void testEquals() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
XYShapeRenderer r1 = new XYShapeRenderer();
XYShapeRenderer r2 = (XYShapeRenderer) r1.clone();
Expand All @@ -120,6 +121,7 @@ public void testCloning() throws CloneNotSupportedException {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
XYShapeRenderer r1 = new XYShapeRenderer();
XYShapeRenderer r2 = (XYShapeRenderer) TestUtils.serialised(r1);
Expand All @@ -131,6 +133,7 @@ public void testSerialization() {
/**
* Check if finding the bounds in z-dimension of an XYZDataset works.
*/
@Test
public void testFindZBounds() {
XYShapeRenderer r = new XYShapeRenderer();
assertNull(r.findZBounds(null));
Expand Down Expand Up @@ -165,6 +168,7 @@ public void testFindZBounds() {
/**
* Test for bug 3026341.
*/
@Test
public void test3026341() {
XYShapeRenderer renderer = new XYShapeRenderer();
assertNull(renderer.findRangeBounds(null));
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/org/jfree/chart/util/LogFormatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void testEquals() {
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashcode() {
LogFormat f1 = new LogFormat(10.0, "10", true);
LogFormat f2 = new LogFormat(10.0, "10", true);
Expand All @@ -99,6 +100,7 @@ public void testHashcode() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() {
LogFormat f1 = new LogFormat(10.0, "10", true);
LogFormat f2 = (LogFormat) f1.clone();
Expand All @@ -110,6 +112,7 @@ public void testCloning() {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
LogFormat f1 = new LogFormat(10.0, "10", true);
LogFormat f2 = (LogFormat) TestUtils.serialised(f1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void testFormat() {
* Test that we can configure the RelativeDateFormat to show
* hh:mm:ss.
*/
@Test
public void test2033092() {
RelativeDateFormat rdf = new RelativeDateFormat();
rdf.setShowZeroDays(false);
Expand Down Expand Up @@ -121,6 +122,7 @@ public void test2033092() {
/**
* Check that the equals() method can distinguish all fields.
*/
@Test
public void testEquals() {
RelativeDateFormat df1 = new RelativeDateFormat();
RelativeDateFormat df2 = new RelativeDateFormat();
Expand Down Expand Up @@ -180,6 +182,7 @@ public void testEquals() {
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashCode() {
RelativeDateFormat df1 = new RelativeDateFormat(123L);
RelativeDateFormat df2 = new RelativeDateFormat(123L);
Expand All @@ -192,6 +195,7 @@ public void testHashCode() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() {
NumberFormat nf = new DecimalFormat("0");
RelativeDateFormat df1 = new RelativeDateFormat();
Expand All @@ -210,6 +214,7 @@ public void testCloning() {
/**
* Some tests for negative dates.
*/
@Test
public void testNegative() {
NumberFormat nf = new DecimalFormat("0");
RelativeDateFormat df1 = new RelativeDateFormat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void testGetValue() {
/**
* A simple check for the getValue(int, int) method.
*/
@Test
public void testGetValue2() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
boolean pass = false;
Expand All @@ -103,6 +104,7 @@ public void testGetValue2() {
/**
* Some checks for the incrementValue() method.
*/
@Test
public void testIncrementValue() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
d.addValue(1.0, "R1", "C1");
Expand Down Expand Up @@ -138,6 +140,7 @@ public void testIncrementValue() {
/**
* Some tests for the getRowCount() method.
*/
@Test
public void testGetRowCount() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
assertTrue(d.getRowCount() == 0);
Expand All @@ -159,6 +162,7 @@ public void testGetRowCount() {
/**
* Some tests for the getColumnCount() method.
*/
@Test
public void testGetColumnCount() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
assertTrue(d.getColumnCount() == 0);
Expand All @@ -180,6 +184,7 @@ public void testGetColumnCount() {
/**
* Confirm that the equals method can distinguish all the required fields.
*/
@Test
public void testEquals() {
DefaultCategoryDataset d1 = new DefaultCategoryDataset();
d1.setValue(23.4, "R1", "C1");
Expand All @@ -202,6 +207,7 @@ public void testEquals() {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
DefaultCategoryDataset d1 = new DefaultCategoryDataset();
d1.setValue(23.4, "R1", "C1");
Expand All @@ -213,6 +219,7 @@ public void testSerialization() {
/**
* Some checks for the addValue() method.
*/
@Test
public void testAddValue() {
DefaultCategoryDataset d1 = new DefaultCategoryDataset();
d1.addValue(null, "R1", "C1");
Expand All @@ -233,6 +240,7 @@ public void testAddValue() {
/**
* Some basic checks for the removeValue() method.
*/
@Test
public void testRemoveValue() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
d.removeValue("R1", "C1");
Expand Down Expand Up @@ -268,6 +276,7 @@ public void testRemoveValue() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
DefaultCategoryDataset d1 = new DefaultCategoryDataset();
DefaultCategoryDataset d2 = (DefaultCategoryDataset) d1.clone();
Expand Down Expand Up @@ -295,6 +304,7 @@ public void testCloning() throws CloneNotSupportedException {
/**
* Check that this class implements PublicCloneable.
*/
@Test
public void testPublicCloneable() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
assertTrue(d instanceof PublicCloneable);
Expand All @@ -305,6 +315,7 @@ public void testPublicCloneable() {
/**
* A test for bug 1835955.
*/
@Test
public void testBug1835955() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
d.addValue(1.0, "R1", "C1");
Expand All @@ -317,6 +328,7 @@ public void testBug1835955() {
/**
* Some checks for the removeColumn(Comparable) method.
*/
@Test
public void testRemoveColumn() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
d.addValue(1.0, "R1", "C1");
Expand Down Expand Up @@ -347,6 +359,7 @@ public void testRemoveColumn() {
/**
* Some checks for the removeRow(Comparable) method.
*/
@Test
public void testRemoveRow() {
DefaultCategoryDataset d = new DefaultCategoryDataset();
d.addValue(1.0, "R1", "C1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ public void testGetColumnCount() {
/**
* Some tests for the getColumnKey() method.
*/
@Test
public void testGetColumnKey() {
TaskSeriesCollection c = createCollection1();
assertEquals("Task 1", c.getColumnKey(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void testCloning() throws CloneNotSupportedException {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
DefaultKeyedValues2DDataset d1 = new DefaultKeyedValues2DDataset();
d1.addValue(new Double(234.2), "Row1", "Col1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void testClear() {
/**
* Some checks for the getKey(int) method.
*/
@Test
public void testGetKey() {
DefaultPieDataset d = new DefaultPieDataset();
d.setValue("A", 1.0);
Expand Down Expand Up @@ -116,6 +117,7 @@ public void testGetKey() {
/**
* Some checks for the getIndex() method.
*/
@Test
public void testGetIndex() {
DefaultPieDataset d = new DefaultPieDataset();
d.setValue("A", 1.0);
Expand All @@ -137,6 +139,7 @@ public void testGetIndex() {
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
DefaultPieDataset d1 = new DefaultPieDataset();
d1.setValue("V1", new Integer(1));
Expand All @@ -152,6 +155,7 @@ public void testCloning() throws CloneNotSupportedException {
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
DefaultPieDataset d1 = new DefaultPieDataset();
d1.setValue("C1", new Double(234.2));
Expand Down

0 comments on commit 513bebe

Please sign in to comment.