Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 85976 invoked from network); 1 Nov 2005 01:02:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Nov 2005 01:02:18 -0000 Received: (qmail 66459 invoked by uid 500); 1 Nov 2005 01:02:18 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 66428 invoked by uid 500); 1 Nov 2005 01:02:17 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 66417 invoked by uid 99); 1 Nov 2005 01:02:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2005 17:02:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 31 Oct 2005 17:02:13 -0800 Received: (qmail 85840 invoked by uid 65534); 1 Nov 2005 01:01:56 -0000 Message-ID: <20051101010156.85839.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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[] );