harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r483402 - in /harmony/enhanced/classlib/trunk/modules/luni/src/test: java/org/apache/harmony/luni/tests/java/lang/ java/org/apache/harmony/tests/java/lang/ resources/serialization/java/lang/ resources/serialization/org/apache/harmony/luni/t...
Date Thu, 07 Dec 2006 10:16:09 GMT
Author: smishura
Date: Thu Dec  7 02:16:08 2006
New Revision: 483402

URL: http://svn.apache.org/viewvc?view=rev&rev=483402
Log:
Migrate to new serialization testing framework (except one test case)

Added:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/EnumTest.java
      - copied, changed from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/EnumTest.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum.java
      - copied, changed from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum2.java
      - copied, changed from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum2.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.0.ser
  (with props)
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.1.ser
  (with props)
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.2.ser
  (with props)
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.3.ser
  (with props)
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.harmony.ser
  (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/EnumTest.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum2.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/lang/EnumTest.Harmony.ser
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/lang/EnumTest.golden.1.ser
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/lang/EnumTest.golden.2.ser
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/lang/EnumTest.golden.3.ser
    harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/java/lang/EnumTest.golden.4.ser

Copied: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/EnumTest.java
(from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/EnumTest.java)
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/EnumTest.java?view=diff&rev=483402&p1=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/EnumTest.java&r1=483368&p2=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/EnumTest.java&r2=483402
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/EnumTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/EnumTest.java
Thu Dec  7 02:16:08 2006
@@ -14,9 +14,8 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.tests.java.lang;
+package org.apache.harmony.luni.tests.java.lang;
 
-import java.io.IOException;
 import java.util.HashMap;
 
 import junit.framework.TestCase;
@@ -185,96 +184,60 @@
     }
     
     /**
-     * @test Serialization/deserilazation compatibility with RI.
-     */
-    public void test_compatibilitySerialization() throws Exception{
-        assertTrue(SerializationTester.assertCompabilityEquals(Sample.CURLY,"serialization/java/lang/EnumTest.golden.1.ser"));
-    }
-    
-    /**
-     * @test Serialization/deserilazation compatibility with RI.
-     */
-    public void test_compatibilitySerialization_inClass() throws Exception{
-        assertTrue(SerializationTester.assertCompabilityEquals(new MockEnum(),"serialization/java/lang/EnumTest.golden.2.ser"));
-    }
-    
-    /**
-     * @test Serialization/deserilazation compatibility.
-     */
-    public void test_serialization() throws IOException, ClassNotFoundException{
-        Sample object = Sample.CURLY;
-        Sample deObject = (Sample) SerializationTester
-                .getDeserilizedObject(object);
-        assertEquals(object, deObject);
-    }
-    
-    /**
-     * test a class that has enums as its fields.
-     * 
-     * @test Serialization/deserilazation compatibility.
-     */
-    public void test_serialization_inClass() throws IOException, ClassNotFoundException{
-        MockEnum mock = new MockEnum();
-        MockEnum test = (MockEnum) SerializationTester
-                .getDeserilizedObject(mock);
-        assertEquals(mock.i,test.i);
-        assertEquals(mock.str,test.str);
-        assertEquals(mock.samEnum,test.samEnum);
-    }
-    
-    /**
-     * test a class that has enums and a string of same name as its fields.
-     * 
-     * @test Serialization/deserilazation compatibility with RI.
-     */
-    public void test_compatibilitySerialization_inClass_Complex() throws Exception{
-        assertTrue(SerializationTester.assertCompabilityEquals(new MockEnum2(),"serialization/java/lang/EnumTest.golden.3.ser"));
-    }
-    
-    /**
      * @test Serialization/deserilazation compatibility with Harmony.
      */
     public void test_compatibilitySerialization_inClass_Complex_Harmony() throws Exception{
-        assertTrue(SerializationTester.assertCompabilityEquals(new MockEnum2(),"serialization/java/lang/EnumTest.Harmony.ser"));
+        // TODO migrate to the new testing framework 
+        assertTrue(SerializationTester.assertCompabilityEquals(new MockEnum2(),
+            "serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.harmony.ser"));
     }
     
     /**
-     * test a class that has enums and a string of same name as its fields.
-     * 
-     * @test Serialization/deserilazation compatibility.
-     */
-    public void test_serialization_inClass_Complex() throws Exception{
-        MockEnum2 mock = new MockEnum2();
-        MockEnum2 test = (MockEnum2) SerializationTester
-                .getDeserilizedObject(mock);
-        assertEquals(mock.i,test.i);
-        assertEquals(mock.str,test.str);
-        assertEquals(mock.samEnum,test.samEnum);
-    }       
-    
-    /**
-     * test a map class that has enums.
-     * 
-     * @test Serialization/deserialization compatibility.
+     * @tests serialization/deserialization compatibility.
      */
