directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r165438 - /directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java
Date Sat, 30 Apr 2005 23:18:15 GMT
Author: elecharny
Date: Sat Apr 30 16:18:14 2005
New Revision: 165438

URL: http://svn.apache.org/viewcvs?rev=165438&view=rev
Log:
Added some Assert on the very first SPNEGO test case. The test case is OK, but a lot of test
cases are to be written.

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java?rev=165438&r1=165437&r2=165438&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java
Sat Apr 30 16:18:14 2005
@@ -22,6 +22,8 @@
 import org.apache.asn1.ber.Asn1Decoder;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ldap.codec.BindRequestTest;
+import org.apache.asn1.primitives.OID;
+import org.apache.asn1.spnego.pojo.SpnegoNegTokenInitPOJO;
 import org.apache.asn1.spnego.pojo.SpnegoPOJO;
 import org.apache.asn1.util.pools.PoolException;
 import org.apache.log4j.Logger;
@@ -95,6 +97,26 @@
     	
         SpnegoPOJO spnego = ( ( SpnegoContainer ) spnegoContainer ).getSpnego();
 
+        // Checks the Oids
+        OID oids[] = ((SpnegoNegTokenInitPOJO)spnego).getMechTypeList();
+        int nbOids = 0;
+        
+        for ( int i = 0 ; i < oids.length ; i++ )
+        {
+            if (oids[i] == null)
+            {
+                break;
+            }
+            
+            nbOids ++;
+        }
+        
+        Assert.assertEquals(2, nbOids);
+        Assert.assertEquals("1.2.840.48018.1.2.2", oids[0].getOID());
+        Assert.assertEquals("1.2.840.113554.1.2.2", oids[1].getOID());
+        
+        // Check the mech token
+        Assert.assertEquals("[61][62][63][64]", ((SpnegoNegTokenInitPOJO)spnego).getMechToken().toString());
 
         // Free the BindRequest Container. It will be put back in the IPool
         // after being reset.



Mime
View raw message