Examples of Dsmlv2ResponseParser


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

        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();

        engine.processDSML( dsmlIn, byteOut );

        Dsmlv2ResponseParser respParser = new Dsmlv2ResponseParser( LdapApiServiceFactory.getSingleton() );
        respParser.setInput( byteOut.toString() );

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );

        assertEquals( 101, batchResp.getRequestID() );
       
View Full Code Here

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

        engine.setGenerateSoapResp( false );
       
        String resp = byteOut.toString();

        Dsmlv2ResponseParser respParser = new Dsmlv2ResponseParser( LdapApiServiceFactory.getSingleton() );
        respParser.setInput( resp );

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );
       
        assertEquals( 101, batchResp.getRequestID() );
       
View Full Code Here

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

    /**
     * Test parsing of a response with a (optional) Control element
     */
    public void testResponseWith1Control()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( SearchResultDoneTest.class.getResource( "response_with_1_control.xml" ).getFile() );

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

        SearchResultDone searchResultDone = ( ( SearchResponse ) parser.getBatchResponse().getCurrentResponse() )
            .getSearchResultDone();

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

        Control control = searchResultDone.getCurrentControl();
View Full Code Here

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( SearchResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
                .openStream(), "UTF-8" );

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

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
            .getDecorated();

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

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

     * Test parsing of a Response with a Search Result Done
     */
    @Test
    public void testResponseWithSRD()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRD.xml" ).openStream(), "UTF-8" );

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

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
            .getDecorated();

        assertNotNull( searchResponse.getSearchResultDone() );
    }
View Full Code Here

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

     * Test parsing of a Response with 1 Search Result Entry and a Search Result Done
     */
    @Test
    public void testResponseWith1SRE1SRD()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRD.xml" ).openStream(),
                "UTF-8" );

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

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
            .getDecorated();

        assertEquals( 1, searchResponse.getSearchResultEntryList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
View Full Code Here

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( ModifyDNResponseTest.class.getResource( "response_with_requestID_attribute.xml" )
                .openStream(), "UTF-8" );

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

        ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();

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

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

     * Test parsing of a Response with 1 Search Result Entry and a Search Result Done
     */
    @Test
    public void testResponseWith0SRE1SRD()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( SearchResponseTest.class.getResource( "response_with_0_SRE_1_SRD.xml" ).openStream(),
                "UTF-8" );

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

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse()
            .getDecorated();

        assertEquals( 0, searchResponse.getSearchResultEntryList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
View Full Code Here

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

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

            parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(),
                "UTF-8" );

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

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

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

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

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

     * Test parsing of a Response with 1 Search Result Reference and a Search Result Done
     */
    @Test
    public void testResponseWith1SRR1SRD()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser( getCodec() );

            parser.setInput( SearchResponseTest.class.getResource( "response_with_1_SRR_1_SRD.xml" ).openStream(),
                "UTF-8" );

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

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();

        assertEquals( 1, searchResponse.getSearchResultReferenceList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
    }
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.