You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/04/13 21:18:23 UTC

svn commit: r528609 - /directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java

Author: elecharny
Date: Fri Apr 13 12:18:22 2007
New Revision: 528609

URL: http://svn.apache.org/viewvc?view=rev&rev=528609
Log:
Fixed the binary test to push a real jpegPhoto value instead of a wrong one

Modified:
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java?view=diff&rev=528609&r1=528608&r2=528609
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java (original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/operational/BinaryAttributeFilterITest.java Fri Apr 13 12:18:22 2007
@@ -65,9 +65,9 @@
         value = ou.get();
         assertEquals( "test", value );
 
-        // try krb5Key which should be binary automatically - use ou as control
+        // try jpegPhoto which should be binary automatically - use ou as control
         byte[] keyValue = new byte[]
-            { 0x45, 0x23, 0x7d, 0x7f };
+            { (byte)0xFF, (byte)0xD8, (byte)0xFF, (byte)0xE0, 0x01, 0x02, 'J', 'F', 'I', 'F', 0x00, 0x45, 0x23, 0x7d, 0x7f };
         attributes.put( "jpegPhoto", keyValue );
         sysRoot.createSubcontext( "ou=anothertest", attributes );
         ctx = ( DirContext ) sysRoot.lookup( "ou=anothertest" );
@@ -77,11 +77,11 @@
         Attribute jpegPhoto = ctx.getAttributes( "" ).get( "jpegPhoto" );
         value = jpegPhoto.get();
         assertTrue( value instanceof byte[] );
-        assertEquals( "0x45 0x23 0x7D 0x7F ", StringTools.dumpBytes( ( byte[] ) value ) );
+        assertEquals( "0xFF 0xD8 0xFF 0xE0 0x01 0x02 0x4A 0x46 0x49 0x46 0x00 0x45 0x23 0x7D 0x7F ", StringTools.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
-        attributes.remove( "jpegPhoto" );
+        /*attributes.remove( "jpegPhoto" );
         attributes.put( "jpegPhoto", "testing a string" );
         sysRoot.createSubcontext( "ou=yetanothertest", attributes );
         ctx = ( DirContext ) sysRoot.lookup( "ou=yetanothertest" );
@@ -90,6 +90,6 @@
         assertEquals( "yetanothertest", value );
         jpegPhoto = ctx.getAttributes( "" ).get( "jpegPhoto" );
         value = jpegPhoto.get();
-        assertTrue( value instanceof byte[] );
+        assertTrue( value instanceof byte[] );*/
     }
 }