Package org.apache.directory.api.ldap.model.message

Examples of org.apache.directory.api.ldap.model.message.ModifyRequestImpl


     * Tests the same object reference for equal hashCode.
     */
    @Test
    public void testHashCodeSameObj() throws LdapException
    {
        ModifyRequestImpl req = getRequest();
        assertTrue( req.hashCode() == req.hashCode() );
    }
View Full Code Here


     * Tests for equal hashCode using exact copies.
     */
    @Test
    public void testHashCodeExactCopy() throws LdapException
    {
        ModifyRequestImpl req0 = getRequest();
        ModifyRequestImpl req1 = getRequest();
        assertTrue( req0.hashCode() == req1.hashCode() );
    }
View Full Code Here

     * Test for inequality when only the IDs are different.
     */
    @Test
    public void testNotEqualDiffId()
    {
        ModifyRequestImpl req0 = new ModifyRequestImpl();
        req0.setMessageId( 7 );
        ModifyRequestImpl req1 = new ModifyRequestImpl();
        req1.setMessageId( 5 );
        assertFalse( req0.equals( req1 ) );
    }
View Full Code Here

    @Test
    public void testNotEqualDiffName()
    {
        try
        {
            ModifyRequestImpl req0 = getRequest();
            req0.setName( new Dn( "cn=admin,dc=example,dc=com" ) );
            ModifyRequestImpl req1 = getRequest();
            req1.setName( new Dn( "cn=admin,dc=apache,dc=org" ) );

            assertFalse( req0.equals( req1 ) );
        }
        catch ( LdapException ine )
        {
View Full Code Here

     * Test for inequality when only the mods ops are different.
     */
    @Test
    public void testNotEqualDiffModOps() throws LdapException
    {
        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();
        attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        item = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
        req0.addModification( item );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

     * Test for inequality when only the number of mods are different.
     */
    @Test
    public void testNotEqualDiffModCount() throws LdapException
    {
        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

     * Test for inequality when only the mods attribute Id's are different.
     */
    @Test
    public void testNotEqualDiffModIds() throws LdapException
    {
        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();
        attr = new DefaultAttribute( "attr4" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

     * Test for inequality when only the mods attribute values are different.
     */
    @Test
    public void testNotEqualDiffModValues() throws LdapException
    {
        ModifyRequestImpl req0 = getRequest();
        Attribute attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        ModifyRequestImpl req1 = getRequest();
        attr = new DefaultAttribute( "attr3" );
        attr.add( "val0" );
        attr.add( "val1" );
        attr.add( "val2" );
        attr.add( "val3" );
        item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
        req0.addModification( item );

        assertFalse( req0.equals( req1 ) );
        assertFalse( req1.equals( req0 ) );
    }
View Full Code Here

            {
                return this;
            }
        };

        ModifyRequestImpl req1 = getRequest();
        assertTrue( req1.equals( req0 ) );
    }
View Full Code Here

    /**
     * Creates a new getDecoratedMessage() of ModifyRequestDsml.
     */
    public ModifyRequestDsml( LdapApiService codec )
    {
        super( codec, new ModifyRequestImpl() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.message.ModifyRequestImpl

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.