Package javax.naming.ldap

Examples of javax.naming.ldap.Rdn.toAttributes()


     * </p>
     */
    public void testToAttributes001() throws Exception {
        BasicAttributes t = new BasicAttributes("t", "\\4C\\4C");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here


     * The expected result is the map of the Rdn not null but empty.
     * </p>
     */
    public void testToAttributes002() throws Exception {
        Rdn rdn = new Rdn("");
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        assertEquals(0, ba.size());
    }

    /**
 
View Full Code Here

     * </p>
     */
    public void testToAttributes003() throws Exception {
        BasicAttributes t = new BasicAttributes("t", "hola");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes005() throws Exception {
        BasicAttributes t = new BasicAttributes("t", "test+a=test2+b=test3");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes006() throws Exception {
        BasicAttributes t = new BasicAttributes("t", "test+a=test2");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes007() throws Exception {
        BasicAttributes t = new BasicAttributes("a", "test+a=test2");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes008() throws Exception {
        BasicAttributes t = new BasicAttributes("a", ">asd+t=t+t=t=s<asd");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();

        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes009() throws Exception {
        BasicAttributes t = new BasicAttributes("a", "+t=t=");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();
        assertNotNull(ba);
        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

     * </p>
     */
    public void testToAttributes010() throws Exception {
        BasicAttributes t = new BasicAttributes("a", "t=t");
        Rdn rdn = new Rdn(t);
        BasicAttributes ba = (BasicAttributes) rdn.toAttributes();
        assertNotNull(ba);
        NamingEnumeration ne = ba.getAll();
        assertAttributesEqual(ne, t);
    }

View Full Code Here

    private Attributes getAttributesFromDN(Name name)
            throws InvalidNameException {
        if (name instanceof LdapName) {
            Rdn rdn = ((LdapName) name).getRdn(name.size() - 1);
            return rdn.toAttributes();
        }

        if (name instanceof CompositeName) {
            if (name.size() == 0) {
                return new BasicAttributes(true);
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.