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

Examples of org.apache.directory.shared.ldap.model.name.Rdn


     */
    @Test
    public void test112ReverseRenameCompositeCompositeNotOverlappingDeleteOldRdnExistInEntry() throws LdapException
    {
        Dn dn = new Dn( "cn=small+cn=test,ou=system" );
        Rdn oldRdn = new Rdn( "cn=small+cn=test" );
        Rdn newRdn = new Rdn( "cn=joe+cn=big" );

        Entry entry = new DefaultEntry( dn );
        entry.put( "cn", "test", "big", "small" );
        entry.put( "objectClass", "person", "top" );
        entry.put( "sn", "this is a test" );
View Full Code Here


     */
    @Test
    public void test121ReverseRenameCompositeCompositeOverlappingKeepOldRdnDontExistInEntry() throws LdapException
    {
        Dn dn = new Dn( "cn=small+cn=test,ou=system" );
        Rdn oldRdn = new Rdn( "cn=small+cn=test" );
        Rdn newRdn = new Rdn( "cn=joe+cn=test" );

        Entry entry = new DefaultEntry( dn );
        entry.put( "cn", "test", "big", "small" );
        entry.put( "objectClass", "person", "top" );
        entry.put( "sn", "this is a test" );
View Full Code Here

     */
    @Test
    public void test122ReverseRenameCompositeCompositeOverlappingKeepOldRdnExistInEntry() throws LdapException
    {
        Dn dn = new Dn( "cn=small+cn=test,ou=system" );
        Rdn oldRdn = new Rdn( "cn=small+cn=test" );
        Rdn newRdn = new Rdn( "cn=big+cn=test" );

        Entry entry = new DefaultEntry( dn );
        entry.put( "cn", "test", "big", "small" );
        entry.put( "objectClass", "person", "top" );
        entry.put( "sn", "this is a test" );
View Full Code Here

     */
    @Test
    public void test131ReverseRenameCompositeCompositeOverlappingDeleteOldRdnDontExistInEntry() throws LdapException
    {
        Dn dn = new Dn( "cn=small+cn=test,ou=system" );
        Rdn oldRdn = new Rdn( "cn=small+cn=test" );
        Rdn newRdn = new Rdn( "cn=joe+cn=test" );

        Entry entry = new DefaultEntry( dn );
        entry.put( "cn", "test", "big", "small" );
        entry.put( "objectClass", "person", "top" );
        entry.put( "sn", "this is a test" );
View Full Code Here

     */
    @Test
    public void test132ReverseRenameCompositeCompositeOverlappingDeleteOldRdnExistInEntry() throws LdapException
    {
        Dn dn = new Dn( "cn=small+cn=test,ou=system" );
        Rdn oldRdn = new Rdn( "cn=small+cn=test" );
        Rdn newRdn = new Rdn( "cn=big+cn=test" );

        Entry entry = new DefaultEntry( dn );
        entry.put( "cn", "test", "big", "small" );
        entry.put( "objectClass", "person", "top" );
        entry.put( "sn", "this is a test" );
View Full Code Here

            throw new IllegalArgumentException( msg );
        }

        try
        {
            return rename( new Dn( entryDn ), new Rdn( newRdn ), deleteOldRdn );
        }
        catch ( LdapInvalidDnException e )
        {
            LOG.error( e.getMessage(), e );
            throw new LdapException( e.getMessage(), e );
View Full Code Here

        request.setDeleteOldRdn( true );

        try
        {
            request.setName( new Dn( "dc=admins,dc=apache,dc=org" ) );
            request.setNewRdn( new Rdn( "dc=administrators" ) );
            request.setNewSuperior( new Dn( "dc=groups,dc=apache,dc=org" ) );
        }
        catch ( LdapException ine )
        {
            // do nothing
View Full Code Here

     */
    @Test
    public void testNotEqualDiffNewRdn() throws LdapException
    {
        ModifyDnRequestImpl req0 = getRequest();
        req0.setNewRdn( new Rdn( "cn=admin0" ) );

        ModifyDnRequestImpl req1 = getRequest();
        req1.setNewRdn( new Rdn( "cn=admin1" ) );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

            public Rdn getNewRdn()
            {
                try
                {
                    return new Rdn( "dc=administrators" );
                }
                catch ( LdapException ine )
                {
                    // do nothing
                    return null;
View Full Code Here

        entry.add( "objectClass", "person", "uidObject" );
        entry.add( "cn", "john doe", "jack doe" );
        entry.add( "sn", "doe" );
        entry.add( "uid", "jdoe" );

        List<LdifEntry> reverseds = LdifRevertor.reverseMoveAndRename(entry, newSuperior, new Rdn("cn=jack doe"), false);

        assertNotNull( reverseds );
        assertEquals( 1, reverseds.size() );
       
        LdifEntry reversed = reverseds.get( 0 );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.name.Rdn

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.