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 2011/10/20 16:26:56 UTC
svn commit: r1186831 -
/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/entry/SchemaAwareEntryTest.java
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" ) );
+ }
}