Package org.apache.directory.studio.dsmlv2.reponse

Examples of org.apache.directory.studio.dsmlv2.reponse.ModifyResponseDsml


     * Test parsing of a request with derefAliases attribute to derefinSearching value
     * @throws NamingException
     */
    public void testRequestWithDerefAliasesDerefinSearching()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_derefAliases_derefInSearching.xml" )
                .getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( LdapConstants.DEREF_IN_SEARCHING, searchRequest.getDerefAliases() );
    }
View Full Code Here


     * Test parsing of a request with derefAliases attribute to neverDerefAliases value
     * @throws NamingException
     */
    public void testRequestWithDerefAliasesNeverDerefAliases()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class
                .getResource( "request_with_derefAliases_neverDerefAliases.xml" ).getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( LdapConstants.NEVER_DEREF_ALIASES, searchRequest.getDerefAliases() );
    }
View Full Code Here

     * Test parsing of a request with the sizeLimit (optional) attribute
     * @throws NamingException
     */
    public void testRequestWithSizeLimitAttribute()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_sizeLimit_attribute.xml" )
                .getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( 1000, searchRequest.getSizeLimit() );
    }
View Full Code Here

     * Test parsing of a request with the timeLimit (optional) attribute
     * @throws NamingException
     */
    public void testRequestWithTimeLimitAttribute()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_timeLimit_attribute.xml" )
                .getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( 60, searchRequest.getTimeLimit() );
    }
View Full Code Here

    /**
     * Test parsing of a request with typesOnly to true
     */
    public void testRequestWithTypesOnlyTrue()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_true.xml" ).getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertTrue( searchRequest.isTypesOnly() );
    }
View Full Code Here

    /**
     * Test parsing of a request with typesOnly to 1
     */
    public void testRequestWithTypesOnly1()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_1.xml" ).getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertTrue( searchRequest.isTypesOnly() );
    }
View Full Code Here

    /**
     * Test parsing of a request with typesOnly to false
     */
    public void testRequestWithTypesOnlyFalse()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_false.xml" ).getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertFalse( searchRequest.isTypesOnly() );
    }
View Full Code Here

    /**
     * Test parsing of a request with typesOnly to 0
     */
    public void testRequestWithTypesOnlyRdn0()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_typesOnly_0.xml" ).getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        assertFalse( searchRequest.isTypesOnly() );
    }
View Full Code Here

    /**
     * Test parsing of a request with Attibutes Element but not any Attribute element
     */
    public void testRequestWithAttributesButNoAttribute()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_attributes_but_no_attribute.xml" )
                .getFile() );

            parser.parse();
        }
        catch ( Exception e )
        {
            fail( e.getMessage() );
        }
View Full Code Here

     * Test parsing of a request with an Attributes element with 1 Attribute element
     * @throws NamingException
     */
    public void testRequestWithAttributes1Attribute() throws NamingException
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = new Dsmlv2Parser();

            parser.setInputFile( SearchRequestTest.class.getResource( "request_with_attributes_1_attribute.xml" )
                .getFile() );

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

        SearchRequest searchRequest = ( SearchRequest ) parser.getBatchRequest().getCurrentRequest();

        Attributes attributes = searchRequest.getAttributes();

        assertEquals( 1, attributes.size() );

View Full Code Here

TOP

Related Classes of org.apache.directory.studio.dsmlv2.reponse.ModifyResponseDsml

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.