Package org.apache.directory.shared.ldap.codec.compare

Examples of org.apache.directory.shared.ldap.codec.compare.CompareRequest


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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ( String ) compareRequest.getEntry().toString() );

        assertEquals( "sn", ( String ) compareRequest.getAttributeDesc() );

        assertNull( compareRequest.getAssertionValue() );
    }
View Full Code Here


     */
    public Element toDsml( Element root )
    {
        Element element = super.toDsml( root );
       
        CompareRequest request = ( CompareRequest ) instance;
       
        // DN
        if ( request.getEntry() != null )
        {
            element.addAttribute( "dn", request.getEntry().toString() );
        }
       
        // Assertion
        Element assertionElement = element.addElement( "assertion");
        if ( request.getAttributeDesc() != null )
        {
            assertionElement.addAttribute( "name", request.getAttributeDesc() );
        }
        if ( request.getAssertionValue() != null )
        {
            assertionElement.addElement( "value").setText( (String) request.getAssertionValue() );
        }
       
        return element;
    }
View Full Code Here

    /**
     * Creates a new instance of CompareRequestDsml.
     */
    public CompareRequestDsml()
    {
        super( new CompareRequest() );
    }
View Full Code Here

     */
    public Element toDsml( Element root )
    {
        Element element = super.toDsml( root );

        CompareRequest request = ( CompareRequest ) instance;

        // DN
        if ( request.getEntry() != null )
        {
            element.addAttribute( "dn", request.getEntry().getUpName() );
        }

        // Assertion
        Element assertionElement = element.addElement( "assertion" );
        if ( request.getAttributeDesc() != null )
        {
            assertionElement.addAttribute( "name", request.getAttributeDesc() );
        }
        if ( request.getAssertionValue() != null )
        {
            assertionElement.addElement( "value" ).setText( ( String ) request.getAssertionValue() );
        }

        return element;
    }
View Full Code Here

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", compareRequest.getEntry().toString() );
    }
View Full Code Here

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

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

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

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

        Control control = compareRequest.getCurrentControl();

        assertTrue( control.getCriticality() );

        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
View Full Code Here

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

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

        Control control = compareRequest.getCurrentControl();

        assertTrue( control.getCriticality() );

        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
View Full Code Here

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

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

        Control control = compareRequest.getCurrentControl();

        assertTrue( control.getCriticality() );

        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
View Full Code Here

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

        CompareRequest compareRequest = ( CompareRequest ) parser.getBatchRequest().getCurrentRequest();

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

        Control control = compareRequest.getCurrentControl();

        assertFalse( control.getCriticality() );

        assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.codec.compare.CompareRequest

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.