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

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute


    @Test
    public void testContainsEntryAttributeArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );

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


    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", 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( EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2", (String)null );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );
       
        assertTrue( entry.contains( "OBJECTCLASS", "top", "person" ) );
        assertTrue( entry.contains( " cn ", "test1", "test2" ) );
View Full Code Here

    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2", (String)null );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2, (byte[])null );

        entry.add( attrCN, attrPWD );
       
        Value<String> strValue1 = new StringValue( "test1" );
        Value<String> strValue2 = new StringValue( "test2" );
View Full Code Here

    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );
       
        assertTrue( entry.containsAttribute( "OBJECTCLASS" ) );
        assertTrue( entry.containsAttribute( " cn " ) );
View Full Code Here

        assertNotSame( entry1, entry2 );
       
        entry2.setDn( EXAMPLE_DN );
        assertEquals( entry1, entry2 );

        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );
       
        entry1.put( attrOC, attrCN, attrSN, attrPWD );
        entry2.put( attrOC, attrCN, attrSN );
        assertNotSame( entry1, entry2 );
       
        entry2.put( attrPWD );
        assertEquals( entry1, entry2 );
       
        EntryAttribute attrL1 = new DefaultEntryAttribute( "l", "Paris", "New-York" );
        EntryAttribute attrL2 = new DefaultEntryAttribute( "l", "Paris", "Tokyo" );
       
        entry1.put( attrL1 );
        entry2.put( attrL1 );
        assertEquals( entry1, entry2 );
       
View Full Code Here

    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        assertNull( entry.get( "objectClass" ) );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );

        entry.add( attrOC, attrCN, attrSN, attrPWD );
       
        assertNotNull( entry.get( "  CN  " ) );
        EntryAttribute attribute = entry.get( "cN" );
View Full Code Here

       
        entry2.setDn( EXAMPLE_DN );
        assertEquals( entry1.hashCode(), entry2.hashCode() );
       
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );

        entry1.add( attrOC, attrCN, attrSN, attrPWD );
        entry2.add( attrOC, attrCN, attrSN, attrPWD );

        assertEquals( entry1.hashCode(), entry2.hashCode() );
View Full Code Here

        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        assertFalse( entry.containsAttribute( "objectClass" ) );
        assertFalse( entry.hasObjectClass( "top" ) );
       
        entry.add( new DefaultEntryAttribute( "objectClass", "top", "person" ) );
       
        assertTrue( entry.hasObjectClass( "top" ) );
        assertTrue( entry.hasObjectClass( "person" ) );
        assertFalse( entry.hasObjectClass( "inetorgperson" ) );
        assertFalse( entry.hasObjectClass( (String)null ) );
View Full Code Here

    @Test
    public void testPutEntryAttributeArray() throws LdapException
    {
        Entry entry = new DefaultEntry( EXAMPLE_DN );
       
        EntryAttribute attrOC = new DefaultEntryAttribute( "objectClass", "top", "person" );
        EntryAttribute attrCN = new DefaultEntryAttribute( "cn", "test1", "test2" );
        EntryAttribute attrSN = new DefaultEntryAttribute( "sn", "Test1", "Test2" );
        EntryAttribute attrPWD = new DefaultEntryAttribute( "userPassword", BYTES1, BYTES2 );
       
        List<EntryAttribute> removed = entry.put( attrOC, attrCN, attrSN, attrPWD );
       
        assertEquals( 4, entry.size() );
        assertEquals( 0, removed.size() );
        assertTrue( entry.containsAttribute( "ObjectClass" ) );
        assertTrue( entry.containsAttribute( "CN" ) );
        assertTrue( entry.containsAttribute( "  sn  " ) );
        assertTrue( entry.containsAttribute( "userPassword" ) );
       
        EntryAttribute attrCN2 = new DefaultEntryAttribute( "cn", "test3", "test4" );
        removed = entry.put( attrCN2 );
        assertEquals( 4, entry.size() );
        assertEquals( 1, removed.size() );
        assertTrue( entry.containsAttribute( "CN" ) );
        assertTrue( entry.contains( "cn", "test3", "test4" ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

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.