-    public void test_serialization_inMap() throws Exception {
+    public void testSerializationSelf() throws Exception {
+
+        // test a map class that has enums.
         // regression test for Harmony-1163
         HashMap<Color, Integer> enumColorMap = new HashMap<Color, Integer>();
         enumColorMap.put(Color.Red, 1);
         enumColorMap.put(Color.Blue, 3);
-        SerializationTest.verifySelf(enumColorMap);
+
+        Object[] testCases = { enumColorMap, Sample.CURLY };
+
+        SerializationTest.verifySelf(testCases);
+
+        // test a class that has enums as its fields.
+        MockEnum mock = new MockEnum();
+        MockEnum test = (MockEnum) SerializationTest.copySerializable(mock);
+        assertEquals(mock.i, test.i);
+        assertEquals(mock.str, test.str);
+        assertEquals(mock.samEnum, test.samEnum);
+
+        // test a class that has enums and a string of same name as its fields.
+        MockEnum2 mock2 = new MockEnum2();
+        MockEnum2 test2 = (MockEnum2) SerializationTest.copySerializable(mock2);
+        assertEquals(mock2.i, test2.i);
+        assertEquals(mock2.str, test2.str);
+        assertEquals(mock2.samEnum, test2.samEnum);
     }
-    
+
     /**
-     * test a map class that has enums.
-     * 
-     * @test Serialization/deserialization compatibility.
+     * @tests serialization/deserialization compatibility with RI.
      */
-    public void test_compatibilitySerialization_inMap() throws Exception {
+    public void testSerializationCompatibility() throws Exception {
+
         // regression test for Harmony-1163
         HashMap<Color, Integer> enumColorMap = new HashMap<Color, Integer>();
         enumColorMap.put(Color.Red, 1);
-        enumColorMap.put(Color.Blue, 3);        
-        assertTrue(SerializationTester.assertCompabilityEquals(enumColorMap,"serialization/java/lang/EnumTest.golden.4.ser"));
+        enumColorMap.put(Color.Blue, 3);
+
+        Object[] testCases = { Sample.CURLY, new MockEnum(),
+        // test a class that has enums and a string of same name as its fields.
+                new MockEnum2(),
+                // test a map class that has enums.
+                enumColorMap, };
+
+        SerializationTest.verifyGolden(this, testCases);
     }
 }

Copied: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum.java
(from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum.java)
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum.java?view=diff&rev=483402&p1=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum.java&r1=483368&p2=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum.java&r2=483402
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum.java
Thu Dec  7 02:16:08 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.tests.java.lang;
+package org.apache.harmony.luni.tests.java.lang;
 
 import java.io.Serializable;
 

Copied: harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum2.java
(from r483368, harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum2.java)
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum2.java?view=diff&rev=483402&p1=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum2.java&r1=483368&p2=harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum2.java&r2=483402
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/lang/MockEnum2.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/MockEnum2.java
Thu Dec  7 02:16:08 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.tests.java.lang;
+package org.apache.harmony.luni.tests.java.lang;
 
 import java.io.Serializable;
 

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.0.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.0.ser?view=auto&rev=483402
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.0.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.1.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.1.ser?view=auto&rev=483402
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.1.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.2.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.2.ser?view=auto&rev=483402
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.2.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.3.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.3.ser?view=auto&rev=483402
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.golden.3.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.harmony.ser
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.harmony.ser?view=auto&rev=483402
==============================================================================
Binary file - no diff available.

Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/serialization/org/apache/harmony/luni/tests/java/lang/EnumTest.harmony.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message