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

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


       
        // Check that we can use a null AttributeType
        entry.put( "commonName", (AttributeType)null, (String)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 use a null upId
        entry.put( null, atCN, (String)null );
        assertEquals( 1, entry.size() );
View Full Code Here


       
        // Test that we can use a null upId
        entry.put( null, atCN, (String)null );
        assertEquals( 1, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );

        try
        {
            entry.put( "sn", atCN, (String)null );
View Full Code Here

       
        // Test an empty AT
        entry.put( "userPassword", atPassword, (byte[])null );
        assertEquals( 1, entry.size() );
        assertEquals( "userPassword", entry.get( atPassword ).getUpId() );
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertNull( entry.get( atPassword ).get().get() );
       
        // Check that we can use a null AttributeType
        try
        {
View Full Code Here

            assertTrue( true );
        }
       
        assertEquals( 1, entry.size() );
        assertEquals( "userPassword", entry.get( atPassword ).getUpId() );
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertNull( entry.get( atPassword ).get().get() );
       
        // Test that we can use a null upId
        entry.put( null, atPassword, (byte[])null );
        assertEquals( 1, entry.size() );
View Full Code Here

       
        // Test that we can use a null upId
        entry.put( null, atPassword, (byte[])null );
        assertEquals( 1, entry.size() );
        assertEquals( "userPassword", entry.get( atPassword ).getUpId() );
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertNull( entry.get( atPassword ).get().get() );
       
        // Test that if we use an upId which is not compatible
        // with the AT, it is changed to the AT default name
        try
View Full Code Here

       
        // Test an empty AT
        entry.put( "commonName", atCN, (Value<?>)null );
        assertEquals( 1, entry.size() );
        assertEquals( "commonName", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );
       
        // Check that we can use a null AttributeType
        try
        {
View Full Code Here

            assertTrue( true );
        }

        assertEquals( 1, entry.size() );
        assertEquals( "commonName", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );
       
        // Test that we can use a null upId
        entry.put( null, atCN, (Value<?>)null );
        assertEquals( 1, entry.size() );
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

        assertFalse( entry.remove( "badId", BYTES1 ) );

        entry.put( attrPWD );
        assertTrue( entry.remove( "userPassword", (byte[])null ) );
        assertTrue( entry.remove( "UserPassword", BYTES1, BYTES2 ) );
        assertFalse( entry.containsAttribute( atPwd ) );
       
        entry.add( atPwd, BYTES1, (byte[])null, BYTES2 );
        assertTrue( entry.remove( "userPassword", (byte[])null ) );
        assertEquals( 2, entry.get( atPwd ).size() );
        assertFalse( entry.contains( atPwd, (byte[])null ) );
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.