Package javax.naming.ldap

Examples of javax.naming.ldap.InitialLdapContext.lookup()


        InitialLdapContext initial = new InitialLdapContext( env, null );

        try
        {
            ctx = ( InitialLdapContext ) initial.lookup( "uid=admin" );
            fail( "should not get here due to exception cuz anonymous user is "
                    + "not allowed read access to the admin account entry" );
        }
        catch( LdapConfigurationException e )
        {
View Full Code Here


        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });

        LdapContext context = (LdapContext) initialContext.lookup("");
        // request controls are not inherited
        reqCtls = context.getRequestControls();
        assertEquals(1, reqCtls.length);
        assertEquals("2.16.840.1.113730.3.4.2", reqCtls[0].getID());
        assertEquals(Control.NONCRITICAL, reqCtls[0].isCritical());
View Full Code Here

                new Control[] { new SortControl("", Control.NONCRITICAL) });

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
        Control c = controls[0];
View Full Code Here

        InitialLdapContext initial = new InitialLdapContext( env, null );

        try
        {
            ctx = ( InitialLdapContext ) initial.lookup( "uid=admin" );
            fail( "should not get here due to exception cuz anonymous user is "
                    + "not allowed read access to the admin account entry" );
        }
        catch( LdapConfigurationException e )
        {
View Full Code Here

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });

        LdapContext context = (LdapContext) initialContext.lookup("");
        // request controls are not inherited
        reqCtls = context.getRequestControls();
        assertEquals(1, reqCtls.length);
        assertEquals("2.16.840.1.113730.3.4.2", reqCtls[0].getID());
        assertEquals(Control.NONCRITICAL, reqCtls[0].isCritical());
View Full Code Here

                new Control[] { new SortControl("", Control.NONCRITICAL) });

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        LdapContext context = (LdapContext) initialDirContext.lookup("");

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
        Control c = controls[0];
View Full Code Here

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        // another and context share the same connection now
        LdapContext another = (LdapContext) context.lookup("");

        MockLdapServer one = new MockLdapServer(server);
        one.start();

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

         */
        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        try {
            context.lookup("/usr/bin/cn=test");
            fail("Should throw CannotProceedException");
        } catch (CannotProceedException e) {
            assertEquals("/", e.getAltName().toString());
            assertEquals("usr/bin/cn=test", e.getRemainingName().toString());
            assertNull(e.getRemainingNewName());
View Full Code Here

        LdapContext context = new InitialLdapContext(env, null);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        EventDirContext eventContext = (EventDirContext) context.lookup("");

        assertTrue(eventContext.targetMustExist());

        MockUnsolicitedNotificationListener listener = new MockUnsolicitedNotificationListener();
View Full Code Here

        InitialLdapContext initial = new InitialLdapContext( env, null );

        try
        {
            ctx = ( InitialLdapContext ) initial.lookup( "uid=admin" );
            fail( "should not get here due to exception cuz anonymous user is "
                    + "not allowed read access to the admin account entry" );
        }
        catch( LdapConfigurationException e )
        {
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.