Package org.apache.directory.ldapstudio.dsmlv2

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


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

            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRR_1_SRD.xml" ).getFile() );

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

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

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

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


    /**
     * Test parsing of a response with an empty Referral
     */
    public void testResponseWith1EmptyReferral()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( AuthResponseTest.class.getResource( "response_with_1_empty_referral.xml" ).getFile() );

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

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

        LdapResult ldapResult = bindResponse.getLdapResult();

        List referrals = ldapResult.getReferrals();

View Full Code Here

    /**
     * Test parsing of a Response with 0 Response
     */
    public void testResponseWith0Reponse()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( BatchResponseTest.class.getResource( "response_with_0_response.xml" ).getFile() );

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

        BatchResponse batchResponse = parser.getBatchResponse();

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

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

            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_1_SRE_1_SRR_1_SRD.xml" )
                .getFile() );

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

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

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

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

View Full Code Here

    /**
     * Test parsing of a Response with the 1 AddResponse
     */
    public void testResponseWith1AddResponse()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( BatchResponseTest.class.getResource( "response_with_1_AddResponse.xml" ).getFile() );

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

        BatchResponse batchResponse = parser.getBatchResponse();

        assertEquals( 1, batchResponse.getResponses().size() );

        LdapResponse response = batchResponse.getCurrentResponse();

View Full Code Here

    /**
     * Test parsing of a response with 2 Referral elements
     */
    public void testResponseWith2Referrals()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( AuthResponseTest.class.getResource( "response_with_2_referrals.xml" ).getFile() );

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

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

        LdapResult ldapResult = bindResponse.getLdapResult();

        List referrals = ldapResult.getReferrals();

View Full Code Here

    /**
     * Test parsing of a Response with the 1 AuthResponse
     */
    public void testResponseWith1AuthResponse()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( BatchResponseTest.class.getResource( "response_with_1_AuthResponse.xml" ).getFile() );

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

        BatchResponse batchResponse = parser.getBatchResponse();

        assertEquals( 1, batchResponse.getResponses().size() );

        LdapResponse response = batchResponse.getCurrentResponse();

View Full Code Here

    /**
     * Test parsing of a response with a Referral and an Error Message
     */
    public void testResponseWith1ReferralAndAnErrorMessage()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser.setInputFile( AuthResponseTest.class.getResource( "response_with_1_referral_and_error_message.xml" )
                .getFile() );

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

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

        LdapResult ldapResult = bindResponse.getLdapResult();

        List referrals = ldapResult.getReferrals();

View Full Code Here

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

            parser.setInputFile( SearchResponseTest.class.getResource( "response_with_2_SRE_1_SRD.xml" ).getFile() );

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

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

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

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

    /**
     * Test parsing of a Response with the 1 CompareResponse
     */
    public void testResponseWith1CompareResponse()
    {
        Dsmlv2ResponseParser parser = null;
        try
        {
            parser = new Dsmlv2ResponseParser();

            parser
                .setInputFile( BatchResponseTest.class.getResource( "response_with_1_CompareResponse.xml" ).getFile() );

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

        BatchResponse batchResponse = parser.getBatchResponse();

        assertEquals( 1, batchResponse.getResponses().size() );

        LdapResponse response = batchResponse.getCurrentResponse();

View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.dsmlv2.Dsmlv2ResponseParser

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.