Package javax.naming.directory

Examples of javax.naming.directory.InitialDirContext.addToEnvironment()


        assertNull(env.get(Context.REFERRAL));

        InitialDirContext initialDirContext = new InitialDirContext(env);

        // Context.REFERRAL changed doesn't cause re-bind operation
        initialDirContext.addToEnvironment(Context.REFERRAL, "ignore");

        assertEquals("ignore", initialDirContext.getEnvironment().get(
                Context.REFERRAL));

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
View Full Code Here


        /*
         * Context.SECURITY_AUTHENTICATION will case re-bind when invoke context
         * methods at first time
         */
        Object preValue = initialDirContext.addToEnvironment(
                Context.SECURITY_AUTHENTICATION, "none");
        assertFalse("none".equals(preValue));

        server.setResponseSeq(new LdapMessage[] {
                new LdapMessage(LdapASN1Constant.OP_BIND_RESPONSE,
View Full Code Here

                new LdapMessage(LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                        new EncodableLdapResult(), null) });

        initialDirContext.lookup("");

        preValue = initialDirContext.addToEnvironment(
                Context.SECURITY_AUTHENTICATION, "simple");
        assertFalse("simple".equals(preValue));

        // initialDirContext is shared connection, will create new connection
        server = new MockLdapServer(server);
View Full Code Here

        assertNull(env.get(Context.REFERRAL));

        InitialDirContext initialDirContext = new InitialDirContext(env);

        // Context.REFERRAL changed doesn't cause re-bind operation
        initialDirContext.addToEnvironment(Context.REFERRAL, "ignore");

        assertEquals("ignore", initialDirContext.getEnvironment().get(
                Context.REFERRAL));

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
View Full Code Here

        /*
         * Context.SECURITY_AUTHENTICATION will case re-bind when invoke context
         * methods at first time
         */
        Object preValue = initialDirContext.addToEnvironment(
                Context.SECURITY_AUTHENTICATION, "none");
        assertFalse("none".equals(preValue));

        server.setResponseSeq(new LdapMessage[] {
                new LdapMessage(LdapASN1Constant.OP_BIND_RESPONSE,
View Full Code Here

                new LdapMessage(LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                        new EncodableLdapResult(), null) });

        initialDirContext.lookup("");

        preValue = initialDirContext.addToEnvironment(
                Context.SECURITY_AUTHENTICATION, "simple");
        assertFalse("simple".equals(preValue));

        // initialDirContext is shared connection, will create new connection
        server = new MockLdapServer(server);
View Full Code Here

        assertNull(env.get(Context.REFERRAL));

        InitialDirContext initialDirContext = new InitialDirContext(env);

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", "cn");
        assertEquals("cn", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
View Full Code Here

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", "cn");
        assertEquals("cn", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", "cn ou");
        assertEquals("cn ou", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
View Full Code Here

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", "cn ou");
        assertEquals("cn ou", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", " cn ");
        assertEquals(" cn ", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
View Full Code Here

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", " cn ");
        assertEquals(" cn ", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        initialDirContext.addToEnvironment(
                "java.naming.ldap.attributes.binary", " cn ou ");
        assertEquals(" cn ou ", initialDirContext.getEnvironment().get(
                "java.naming.ldap.attributes.binary"));

        try {
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.