Examples of CompareResponse


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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = compareResponse.getLdapResult();

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

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

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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = compareResponse.getLdapResult();

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

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

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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = compareResponse.getLdapResult();

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

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

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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = compareResponse.getLdapResult();

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

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

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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = compareResponse.getLdapResult();

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

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

                break;

            case COMPARE_RESPONSE:
                // Transform the response
                CompareResponse compareResponse = ( CompareResponse ) response;

                CompareFuture compareFuture = ( CompareFuture ) responseFuture;

                // remove the listener from the listener map
                if ( LOG.isDebugEnabled() )
                {
                    if ( compareResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
                    {
                        // Everything is fine, return the response
                        LOG.debug( "Compare successful : {}", compareResponse );
                    }
                    else
View Full Code Here

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

        // Get the result from the future
        try
        {
            // Read the response, waiting for it if not available immediately
            // Get the response, blocking
            CompareResponse compareResponse = compareFuture.get( timeout, TimeUnit.MILLISECONDS );

            if ( compareResponse == null )
            {
                // We didn't received anything : this is an error
                LOG.error( "Compare failed : timeout occured" );
                throw new LdapException( TIME_OUT_ERROR );
            }

            if ( compareResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
            {
                // Everything is fine, return the response
                LOG.debug( "Compare successful : {}", compareResponse );
            }
            else
View Full Code Here

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

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

        // Check the decoded CompareResponse PDU
        CompareResponse compareResponse = container.getMessage();

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

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

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

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

        // Check the decoded CompareResponse PDU
        CompareResponse compareResponse = container.getMessage();

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

        // Check the Control
        Map<String, Control> controls = compareResponse.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

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

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();

        assertEquals( 456, compareResponse.getMessageId() );
    }
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.