Examples of Dsmlv2ResponseParser


Examples of org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser

     * Test parsing of a Response with the (optional) requestID attribute
     */
    @Test
    public void testResponseWithRequestId()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( ExtendedResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
                .openStream(), "UTF-8" );

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

        ExtendedResponse extendedResponse = ( ExtendedResponse ) parser.getBatchResponse().getCurrentResponse();

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

Examples of org.apache.directory.shared.dsmlv2.Dsmlv2ResponseParser

     * Test parsing of a response with 2 (optional) Control elements
     */
    @Test
    public void testResponseWith2Controls()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( ModifyResponseTest.class.getResource( "response_with_2_controls.xml" ).openStream(),
                "UTF-8" );

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

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

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

        Control control = controls.get( "1.2.840.113556.1.4.789" );
View Full Code Here

Examples of org.apache.directory.studio.dsmlv2.Dsmlv2ResponseParser

                fout.close();
            }
           
            // Processing Reponse (Reading and displaying possible errors)
            int errorCount = 0;
            Dsmlv2ResponseParser responseParser = new Dsmlv2ResponseParser();
            responseParser.setInput( response );
            LdapResponse ldapResponse = responseParser.getNextResponse();
            while ( ldapResponse != null )
            {
                if ( ( ldapResponse instanceof ErrorResponse )
                     || ( ldapResponse.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS ) )
                {
                    errorCount++;
                }
                ldapResponse = responseParser.getNextResponse();
            }
           
            if ( errorCount > 0 )
            {
                monitor.reportError( BrowserCoreMessages.bind(
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.