directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r168341 - /directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/spnego/codec/SpnegoTest.java
Date Thu, 05 May 2005 15:29:40 GMT
Author: elecharny
Date: Thu May  5 08:29:39 2005
New Revision: 168341

URL: http://svn.apache.org/viewcvs?rev=168341&view=rev
Log:
Fixed a reference to BindRequestTest that were still used, due to a copy/past. 
Changed the function that checks the reqFlags.

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=168341&r1=168340&r2=168341&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
Thu May  5 08:29:39 2005
@@ -21,7 +21,6 @@
 import org.apache.asn1.DecoderException;
 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.primitives.OctetString;
 import org.apache.asn1.spnego.pojo.SpnegoNegTokenInitPOJO;
@@ -38,7 +37,7 @@
  */
 public class SpnegoTest extends TestCase {
     /** Logger */
-    protected static Logger log = Logger.getLogger( BindRequestTest.class );
+    private  static Logger log = Logger.getLogger( SpnegoTest.class );
 
     static
     {
@@ -49,15 +48,15 @@
      * Check the default value of Req Flags
      * @param spnego The spnego POJO to test
      */
-    private void checkDefaultReqFlags(SpnegoPOJO spnego)
+    private boolean checkDefaultReqFlags(SpnegoNegTokenInitPOJO spnegoNegTokenInit)
     {
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isAnonFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isConfFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isDelegFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isIntegFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isMutualFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isReplayFlag());
-        Assert.assertEquals(false, ((SpnegoNegTokenInitPOJO)spnego).isSequenceFlag());
+        return 	!spnegoNegTokenInit.isAnonFlag() &&
+                !spnegoNegTokenInit.isConfFlag() &&
+                !spnegoNegTokenInit.isDelegFlag() &&
+                !spnegoNegTokenInit.isIntegFlag() &&
+                !spnegoNegTokenInit.isMutualFlag() &&
+                !spnegoNegTokenInit.isReplayFlag() &&
+                !spnegoNegTokenInit.isSequenceFlag();
     }
 
     /**
@@ -123,7 +122,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -203,7 +202,7 @@
         Assert.assertEquals("1.2.840.48018.1.2.2", oids[0].getOID());
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -296,7 +295,7 @@
         }
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -386,7 +385,7 @@
         }
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -556,7 +555,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         OctetString mechToken = ((SpnegoNegTokenInitPOJO)spnego).getMechToken();
@@ -636,7 +635,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals("[61][62][63][64]", ((SpnegoNegTokenInitPOJO)spnego).getMechToken().toString());
@@ -719,7 +718,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         OctetString mechToken = ((SpnegoNegTokenInitPOJO)spnego).getMechToken();
@@ -803,7 +802,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -883,7 +882,7 @@
         Assert.assertEquals(0, nbOids);
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals(null, ((SpnegoNegTokenInitPOJO)spnego).getMechToken());
@@ -969,7 +968,7 @@
         Assert.assertEquals("1.2.840.113554.1.2.2", oids[1].getOID());
         
         // Check the reqFlags
-        checkDefaultReqFlags(spnego);
+        Assert.assertTrue(checkDefaultReqFlags((SpnegoNegTokenInitPOJO)spnego));
 
         // Check the mech token
         Assert.assertEquals("[61][62][63][64]", ((SpnegoNegTokenInitPOJO)spnego).getMechToken().toString());



Mime
View raw message