Package org.apache.directory.shared.ldap.model.message

Examples of org.apache.directory.shared.ldap.model.message.BindResponse


            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded BindResponse
        BindResponse bindResponse = container.getMessage();

        assertEquals( 1, bindResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
        assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );

        // Check the Control
        Map<String, Control> controls = bindResponse.getControls();

        assertEquals( 1, controls.size() );

        Control control = controls.get( "1.2.840.113556.1.4.319" );
        assertEquals( "1.2.840.113556.1.4.319", control.getOid() );
View Full Code Here


            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded BindResponse
        BindResponse bindResponse = container.getMessage();

        assertEquals( 1, bindResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
        assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
        assertEquals( "", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );

        // Check the encoding
        try
        {
            ByteBuffer bb = encoder.encodeMessage( bindResponse );
View Full Code Here

            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded BindResponse
        BindResponse bindResponse = container.getMessage();

        assertEquals( 1, bindResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
        assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
        assertEquals( "", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );

        // Check the Control
        Map<String, Control> controls = bindResponse.getControls();

        assertEquals( 1, controls.size() );

        @SuppressWarnings("unchecked")
        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls.get( "2.16.840.1.113730.3.4.2" );
View Full Code Here

            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded BindResponse
        BindResponse bindResponse = container.getMessage();

        assertEquals( 1, bindResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
        assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
        assertEquals( "AB", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );

        // Check the encoding
        try
        {
            ByteBuffer bb = encoder.encodeMessage( bindResponse );
View Full Code Here

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = bindResponse.getLdapResult();

        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();

        assertEquals( 0, referrals.size() );
    }
View Full Code Here

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = bindResponse.getLdapResult();

        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();

        assertEquals( 2, referrals.size() );
View Full Code Here

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = bindResponse.getLdapResult();

        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();

        assertEquals( 1, referrals.size() );
View Full Code Here

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        BindResponse bindResponse = ( BindResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = bindResponse.getLdapResult();

        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName() );
    }
View Full Code Here

        else
        {
            serverSaslCreds = tlv.getValue().getData();
        }

        BindResponse response = container.getMessage();
        response.setServerSaslCreds( serverSaslCreds );

        // We can have an END transition
        container.setGrammarEndAllowed( true );

        if ( IS_DEBUG )
View Full Code Here

            bindRequest.setName( new Dn( "uid=admin,ou=system" ) );
            bindRequest.setCredentials( "secret" );

            BindFuture bindFuture = connection.bindAsync( bindRequest );

            BindResponse bindResponse = bindFuture.get( 1000, TimeUnit.MILLISECONDS );

            assertNotNull( bindResponse );
            assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
            assertTrue( connection.isAuthenticated() );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.BindResponse

Copyright © 2018 www.massapicom. 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.