harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r392879 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth/src: main/java/common/org/ietf/jgss/Oid.java test/java/common/org/ietf/jgss/OidTest.java
Date Mon, 10 Apr 2006 04:20:30 GMT
Author: smishura
Date: Sun Apr  9 21:20:26 2006
New Revision: 392879

URL: http://svn.apache.org/viewcvs?rev=392879&view=rev
Log:
HARMONY-240 (new org.ietf.jgss.Oid(null) throws incorrect exception)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java?rev=392879&r1=392878&r2=392879&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/ietf/jgss/Oid.java
Sun Apr  9 21:20:26 2006
@@ -70,6 +70,10 @@
      * @com.intel.drl.spec_ref
      */
     public Oid(InputStream derOid) throws GSSException {
+        if (derOid == null) {
+            throw new NullPointerException();
+        }
+
         try {
             oid = new ObjectIdentifier((int[]) ASN1.decode(derOid));
         } catch (IOException e) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java?rev=392879&r1=392878&r2=392879&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
Sun Apr  9 21:20:26 2006
@@ -102,6 +102,9 @@
         }
     }
     
+    /**
+     * @tests org.ieft.jgss.Oid#containedIn(org.ieft.jgss.Oid[])
+     */
     public void testContainedIn() throws Exception {
         Oid oid= new Oid("1.2.1.2.1");
         Oid [] oidArr= new Oid [] { 
@@ -111,6 +114,12 @@
                 new Oid("1.2.1.2.5")
                 };
         assertTrue(oid.containedIn(oidArr) );
+
+        try {
+            oid.containedIn(null);
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
     }
     
     /**
@@ -267,7 +276,44 @@
         assertEquals(0x03, in.read());
         assertEquals(0, in.available());
     }
-    
+
+    /**
+     * @tests org.ieft.jgss.Oid#Oid(byte[])
+     */
+    public final void test_ConstructorLbyte_array() throws GSSException {
+
+        try {
+            new Oid((byte[]) null);
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * @tests org.ieft.jgss.Oid#Oid(java.io.InputStream)
+     */
+    public final void test_ConstructorLjava_io_InputStream()
+            throws GSSException {
+
+        try {
+            new Oid((java.io.InputStream) null);
+            fail("No expected NullPointerException");
+        } catch (NullPointerException e) {
+        }
+    }
+
+    /**
+     * @tests org.ieft.jgss.Oid#Oid(java.lang.String)
+     */
+    public final void test_ConstructorLjava_lang_String() {
+
+        try {
+            new Oid((java.lang.String) null);
+            fail("No expected GSSException");
+        } catch (GSSException e) {
+        }
+    }
+
     public static Test suite() {
         return new TestSuite(OidTest.class);
     }



Mime
View raw message