harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r414140 - in /incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security: cert/serialization/ serialization/
Date Wed, 14 Jun 2006 08:11:00 GMT
Author: smishura
Date: Wed Jun 14 01:11:00 2006
New Revision: 414140

URL: http://svn.apache.org/viewvc?rev=414140&view=rev
Log:
Separating common and class specific checks

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/serialization/CertPathValidatorExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/AccessControlExceptionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PrivilegedActionExceptionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/serialization/CertPathValidatorExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/serialization/CertPathValidatorExceptionTest.java?rev=414140&r1=414139&r2=414140&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/serialization/CertPathValidatorExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/cert/serialization/CertPathValidatorExceptionTest.java
Wed Jun 14 01:11:00 2006
@@ -56,27 +56,13 @@
     }
 
     public void assertDeserialized(Serializable oref, Serializable otest) {
+        
+        // common checks
+        THROWABLE_COMPARATOR.assertDeserialized(oref, otest);
+        
+        // class specific checks
         CertPathValidatorException ref = (CertPathValidatorException) oref;
         CertPathValidatorException test = (CertPathValidatorException) otest;
-        String s = ref.getMessage();
-        Throwable th = ref.getCause();
-        if (s == null) {
-            assertNull(test.getMessage());
-        } else {
-            assertEquals(test.getMessage(), s);
-        }
-        if (th == null) {
-            assertNull(test.getCause());
-        } else {
-            Throwable th1 = test.getCause();
-            assertEquals(th1.getClass(), th.getClass());
-            String s1 = th.getMessage();
-            if (s1 == null) {
-                assertNull(th1.getMessage());
-            } else {
-                assertEquals(th1.getMessage(), s1);
-            }
-        }
         CertPath cp = ref.getCertPath();
         int ind = ref.getIndex();
         assertEquals("Incorrect index", test.getIndex(), ind);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/AccessControlExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/AccessControlExceptionTest.java?rev=414140&r1=414139&r2=414140&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/AccessControlExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/AccessControlExceptionTest.java
Wed Jun 14 01:11:00 2006
@@ -50,15 +50,13 @@
     }
 
     public void assertDeserialized(Serializable oref, Serializable otest) {
+        
+        // common checks
+        THROWABLE_COMPARATOR.assertDeserialized(oref, otest);
+
+        // class specific checks
         AccessControlException ref = (AccessControlException) oref;
         AccessControlException test = (AccessControlException) otest;
-        String s = ref.getMessage();
-        if (s == null) {
-            assertNull(test.getMessage());
-        } else {
-            assertTrue(s.equals(test.getMessage()));
-        }
-
         Permission p = ref.getPermission();
         if (p == null) {
             assertNull(test.getPermission());

Modified: incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PrivilegedActionExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PrivilegedActionExceptionTest.java?rev=414140&r1=414139&r2=414140&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PrivilegedActionExceptionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java.injected/java/security/serialization/PrivilegedActionExceptionTest.java
Wed Jun 14 01:11:00 2006
@@ -49,14 +49,18 @@
     }
     
     public void assertDeserialized(Serializable reference, Serializable otest) {
+        
+        // common checks
+        THROWABLE_COMPARATOR.assertDeserialized(reference, otest);
+        
+        // class specific checks
         PrivilegedActionException ref = (PrivilegedActionException)reference;
         PrivilegedActionException test = (PrivilegedActionException)otest;
         if( ref.getException() == null ) {
             assertNull( test.getException() );
-        }
-        else {
-            // just be sure we've deserialized the right class
-            assertSame(ref.getException().getClass(), test.getException().getClass() );
+        } else {
+            THROWABLE_COMPARATOR.assertDeserialized(ref.getException(), test
+                    .getException());
         }
     }
     



Mime
View raw message