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

Examples of org.apache.directory.api.ldap.model.entry.Attribute


        assertTrue( entry.contains( atPwd, BYTES1, BYTES2 ) );

        entry.add( atPwd, ( byte[] ) null, BYTES1 );
        assertEquals( 1, entry.size() );

        Attribute attribute = entry.get( atPwd );
        assertEquals( 3, attribute.size() );
        assertTrue( attribute.contains( BYTES1 ) );
        assertTrue( attribute.contains( BYTES2 ) );
        assertTrue( attribute.contains( ( byte[] ) null ) );
    }
View Full Code Here


        assertFalse( entry.contains( atC, "fr", "us" ) );

        entry.add( atC, "de", "fr" );
        assertEquals( 1, entry.size() );

        Attribute attribute = entry.get( atC );
        assertEquals( 0, attribute.size() );
        assertFalse( attribute.contains( "de" ) );
        assertFalse( attribute.contains( "fr" ) );
        assertFalse( attribute.contains( "us" ) );

        entry.clear();

        assertEquals( 0, entry.size() );
    }
View Full Code Here

        assertEquals( "2.5.4.35", entry.get( atPwd ).getId() );

        entry.add( "  UserPassword  ", atPwd, ( byte[] ) null, BYTES1 );
        assertEquals( 1, entry.size() );

        Attribute attribute = entry.get( atPwd );
        assertEquals( 3, attribute.size() );
        assertTrue( attribute.contains( BYTES1 ) );
        assertTrue( attribute.contains( BYTES2 ) );
        assertTrue( attribute.contains( ( byte[] ) null ) );
        assertEquals( "  UserPassword  ", attribute.getUpId() );
        assertEquals( "2.5.4.35", attribute.getId() );

        try
        {
            entry.add( "  ObjectClass  ", atOC, BYTES1 );
            fail();
View Full Code Here

        assertEquals( "1.2.840.113549.1.9.1", entry.get( atEMail ).getId() );

        entry.add( "  EMAIL  ", atEMail, ( String ) null, "test1" );
        assertEquals( 1, entry.size() );

        Attribute attribute = entry.get( atEMail );
        assertEquals( 3, attribute.size() );
        assertTrue( attribute.contains( "test1" ) );
        assertTrue( attribute.contains( ( String ) null ) );
        assertTrue( attribute.contains( "test2" ) );
        assertEquals( "  EMAIL  ", attribute.getUpId() );
        assertEquals( "1.2.840.113549.1.9.1", attribute.getId() );

        entry.clear();

        // Binary values are not allowed
        entry.add( "  EMail  ", atEMail, BYTES1 );
View Full Code Here

        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( AttributeType ) null, BYTES1 ) );
        assertFalse( entry.contains( atPwd, BYTES1 ) );

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

        assertFalse( entry.contains( attrPWD ) );

        entry.add( attrPWD );
View Full Code Here

        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( AttributeType ) null, "test" ) );
        assertFalse( entry.contains( atCN, "test" ) );

        Attribute attrCN = new DefaultAttribute( atCN, "test1", "test2" );

        assertFalse( entry.contains( attrCN ) );

        entry.add( attrCN );
View Full Code Here

        Value<byte[]> binNullValue = new BinaryValue( atPwd, null );

        assertFalse( entry.contains( ( String ) null, strValue1 ) );
        assertFalse( entry.contains( atDC, binValue1 ) );

        Attribute attrCN = new DefaultAttribute( atDC, strValue1, strValue2 );
        Attribute attrPWD = new DefaultAttribute( atPwd, binValue1, binValue2, binNullValue );

        entry.add( attrCN, attrPWD );

        assertTrue( entry.contains( atDC, strValue1, strValue2 ) );
        assertTrue( entry.contains( atPwd, binValue1, binValue2, binNullValue ) );
View Full Code Here

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

        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 );

        assertFalse( entry.contains( attrOC, attrCN ) );

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

        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 );

        assertTrue( entry.contains( "  userPASSWORD  ", BYTES1, BYTES2 ) );
        assertTrue( entry.contains( "  userPASSWORD  ", ( byte[] ) null ) );
View Full Code Here

        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 );

        assertTrue( entry.contains( "  EMAIL  ", "test1", "test2" ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.entry.Attribute

Copyright © 2018 www.massapicom. 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.