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

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


        assertTrue( removed.get( 0 ).contains( "FR" ) );
        assertTrue( removed.get( 0 ).contains( "US" ) );
       
        assertEquals( 5, entry.size() );
       
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertTrue( entry.containsAttribute( " countryName " ) );

        EntryAttribute attrC = entry.get( "countryName" );
        assertEquals( 2, attrC.size() );
        assertTrue( attrC.contains( "UK", "DE" ) );
View Full Code Here


        assertTrue( removed.get( 0 ).contains( "US" ) );
       
        assertEquals( 5, entry.size() );
       
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertTrue( entry.containsAttribute( " countryName " ) );

        EntryAttribute attrC = entry.get( "countryName" );
        assertEquals( 2, attrC.size() );
        assertTrue( attrC.contains( "UK", "DE" ) );
View Full Code Here

       
        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( "CN", "SN" );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( "badId" );
        assertNull( removed );
       
View Full Code Here

        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( "CN", "SN" );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( "badId" );
        assertNull( removed );
       
        removed = entry.removeAttributes( "l" );
View Full Code Here

        entry1.add( "cn", "test3" );
        assertEquals( 2, entry2.get( "cn" ).size() );
        assertFalse( entry2.contains( "cn", "test3" ) );
       
        entry1.add( "sn", (String)null );
        assertFalse( entry2.containsAttribute( "sn" ) );
    }
    
   
    //-------------------------------------------------------------------------
    // Test the Contains methods
View Full Code Here

    public void testContainsStringByteArrayArray() throws Exception
    {
        Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        assertFalse( entry.contains( (String)null, BYTES3 ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, (byte[])null, BYTES2 );

        entry.add( attrPWD );
       
View Full Code Here

    public void testContainsStringStringArray() throws Exception
    {
        Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        assertFalse( entry.contains( (String)null, "test" ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrCN = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );

        entry.add( attrCN );
       
View Full Code Here

    public void testContainsStringValueArray() throws Exception
    {
        Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        assertFalse( entry.contains( (String)null, "test" ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrCN = new DefaultServerAttribute( atCN, "test1", "test2", (String)null );
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, BYTES2, (byte[])null );

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

    @Test
    public void testContainsAttributeString() throws Exception
    {
        Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrOC = new DefaultServerAttribute( atOC, "top", "person" );
        EntryAttribute attrCN = new DefaultServerAttribute( atCN, "test1", "test2" );
        EntryAttribute attrSN = new DefaultServerAttribute( atSN, "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, BYTES2 );
View Full Code Here

        EntryAttribute attrSN = new DefaultServerAttribute( atSN, "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );
       
        assertTrue( entry.containsAttribute( "OBJECTCLASS", " cn ", "Sn", "  userPASSWORD  " ) );
       
        entry.clear();

        assertFalse( entry.containsAttribute( "OBJECTCLASS" ) );
        assertFalse( entry.containsAttribute( " cn " ) );
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.