directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r329680 - in /directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec: ./ primitives/
Date Mon, 31 Oct 2005 00:46:45 GMT
Author: elecharny
Date: Sun Oct 30 16:46:37 2005
New Revision: 329680

URL: http://svn.apache.org/viewcvs?rev=329680&view=rev
Log:
 - No more need of OctetString. All values are either String or byte[]
 - Changed the test accordingly

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java
    directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/primitives/LdapUrlTest.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
Sun Oct 30 16:46:37 2005
@@ -31,7 +31,6 @@
 import org.apache.asn1new.ber.containers.IAsn1Container;
 import org.apache.asn1new.ldap.pojo.AddRequest;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
-import org.apache.asn1new.primitives.OctetString;
 import org.apache.asn1new.util.StringUtils;
 
 import junit.framework.Assert;
@@ -131,7 +130,7 @@
 
         while ( values.hasMore() )
         {
-            OctetString value = (OctetString)values.next();
+            Object value = values.next();
             
             Assert.assertTrue( vals.contains( value.toString() ) );
             
@@ -147,7 +146,7 @@
 	
 	    while ( values.hasMore() )
 	    {
-	        OctetString value = (OctetString)values.next();
+	        Object value = values.next();
 	        
 	        Assert.assertTrue( vals.contains( value.toString() ) );
 	        

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindRequestTest.java
Sun Oct 30 16:46:37 2005
@@ -85,7 +85,7 @@
         Assert.assertEquals( 3, br.getVersion() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication
) );
-        Assert.assertEquals( "password", ( ( SimpleAuthentication ) br.getAuthentication()
).getSimple().toString() );
+        Assert.assertEquals( "password", StringUtils.toUtf8( ( ( SimpleAuthentication ) br.getAuthentication()
).getSimple() ) );
 
         // Check the length
         Assert.assertEquals(0x35, message.computeLength());
@@ -198,7 +198,7 @@
         Assert.assertEquals( 3, br.getVersion() );
         Assert.assertEquals( "", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication
) );
-        Assert.assertEquals( "password", ( ( (SimpleAuthentication)br.getAuthentication()
).getSimple().toString() ) );
+        Assert.assertEquals( "password", StringUtils.toUtf8( ( (SimpleAuthentication)br.getAuthentication()
).getSimple() ) );
 
         // Check the length
         Assert.assertEquals(0x16, message.computeLength());
