directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1186831 - /directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java
Date Thu, 20 Oct 2011 14:26:56 GMT
Author: elecharny
Date: Thu Oct 20 14:26:56 2011
New Revision: 1186831

URL: http://svn.apache.org/viewvc?rev=1186831&view=rev
Log:
Added a test for userCertificate;binary

Modified:
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java?rev=1186831&r1=1186830&r2=1186831&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java
Thu Oct 20 14:26:56 2011
@@ -1240,4 +1240,28 @@ public class SchemaAwareEntryTest
     }
     
   
+    /**
+     * Test method for userCertificate;binary AT
+     */
+    @Test
+    public void testUserCertificateBinary() throws LdapException
+    {
+        Entry entry = new DefaultEntry( schemaManager );
+        entry.add( "objectClass", "top", "person", "inetorgPerson" );
+        entry.add( "cn", "test1", "test2" );
+        entry.add( "sn", "Test1", "Test2" );
+        entry.add( "userPassword", BYTES1, BYTES2 );
+        
+        entry.add( "userCertificate;binary", Strings.getBytesUtf8( "secret" ) );
+        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
+        assertTrue( entry.containsAttribute( "userCertificate" ) );
+        
+        entry.removeAttributes( "userCertificate;binary" );
+        assertFalse( entry.containsAttribute( "userCertificate;binary" ) );
+        assertFalse( entry.containsAttribute( "userCertificate" ) );
+        
+        entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) );
+        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
+        assertTrue( entry.containsAttribute( "userCertificate" ) );
+    }
 }



Mime
View raw message