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

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntry.containsAttribute()


        assertTrue( entry.remove( "cn", strValue1, strNullValue ) );
        assertTrue( entry.contains( "cn", strValue2 ) );
        assertFalse( entry.remove( "cn", strValue3 ) );
        assertTrue( entry.remove( "cn", strValue2 ) );
        assertFalse( entry.containsAttribute( "cn" ) );

        entry.add( attrCN, attrPWD );

        assertTrue( entry.remove( "userpassword", binValue1, binNullValue ) );
        assertTrue( entry.contains( "userpassword", binValue2 ) );
View Full Code Here


        assertTrue( entry.remove( "userpassword", binValue1, binNullValue ) );
        assertTrue( entry.contains( "userpassword", binValue2 ) );
        assertFalse( entry.remove( "userpassword", binValue3 ) );
        assertTrue( entry.remove( "userpassword", binValue2 ) );
        assertFalse( entry.containsAttribute( "userpassword" ) );
    }


    /**
     * Test method for setDN( Dn )
View Full Code Here

        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" ) );
View Full Code Here

        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" ) );
View Full Code Here

        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" ) );
View Full Code Here

        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" ) );
    }
View Full Code Here

        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" ) );
    }
}
View Full Code Here

        assertFalse( entry.containsAttribute( "userCertificate;binary" ) );
        assertFalse( entry.containsAttribute( "userCertificate" ) );

        entry.add( "userCertificate", Strings.getBytesUtf8( "secret" ) );
        assertTrue( entry.containsAttribute( "userCertificate;binary" ) );
        assertTrue( entry.containsAttribute( "userCertificate" ) );
    }
}
View Full Code Here

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

        assertFalse( entry.containsAttribute( "objectClass" ) );

        Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, ( byte[] ) null, BYTES2 );

        entry.add( attrPWD );
View Full Code Here

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

        assertFalse( entry.containsAttribute( "objectClass" ) );

        Attribute attrOC = new DefaultAttribute( "objectClass", "top", "person" );
        Attribute attrCN = new DefaultAttribute( "cn", "test1", "test2" );
        Attribute attrSN = new DefaultAttribute( "sn", "Test1", "Test2", ( String ) null );
        Attribute attrPWD = new DefaultAttribute( "userPassword", BYTES1, BYTES2 );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.