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

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


                writeResponse( respWriter, authResponseDsml );

                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(), compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here


            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().getDiagnosticMessage() );

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

            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().getDiagnosticMessage() );

        // 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

                writeResponse( respWriter, authResponseDsml );

                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(), compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here

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

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

        assertEquals( 456, compareResponse.getMessageId() );
    }
View Full Code Here

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
        Map<String, Control> controls = compareResponse.getControls();

        assertEquals( 1, compareResponse.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );

        assertNotNull( control );
        assertTrue( control.isCritical() );
View Full Code Here

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
        Map<String, Control> controls = compareResponse.getControls();

        assertEquals( 1, compareResponse.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );

        assertNotNull( control );
        assertTrue( control.isCritical() );
View Full Code Here

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
        Map<String, Control> controls = compareResponse.getControls();

        assertEquals( 2, compareResponse.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.789" );

        assertNotNull( control );
        assertFalse( control.isCritical() );
View Full Code Here

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

        CompareResponse compareResponse = ( CompareResponse ) parser.getBatchResponse().getCurrentResponse();
        Map<String, Control> controls = compareResponse.getControls();

        assertEquals( 3, compareResponse.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.456" );

        assertNotNull( control );
        assertTrue( control.isCritical() );
View Full Code Here

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

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

        LdapResult ldapResult = compareResponse.getLdapResult();

        assertEquals( ResultCodeEnum.PROTOCOL_ERROR, ldapResult.getResultCode() );
    }
View Full Code Here

TOP

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

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.