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

Examples of org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute


        attr1.clear();
        attr1.put( "a", (String)null, "b" );
        assertTrue( attr1.remove( (String )null, "a" ) );
        assertEquals( 1, attr1.size() );
       
        EntryAttribute attr2 = new DefaultClientAttribute( "test" );
       
        attr2.put( BYTES1, BYTES2, BYTES3 );
       
        assertFalse( attr2.remove( (String)null ) );
        assertTrue( attr2.remove( "ab", "c" ) );
        assertFalse( attr2.remove( "d" ) );
    }
View Full Code Here


     * Test the copy constructor of a ClientAttribute
     */
    @Test
    public void testCopyConstructorClientAttribute() throws InvalidAttributeValueException
    {
        EntryAttribute attribute = new DefaultClientAttribute( "commonName" );
        attribute.put( "test" );
       
        ServerAttribute copy = new DefaultServerAttribute( atCN, attribute );

        assertEquals( atCN, copy.getAttributeType() );
        assertEquals( "test", copy.getString() );
        assertTrue( copy.isHR() );
       
        attribute.add( "test2" );
        assertFalse( copy.contains( "test2" ) );
    }
View Full Code Here

        assertEquals( "uid=admin,ou=system", srEditorBot.getContent( 1, 1 ) );
        assertEquals( "", srEditorBot.getContent( 1, 4 ) );

        // add description
        List<Modification> modifications = new ArrayList<Modification>();
        modifications.add( new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, new DefaultClientAttribute(
            "description", "The 1st description." ) ) );
        ldapServer.getDirectoryService().getAdminSession().modify( new LdapDN( "uid=admin,ou=system" ), modifications );

        // refresh the search, using the toolbar icon
        srEditorBot.refresh();
View Full Code Here

        server.start();
    }

    public void replaceAttribute(String dn, String attName, String value) throws Exception {
        LdapDN ldapDN = new LdapDN(dn);
        EntryAttribute attribute = new DefaultClientAttribute(attName, value);
        Modification m = new ClientModification(ModificationOperation.REPLACE_ATTRIBUTE, attribute);
        List<Modification> l = Lists.newArrayList(m);
        service.getAdminSession().modify(ldapDN, l);
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute

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.