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( 3, compareRequest.getControls().size() );

        Control control = compareRequest.getCurrentControl();

        assertTrue( control.getCriticality() );

        assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
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", ( String ) compareRequest.getEntry().toString() );

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

        assertEquals( "Johnson", ( String ) compareRequest.getAssertionValue() );
    }
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", ( String ) compareRequest.getEntry().toString() );

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

        assertEquals( "DSMLv2.0 rocks!!", new String( (byte[]) compareRequest.getAssertionValue() ) );
    }
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", ( 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 = instance.getCompareRequest();
       
        // 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

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.