harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r483841 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/org/apache/harmony/security/x509/GeneralName.java test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java
Date Fri, 08 Dec 2006 05:59:14 GMT
Author: smishura
Date: Thu Dec  7 21:59:13 2006
New Revision: 483841

URL: http://svn.apache.org/viewvc?view=rev&rev=483841
Log:
Fix and regression tests for HARMONY-2487
([classlib][security] java.security.cert.X509CertSelector.addSubjectAlternativeName(int, null)
throws IOException while RI throws NullPointerException (RI compatibility issue))

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java?view=diff&rev=483841&r1=483840&r2=483841
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/org/apache/harmony/security/x509/GeneralName.java
Thu Dec  7 21:59:13 2006
@@ -250,7 +250,7 @@
     public GeneralName(int tag, byte[] name) 
                                     throws IOException {
         if (name == null) {
-            throw new IOException(Messages.getString("security.28")); //$NON-NLS-1$
+            throw new NullPointerException(Messages.getString("security.28")); //$NON-NLS-1$
         }
         if ((tag < 0) || (tag > 8)) {
             throw new IOException(Messages.getString("security.183", tag)); //$NON-NLS-1$

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java?view=diff&rev=483841&r1=483840&r2=483841
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/X509CertSelectorTest.java
Thu Dec  7 21:59:13 2006
@@ -28,9 +28,25 @@
 public class X509CertSelectorTest extends TestCase {
 
     /**
-     * @tests addSubjectAlternativeName(int type, String name)
+     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[])
      */
-    public void testAddSubjectAlternativeName() {
+    public void test_addSubjectAlternativeNameLintLbyte_array() throws IOException {
+        // Regression for HARMONY-2487
+        int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
+        for (int i = 0; i < types.length; i++) {
+            try {
+                new X509CertSelector().addSubjectAlternativeName(types[i],
+                        (byte[]) null);
+                fail("No expected NullPointerException for type: " + i);
+            } catch (NullPointerException e) {
+            }
+        }
+    }
+
+    /**
+     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String)
+     */
+    public void test_addSubjectAlternativeNameLintLjava_lang_String() {
         // Regression for HARMONY-727
         int[] types = { 0, 2, 3, 4, 5, 6, 7, 8 };
         for (int i = 0; i < types.length; i++) {
@@ -42,11 +58,26 @@
             }
         }
     }
-    
+
     /**
-     * @tests addPathToName(int type, String name)
+     * @tests java.security.cert.X509CertSelector#addPathToName(int, byte[])
      */
-    public void testAddPathToName() {
+    public void test_addPathToNameLintLbyte_array() throws IOException {
+        // Regression for HARMONY-2487
+        int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
+        for (int i = 0; i < types.length; i++) {
+            try {
+                new X509CertSelector().addPathToName(types[i], (byte[]) null);
+                fail("No expected NullPointerException for type: " + i);
+            } catch (NullPointerException e) {
+            }
+        }
+    }
+
+    /**
+     * @tests java.security.cert.X509CertSelector#addPathToName(int, String)
+     */
+    public void test_addPathToNameLintLjava_lang_String() {
         // Regression for HARMONY-724
         for (int type = 0; type <= 8; type++) {
             try {
@@ -57,5 +88,4 @@
             }
         }
     }
-
 }



Mime
View raw message