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

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


        // 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().getValue() );

        // Check that we can use a null AttributeType
        entry.put( "userPassword", ( AttributeType ) null, ( byte[] ) null );
        assertEquals( 1, entry.size() );
View Full Code Here


        // Check that we can use a null AttributeType
        entry.put( "userPassword", ( AttributeType ) null, ( byte[] ) null );
        assertEquals( 1, entry.size() );
        assertEquals( "userPassword", entry.get( atPassword ).getUpId() );
        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertNull( entry.get( atPassword ).get().getValue() );

        // 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().getValue() );

        // 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( "domainComponent", atDC, ( Value<?> ) null );
        assertEquals( 1, entry.size() );
        assertEquals( "domainComponent", entry.get( atDC ).getUpId() );
        assertTrue( entry.containsAttribute( "dc" ) );
        assertNull( entry.get( atDC ).get().getValue() );

        // Check that we can use a null AttributeType
        entry.put( "domainComponent", ( AttributeType ) null, ( Value<?> ) null );
View Full Code Here

        // Check that we can use a null AttributeType
        entry.put( "domainComponent", ( AttributeType ) null, ( Value<?> ) null );

        assertEquals( 1, entry.size() );
        assertEquals( "domainComponent", entry.get( atDC ).getUpId() );
        assertTrue( entry.containsAttribute( "dc" ) );
        assertNull( entry.get( atDC ).get().getValue() );

        // Test that we can use a null upId
        entry.put( null, atDC, ( Value<?> ) null );
        assertEquals( 1, entry.size() );
View Full Code Here

        // Test that we can use a null upId
        entry.put( null, atDC, ( Value<?> ) null );
        assertEquals( 1, entry.size() );
        assertEquals( "dc", entry.get( atDC ).getUpId() );
        assertTrue( entry.containsAttribute( "dc" ) );
        assertNull( entry.get( atDC ).get().getValue() );

        // 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( "domainComponent", ( Value<?> ) null );
        assertEquals( 1, entry.size() );
        assertEquals( "domainComponent", entry.get( atDC ).getUpId() );
        assertTrue( entry.containsAttribute( "dc" ) );
        assertNull( entry.get( atDC ).get().getValue() );

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

        Attribute attrPWD = new DefaultAttribute( 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

    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

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.