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

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


        // Test a simple addition
        entry.add( "userPASSWORD", testB1 );
        assertNotNull( entry.get( atPassword ) );
        assertEquals( 1, entry.get( atPassword ).size() );
        assertTrue( Arrays.equals( b1, entry.get( atPassword ).get().getBytes() ) );
        assertTrue( entry.containsAttribute( atPassword ) );
        assertEquals( "userPASSWORD", entry.get( atPassword ).getUpId() );

        // Test some more addition
        entry.add( "userPASSWORD", testB2, testB3 );
        assertNotNull( entry.get( atPassword ) );
View Full Code Here


        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        // Test a simple addition
        entry.add( "EMail", "test1" );
        assertNotNull( entry.get( atEMail ) );
        assertTrue( entry.containsAttribute( atEMail ) );
        assertEquals( "1.2.840.113549.1.9.1", entry.get( atEMail ).getId() );
        assertEquals( "EMail", entry.get( atEMail ).getUpId() );
        assertEquals( 1, entry.get( atEMail ).size() );
        assertEquals( "test1", entry.get( atEMail ).get().getString() );
View Full Code Here

        // Test a simple addition in atDC
        entry.add( "eMail", test1 );
        assertNotNull( entry.get( atEMail ) );
        assertEquals( 1, entry.get( atEMail ).size() );
        assertEquals( "test1", entry.get( atEMail ).get().getString() );
        assertTrue( entry.containsAttribute( atEMail ) );
        assertEquals( "eMail", entry.get( atEMail ).getUpId() );

        // Test some more addition
        entry.add( "eMail", test2, test3 );
        assertNotNull( entry.get( atEMail ) );
View Full Code Here

    public void testContainsStringByteArrayArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( String ) null, BYTES3 ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );

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

        entry.add( attrPWD );
View Full Code Here

    public void testContainsStringStringArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( String ) null, "test" ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );

        Attribute attrEMail = new DefaultAttribute( atEMail, "test1", ( String ) null, "test2" );

        entry.add( attrEMail );
View Full Code Here

    public void testContainsStringValueArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( String ) null, "test" ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );

        Attribute attrEMail = new DefaultAttribute( atEMail, "test1", "test2", ( String ) null );
        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );

        entry.add( attrEMail, attrPWD );
View Full Code Here

    @Test
    public void testContainsAttributeAttributeType() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.containsAttribute( atOC ) );

        Attribute attrOC = new DefaultAttribute( atOC, "top", "person" );
        Attribute attrCN = new DefaultAttribute( atCN, "test1", "test2" );
        Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" );
        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 );
View Full Code Here

        Attribute attrSN = new DefaultAttribute( atSN, "Test1", "Test2" );
        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );

        assertTrue( entry.containsAttribute( atOC ) );
        assertTrue( entry.containsAttribute( atCN ) );
        assertTrue( entry.containsAttribute( atSN ) );
        assertTrue( entry.containsAttribute( atPwd ) );

        entry.clear();
View Full Code Here

        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );

        assertTrue( entry.containsAttribute( atOC ) );
        assertTrue( entry.containsAttribute( atCN ) );
        assertTrue( entry.containsAttribute( atSN ) );
        assertTrue( entry.containsAttribute( atPwd ) );

        entry.clear();
View Full Code Here

        entry.add( attrOC, attrCN, attrSN, attrPWD );

        assertTrue( entry.containsAttribute( atOC ) );
        assertTrue( entry.containsAttribute( atCN ) );
        assertTrue( entry.containsAttribute( atSN ) );
        assertTrue( entry.containsAttribute( atPwd ) );

        entry.clear();

        assertFalse( entry.containsAttribute( atOC ) );
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.