Examples of DefaultAttribute


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

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

        Attribute oc = new DefaultAttribute( atObjectClass, "top", "person" );
        Attribute cn = new DefaultAttribute( atCN, "test1", "test2" );
        Attribute sn = new DefaultAttribute( atSN, "Test1", "Test2" );
        Attribute up = new DefaultAttribute( atPwd, BYTES1, BYTES2 );
        Attribute email = new DefaultAttribute( atEMail, "FR", "US" );

        entry.add( oc, cn, sn, email );

        assertEquals( 4, entry.size() );
        assertTrue( entry.containsAttribute( "ObjectClass" ) );
        assertTrue( entry.containsAttribute( "CN" ) );
        assertTrue( entry.containsAttribute( "  sn  " ) );
        assertTrue( entry.containsAttribute( " email  " ) );

        Attribute attr = entry.get( "objectclass" );
        assertEquals( 2, attr.size() );

        Attribute email2 = new DefaultAttribute( atEMail, "UK", "DE" );
        entry.add( email2, up );
        assertEquals( 5, entry.size() );

        assertTrue( entry.containsAttribute( "userPassword" ) );
        assertTrue( entry.containsAttribute( " email " ) );
View Full Code Here

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

        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

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

        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

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

        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

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

    @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

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

        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

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

        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

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

        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.contains( ( String ) null, "test" ) );
        assertFalse( entry.containsAttribute( "objectClass" ) );

        Attribute attrEMail = new DefaultAttribute( atEMail, "test1", "test2", ( String ) null );
        Attribute attrPWD = new DefaultAttribute( atPwd, BYTES1, BYTES2, ( byte[] ) null );

        entry.add( attrEMail, attrPWD );

        Value<String> strValue1 = new StringValue( atEMail, "test1" );
        Value<String> strValue2 = new StringValue( atEMail, "test2" );
View Full Code Here

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

    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.containsAttribute( atOC ) );

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

        entry.add( attrOC, attrCN, attrSN, attrPWD );

        assertTrue( entry.containsAttribute( atOC ) );
        assertTrue( entry.containsAttribute( atCN ) );
View Full Code Here

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

    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertFalse( entry.containsAttribute( "objectClass" ) );

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

        entry.add( attrOC, attrCN, attrSN, attrPWD );

        assertTrue( entry.containsAttribute( "OBJECTCLASS", " cn ", "Sn", "  userPASSWORD  " ) );
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.