directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 10092 - incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap
Date Mon, 19 Apr 2004 03:48:58 GMT
Author: akarasulu
Date: Sun Apr 18 20:48:58 2004
New Revision: 10092

Modified:
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/BindResponseRuleTest.java
Log:
completed the test case

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/BindResponseRuleTest.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/BindResponseRuleTest.java
(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/BindResponseRuleTest.java
Sun Apr 18 20:48:58 2004
@@ -17,21 +17,19 @@
 package org.apache.snickers.ldap ;
 
 
+import java.util.Iterator ;
+import java.nio.ByteBuffer ;
+
 import junit.framework.TestCase ;
 
 import org.apache.snickers.ber.digester.BERDigester ;
 
+import org.apache.snickers.ber.* ;
 import org.apache.snickers.ber.digester.rules.PrimitiveIntDecodeRule ;
-import org.apache.snickers.ber.digester.rules.PrimitiveEnumDecodeRule ;
 import org.apache.snickers.ber.digester.rules.PrimitiveOctetStringRule ;
-import org.apache.snickers.ber.*;
 
-import org.apache.ldap.common.message.*;
-import org.apache.ldap.common.berlib.snacc.ldap_v3.LDAPResultEnum;
-import org.apache.commons.codec.stateful.CallbackHistory;
-import org.apache.commons.lang.ArrayUtils;
-
-import java.nio.ByteBuffer ;
+import org.apache.ldap.common.message.* ;
+import org.apache.commons.codec.stateful.CallbackHistory ;
 
 
 /**
@@ -157,6 +155,22 @@
         assertNotNull( decoded.getServerSaslCreds() ) ;
         assertEquals( new String( resp.getServerSaslCreds() ),
                 new String( decoded.getServerSaslCreds() ) ) ;
+        LdapResult decodedResult = resp.getLdapResult() ;
+        assertEquals( result.getResultCode(), decodedResult.getResultCode() ) ;
+        assertEquals( result.getErrorMessage(),
+                decodedResult.getErrorMessage() ) ;
+        assertEquals( result.getMatchedDn(),
+                decodedResult.getMatchedDn() ) ;
+        Referral decodedRef = result.getReferral() ;
+        Iterator urls = referral.getLdapUrls().iterator() ;
+        Iterator decodedUrls = decodedRef.getLdapUrls().iterator() ;
+
+        while( urls.hasNext() && decodedUrls.hasNext() )
+        {
+            assertEquals( urls.next(), decodedUrls.next() ) ;
+        }
 
+        assertFalse( urls.hasNext() ) ;
+        assertFalse( decodedUrls.hasNext() ) ;
     }
 }

Mime
View raw message