Package javax.naming.ldap

Examples of javax.naming.ldap.LdapName.startsWith()


        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }


    /**
 
View Full Code Here


        try {
            Name parsed = new LdapName(dn);
            // System.err.println("dn string: " + dn);
            // System.err.println("dn name: " + parsed);

            if (startName != null && parsed.startsWith(startName)) {
                relStart = parsed.getSuffix(startName.size()).toString();
                relHome = parsed.getSuffix(homeCtx.currentParsedDN.size()).toString();
            } else {
                relative = false;
                relHome = relStart =
View Full Code Here

            return;

        Binding oldBd = null;
        try {
            LdapName dn = new LdapName(oldDN);
            if (dn.startsWith(context.currentParsedDN)) {
                String relDN = dn.getSuffix(context.currentParsedDN.size()).toString();
                oldBd = new Binding(relDN, null);
            }
        } catch (NamingException e) {}
View Full Code Here

    public void testStartsWithName() throws LdapException, InvalidNameException
    {
        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }
View Full Code Here

        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }


    /**
 
View Full Code Here

   
    LinkedList<Rdn> test=new LinkedList<Rdn>();
    try {
      test.add(new Rdn("t=test"));
      LdapName x=new LdapName("t=t");
      assertFalse(x.startsWith(test));
    } catch (InvalidNameException e) {
      fail("Failed with:"+e);
    }

  }
View Full Code Here

    public void testStartsWithName() throws LdapException, InvalidNameException
    {
        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }
View Full Code Here

        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }


    /**
 
View Full Code Here

    public void testStartsWithName() throws LdapException, InvalidNameException
    {
        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }
View Full Code Here

        LdapName jName = new LdapName( "cn=four,cn=three,cn=two,cn=one" );
        Dn aName = new Dn( "cn=four,cn=three,cn=two,cn=one" );

        assertEquals( jName.startsWith( new LdapName( "cn=seven,cn=six,cn=five" ) ),
            aName.isDescendantOf( new Dn( "cn=seven,cn=six,cn=five" ) ) );
        assertEquals( jName.startsWith( new LdapName( "cn=three,cn=two,cn=one" ) ),
            aName.isDescendantOf( new Dn( "cn=three,cn=two,cn=one" ) ) );
    }


    /**
 
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.