Package org.apache.directory.shared.ldap.model.entry

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute


    @Test
    public void testRemoveAttributesStringArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );

        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );
       
        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( "CN", "SN" );
       
View Full Code Here


    @Test
    public void testRemoveEntryAttributeArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );
       
        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        List<EntryAttribute> removed = entry.remove( attrSN, attrPWD );
       
View Full Code Here

    @Test
    public void testRemoveStringByteArrayArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, (byte[])null, BYTES2 );

        entry.put( attrPWD );
        assertTrue( entry.remove( "userPassword", (byte[])null ) );
        assertTrue( entry.remove( "userPassword", BYTES1, BYTES2 ) );
        assertFalse( entry.containsAttribute( "userPassword" ) );
View Full Code Here

    @Test
    public void testRemoveStringValueArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );

        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2", (String)null );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2, (byte[])null );

        entry.add( attrCN, attrPWD );
       
        Value<String> strValue1 = new StringValue( "test1" );
        Value<String> strValue2 = new StringValue( "test2" );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.