@@ -352,7 +352,7 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials )
);
         Assert.assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication()
).getMechanism() );
-        Assert.assertEquals( "abcdef", ( ( SaslCredentials ) br.getAuthentication() ).getCredentials().toString()
);
+        Assert.assertEquals( "abcdef", StringUtils.toUtf8( ( ( SaslCredentials ) br.getAuthentication()
).getCredentials() ) );
 
         // Check the length
         Assert.assertEquals(0x40, message.computeLength());

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
Sun Oct 30 16:46:37 2005
@@ -157,7 +157,7 @@
         Assert.assertEquals( 0, br.getLdapResult().getResultCode() );
         Assert.assertEquals( "", br.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
-        Assert.assertEquals( "AB", br.getServerSaslCreds().toString());
+        Assert.assertEquals( "AB", StringUtils.toUtf8( br.getServerSaslCreds() ) );
 
         // Check the length
         Assert.assertEquals(0x12, message.computeLength());

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedRequestTest.java
Sun Oct 30 16:46:37 2005
@@ -82,7 +82,7 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
-        Assert.assertEquals( "value", extendedRequest.getRequestValue().toString() );
+        Assert.assertEquals( "value", StringUtils.toUtf8( extendedRequest.getRequestValue()
) );
         
         // Check the length
         Assert.assertEquals(0x16, message.computeLength());

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
Sun Oct 30 16:46:37 2005
@@ -93,7 +93,7 @@
         Assert.assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
-        Assert.assertEquals( "value", extendedResponse.getResponse().toString() );
+        Assert.assertEquals( "value", StringUtils.toUtf8( (byte[])extendedResponse.getResponse()
) );
         
         // Check the length
         Assert.assertEquals(0x1D, message.computeLength());

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/LdapDecoderTest.java
Sun Oct 30 16:46:37 2005
@@ -26,6 +26,7 @@
 import org.apache.asn1new.ldap.pojo.BindRequest;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
 import org.apache.asn1new.ldap.pojo.SimpleAuthentication;
+import org.apache.asn1new.util.StringUtils;
 
 import java.nio.ByteBuffer;
 
@@ -90,7 +91,7 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication
) );
         Assert.assertEquals( "password",
-            ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple().toString() );
+            StringUtils.toUtf8( ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple()
) );
     }
 
     /**
@@ -216,7 +217,7 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication
) );
         Assert.assertEquals( "password",
-            ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple().toString() );
+            StringUtils.toUtf8( ( ( SimpleAuthentication ) br.getAuthentication() ).getSimple()
) );
     }
 
     /**

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
Sun Oct 30 16:46:37 2005
@@ -32,7 +32,6 @@
 import org.apache.asn1new.ber.containers.IAsn1Container;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
 import org.apache.asn1new.ldap.pojo.ModifyRequest;
-import org.apache.asn1new.primitives.OctetString;
 import org.apache.asn1new.util.StringUtils;
 
 import junit.framework.Assert;
@@ -141,9 +140,16 @@
 
         while ( values.hasMore() )
         {
-            OctetString value = (OctetString)values.next();
+            Object value = values.next();
             
-            Assert.assertTrue( vals.contains( value.toString() ) );
+            if ( value instanceof String )
+            {
+                Assert.assertTrue( vals.contains( value ) );
+            }
+            else
+            {
+                Assert.assertTrue( vals.contains( StringUtils.toUtf8( (byte[])value ) ) );
+            }
             
             vals.remove( value.toString() );
         }
@@ -268,9 +274,16 @@
 
         while ( values.hasMore() )
         {
-            OctetString value = (OctetString)values.next();
+            Object value = values.next();
             
-            Assert.assertTrue( vals.contains( value.toString() ) );
+            if ( value instanceof String )
+            {
+                Assert.assertTrue( vals.contains( value ) );
+            }
+            else
+            {
+                Assert.assertTrue( vals.contains( StringUtils.toUtf8( (byte[])value ) ) );
+            }
             
             vals.remove( value.toString() );
         }
@@ -414,9 +427,16 @@
 
         while ( values.hasMore() )
         {
-            OctetString value = (OctetString)values.next();
+            Object value = values.next();
             
-            Assert.assertTrue( vals.contains( value.toString() ) );
+            if ( value instanceof String )
+            {
+                Assert.assertTrue( vals.contains( value ) );
+            }
+            else
+            {
+                Assert.assertTrue( vals.contains( StringUtils.toUtf8( (byte[])value ) ) );
+            }
             
             vals.remove( value.toString() );
         }

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultEntryTest.java
Sun Oct 30 16:46:37 2005
@@ -30,7 +30,6 @@
 import org.apache.asn1new.ber.containers.IAsn1Container;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
 import org.apache.asn1new.ldap.pojo.SearchResultEntry;
-import org.apache.asn1new.primitives.OctetString;
 import org.apache.asn1new.util.StringUtils;
 
 import junit.framework.Assert;
@@ -117,7 +116,7 @@
             
             while ( values.hasMore() )
             {
-                OctetString value = (OctetString)values.next();
+                Object value = values.next();
                 
                 Assert.assertTrue( expectedValues.contains( value.toString() ) );
                 
@@ -227,7 +226,7 @@
             
             while ( values.hasMore() )
             {
-                OctetString value = (OctetString)values.next();
+                Object value = values.next();
                 
                 Assert.assertTrue( expectedValues.contains( value.toString() ) );
                 
@@ -332,7 +331,7 @@
             
             while ( values.hasMore() )
             {
-                OctetString value = (OctetString)values.next();
+                Object value = values.next();
                 
                 Assert.assertTrue( expectedValues.contains( value.toString() ) );
                 

Modified: directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/primitives/LdapUrlTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/primitives/LdapUrlTest.java?rev=329680&r1=329679&r2=329680&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/primitives/LdapUrlTest.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/apache2-provider/src/test/org/apache/asn1new/ldap/codec/primitives/LdapUrlTest.java
Sun Oct 30 16:46:37 2005
@@ -19,7 +19,6 @@
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import org.apache.asn1.codec.DecoderException;
 import org.apache.asn1new.ldap.codec.primitives.LdapURL;
 
 /**



Mime
View raw message