Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.reconnect()


        assertTrue(c instanceof SortControl);
        assertEquals(Control.NONCRITICAL, ((SortControl) c).isCritical());

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        context.reconnect(null);

        assertNull(context.getConnectControls());
    }

    public void testReconnect_share_connection() throws Exception {
View Full Code Here


        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });

        // doesn't create new connection
        context.reconnect(null);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        // another and context share the same connection now
View Full Code Here

        context.reconnect(null);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        // use original connection
        another.reconnect(null);
    }

    /*
     * This test would block on RI, that because of difference of inner
     * implementation between RI and Harmony, It's hard to emulate using
View Full Code Here

            ldapContext = _ldapContext.newInstance(null);
            ldapContext.addToEnvironment(Context.SECURITY_AUTHENTICATION,
                    LdapConstants.SECURITY_AUTHENTICATION_SIMPLE);
            ldapContext.addToEnvironment(Context.SECURITY_PRINCIPAL, _userDN);
            ldapContext.addToEnvironment(Context.SECURITY_CREDENTIALS, password);
            ldapContext.reconnect(null);
            result = true;
        } catch (NamingException exception) {
            // no-op
        } finally {
            if (null != ldapContext) {
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.