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

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


       
        // Test that we can use a null upId
        entry.put( null, atCN, (Value<?>)null );
        assertEquals( 1, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );
       
        // Test that we can't use an upId which is not compatible
        // with the AT
        try
View Full Code Here


       
        // Test an null valued AT
        entry.put( "commonName", (Value<?>)null );
        assertEquals( 1, entry.size() );
        assertEquals( "commonName", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );

        // Test that we can add some new attributes with values
        Value<String> test1 = new StringValue( atCN, "test1" );
        Value<String> test2 = new StringValue( atCN, "test2" );
View Full Code Here

        EntryAttribute attrPWD = new DefaultServerAttribute( atPwd, BYTES1, (byte[])null, BYTES2 );

        entry.put( attrPWD );
        assertTrue( entry.remove( atPwd, (byte[])null ) );
        assertTrue( entry.remove( atPwd, BYTES1, BYTES2 ) );
        assertFalse( entry.containsAttribute( atPwd ) );
       
        entry.add( atPwd, BYTES1, (byte[])null, BYTES2 );
        assertTrue( entry.remove( atPwd, (byte[])null ) );
        assertEquals( 2, entry.get( atPwd ).size() );
        assertFalse( entry.contains( atPwd, (byte[])null ) );
View Full Code Here

        EntryAttribute attrCN = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );

        entry.put( attrCN );
        assertTrue( entry.remove( atCN, (String)null ) );
        assertTrue( entry.remove( atCN, "test1", "test2" ) );
        assertFalse( entry.containsAttribute( atCN ) );
       
        entry.add( atCN, "test1", (String)null, "test2" );
        assertTrue( entry.remove( atCN, (String)null ) );
        assertEquals( 2, entry.get( atCN ).size() );
        assertFalse( entry.contains( atCN, (String)null ) );
View Full Code Here

        EntryAttribute attrPWD = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );

        entry.put( attrPWD );
        assertTrue( entry.remove( atCN, strNullValue ) );
        assertTrue( entry.remove( atCN, strValue1, strValue2 ) );
        assertFalse( entry.containsAttribute( atCN ) );
       
        entry.add( atCN, strValue1, strNullValue, strValue2 );
        assertTrue( entry.remove( atCN, strNullValue ) );
        assertEquals( 2, entry.get( atCN ).size() );
        assertFalse( entry.contains( atCN, strNullValue ) );
View Full Code Here

        assertEquals( 2, entry.size() );
        assertTrue( removed.contains( attrSN ) );
        assertTrue( removed.contains( attrPWD ) );
        assertTrue( entry.contains( "objectClass", "top", "person" ) );
        assertTrue( entry.contains( "cn", "test1", "test2" ) );
        assertFalse( entry.containsAttribute( atSN ) );
        assertFalse( entry.containsAttribute( "userPassword" ) );

        removed = entry.remove( attrSN, attrPWD );
       
        assertEquals( 0, removed.size() );
View Full Code Here

        assertTrue( removed.contains( attrSN ) );
        assertTrue( removed.contains( attrPWD ) );
        assertTrue( entry.contains( "objectClass", "top", "person" ) );
        assertTrue( entry.contains( "cn", "test1", "test2" ) );
        assertFalse( entry.containsAttribute( atSN ) );
        assertFalse( entry.containsAttribute( "userPassword" ) );

        removed = entry.remove( attrSN, attrPWD );
       
        assertEquals( 0, removed.size() );
    }
View Full Code Here

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

        entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        entry.removeAttributes( atCN, atSN );
       
        assertFalse( entry.containsAttribute( "cn", "sn" ) );
        assertTrue( entry.containsAttribute( "objectclass", "userpassword" ) );
       
        List<EntryAttribute> removed = entry.removeAttributes( (AttributeType)null );
        assertNull( removed );

        removed = entry.removeAttributes( atC );
View Full Code Here

       
        List<EntryAttribute> removed = entry.put( oc, cn, sn, c );
       
        assertEquals( 4, entry.size() );
        assertEquals( 0, removed.size() );
        assertTrue( entry.containsAttribute( "ObjectClass" ) );
        assertTrue( entry.containsAttribute( "CN" ) );
        assertTrue( entry.containsAttribute( "  sn  " ) );
        assertTrue( entry.containsAttribute( " countryName  " ) );
   
        EntryAttribute attr = entry.get( "objectclass" );
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.