sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1422246 - in /sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry: DirectPosition1DTest.java DirectPosition2DTest.java GeneralDirectPositionTest.java
Date Sat, 15 Dec 2012 13:18:41 GMT
Author: desruisseaux
Date: Sat Dec 15 13:18:40 2012
New Revision: 1422246

URL: http://svn.apache.org/viewvc?rev=1422246&view=rev
Log:
Added serialization tests.

Modified:
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
    sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java?rev=1422246&r1=1422245&r2=1422246&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
(original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition1DTest.java
Sat Dec 15 13:18:40 2012
@@ -21,7 +21,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.apache.sis.test.Assert.*;
 
 
 /**
@@ -63,10 +63,12 @@ public final strictfp class DirectPositi
         DirectPosition p2 = new GeneralDirectPosition(48.543261561072285);
         assertTrue(p1.equals(p2));
         assertTrue(p2.equals(p1));
+        assertEquals(p2.hashCode(), p1.hashCode());
 
         p1.setOrdinate(0, p1.getOrdinate(0) + 1);
         assertFalse(p1.equals(p2));
         assertFalse(p2.equals(p1));
+        assertFalse(p2.hashCode() == p1.hashCode());
     }
 
     /**
@@ -79,4 +81,13 @@ public final strictfp class DirectPositi
         assertEquals("Expected the same CRS and ordinates.", p1, p2);
         assertEquals("Expected the same ordinates.", 20.0, p2.ordinate, 0.0);
     }
+
+    /**
+     * Tests serialization.
+     */
+    @Test
+    public void testSerialize() {
+        final GeneralDirectPosition p = new GeneralDirectPosition(12, -20, 4, 9);
+        assertNotSame(p, assertSerializedEquals(p));
+    }
 }

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java?rev=1422246&r1=1422245&r2=1422246&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
(original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/DirectPosition2DTest.java
Sat Dec 15 13:18:40 2012
@@ -21,7 +21,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.apache.sis.test.Assert.*;
 
 
 /**
@@ -63,10 +63,12 @@ public final strictfp class DirectPositi
         DirectPosition p2 = new GeneralDirectPosition(48.543261561072285, -123.47009555832284);
         assertTrue(p1.equals(p2));
         assertTrue(p2.equals(p1));
+        assertEquals(p2.hashCode(), p1.hashCode());
 
         p1.setOrdinate(0, p1.getOrdinate(0) + 1);
         assertFalse(p1.equals(p2));
         assertFalse(p2.equals(p1));
+        assertFalse(p2.hashCode() == p1.hashCode());
     }
 
     /**
@@ -80,4 +82,13 @@ public final strictfp class DirectPositi
         assertEquals("Expected the same ordinates.", 10.0, p2.x, 0.0);
         assertEquals("Expected the same ordinates.", 30.0, p2.y, 0.0);
     }
+
+    /**
+     * Tests serialization.
+     */
+    @Test
+    public void testSerialize() {
+        final GeneralDirectPosition p = new GeneralDirectPosition(12, -20, 4, 9);
+        assertNotSame(p, assertSerializedEquals(p));
+    }
 }

Modified: sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java?rev=1422246&r1=1422245&r2=1422246&view=diff
==============================================================================
--- sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java
(original)
+++ sis/branches/JDK7/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralDirectPositionTest.java
Sat Dec 15 13:18:40 2012
@@ -20,7 +20,7 @@ import java.util.Arrays;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.apache.sis.test.Assert.*;
 
 
 /**
@@ -95,4 +95,13 @@ public final strictfp class GeneralDirec
         assertTrue   ("Expected the same ordinates.", Arrays.equals(p1.ordinates, p2.ordinates));
         assertNotSame("the ordinates array should have been cloned.", p1.ordinates, p2.ordinates);
     }
+
+    /**
+     * Tests serialization.
+     */
+    @Test
+    public void testSerialize() {
+        final GeneralDirectPosition p = new GeneralDirectPosition(12, -20, 4, 9);
+        assertNotSame(p, assertSerializedEquals(p));
+    }
 }



Mime
View raw message