directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r329945 - /directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
Date Tue, 01 Nov 2005 01:01:56 GMT
Author: elecharny
Date: Mon Oct 31 17:01:51 2005
New Revision: 329945

URL: http://svn.apache.org/viewcvs?rev=329945&view=rev
Log:
Fixed the test of binary attributes

Modified:
    directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java

Modified: directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java?rev=329945&r1=329944&r2=329945&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
(original)
+++ directory/apacheds/branches/apacheds-utf8/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
Mon Oct 31 17:01:51 2005
@@ -23,6 +23,7 @@
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.server.AbstractAdminTestCase;
 
 
@@ -59,7 +60,7 @@
         ctx = ( DirContext ) sysRoot.lookup( "ou=test" ) ;
         ou = ctx.getAttributes( "" ).get( "ou" );
         value = ou.get();
-        assertTrue( value instanceof byte[] );
+        assertEquals( "test", value );
 
         // try krb5Key which should be binary automatically - use ou as control
         byte[] keyValue = new byte[] { 0x45, 0x23, 0x7d, 0x7f };
@@ -68,10 +69,11 @@
         ctx = ( DirContext ) sysRoot.lookup( "ou=anothertest" ) ;
         ou = ctx.getAttributes( "" ).get( "ou" );
         value = ou.get();
-        assertTrue( value instanceof byte[] );
+        assertEquals( "anothertest", value );
         Attribute jpegPhoto = ctx.getAttributes( "" ).get( "jpegPhoto" );
         value = jpegPhoto.get();
         assertTrue( value instanceof byte[] );
+        assertEquals( "0x45 0x23 0x7D 0x7F ", StringUtils.dumpBytes( (byte[])value ) );
 
         // try jpegPhoto which should be binary automatically but use String to
         // create so we should still get back a byte[] - use ou as control
@@ -81,7 +83,7 @@
         ctx = ( DirContext ) sysRoot.lookup( "ou=yetanothertest" ) ;
         ou = ctx.getAttributes( "" ).get( "ou" );
         value = ou.get();
-        assertTrue( value instanceof byte[] );
+        assertEquals( "yetanothertest", value );
         jpegPhoto = ctx.getAttributes( "" ).get( "jpegPhoto" );
         value = jpegPhoto.get();
         assertTrue( value instanceof byte[] );



Mime
View raw message