Package org.apache.directory.shared.ldap.model.entry

Examples of org.apache.directory.shared.ldap.model.entry.Attribute.clear()


                fout.close();
            }
            else
            {
                Attribute attr = cookieMod.getAttribute();
                attr.clear();
                attr.add( syncCookie );

                session.modify( config.getConfigEntryDn(), cookieMod );
            }
View Full Code Here


        assertTrue( iterator.hasNext() );

        Value<?> value = iterator.next();
        assertEquals( NULL_STRING_VALUE, value );

        attr.clear();
        iterator = attr.iterator();
        assertFalse( iterator.hasNext() );

        attr.add( "a", "b", "c" );
        iterator = attr.iterator();
View Full Code Here

        Attribute attr2 = new DefaultAttribute( atCN );

        attr2.add( "a", "b" );
        assertEquals( 2, attr2.size() );

        attr2.clear();
        assertEquals( 0, attr2.size() );

        Attribute attr3 = new DefaultAttribute( atC );

        attr3.add( "US" );
View Full Code Here

        assertEquals( 2, nbAdded );
        assertFalse( attr4.isHumanReadable() );
        assertTrue( attr4.contains( BYTES1 ) );
        assertTrue( attr4.contains( BYTES2 ) );

        attr4.clear();
        nbAdded = attr4.add( BYTES3, BYTES4 );
        assertEquals( 2, nbAdded );
        assertFalse( attr4.isHumanReadable() );
        assertTrue( attr4.contains( BYTES3 ) );
        assertTrue( attr4.contains( BYTES4 ) );
View Full Code Here

        assertEquals( 0, attr.size() );

        attr.add( ( String ) null, "a", "b" );
        assertEquals( 3, attr.size() );

        attr.clear();
        assertTrue( attr.isHumanReadable() );
        assertEquals( 0, attr.size() );
        assertEquals( atEMail, attr.getAttributeType() );
    }
View Full Code Here

        attr2.add( "a", "b" );
        assertEquals( attr1.hashCode(), attr2.hashCode() );

        // Order matters
        attr2.clear();
        attr2.add( "b", "a" );
        assertNotSame( attr1.hashCode(), attr2.hashCode() );

        Attribute attr3 = new DefaultAttribute( atPwd );
        Attribute attr4 = new DefaultAttribute( atPwd );
View Full Code Here

            { 0x01, 0x02 }, new byte[]
            { 0x03, 0x04 } );
        assertNotSame( attr1.hashCode(), attr2.hashCode() );

        // Order matters
        attr4.clear();
        attr4.add( new byte[]
            { 0x03, 0x04 }, new byte[]
            { 0x01, 0x02 } );
        assertNotSame( attr1.hashCode(), attr2.hashCode() );
    }
View Full Code Here

        assertEquals( 0, attr.add( new byte[]
            { 0x01 } ) );
        assertTrue( attr.isValid( atCN ) );

        // test a SINGLE-VALUE attribute. CountryName is SINGLE-VALUE
        attr.clear();
        attr.apply( atC );
        attr.add( "FR" );
        assertTrue( attr.isValid( atC ) );
        assertEquals( 0, attr.add( "US" ) );
        assertFalse( attr.contains( "US" ) );
View Full Code Here

        attr1.clear();
        attr1.add( BYTES1, BYTES2, BYTES3 );
        assertFalse( attr1.remove( BYTES3, BYTES4 ) );
        assertEquals( 2, attr1.size() );

        attr1.clear();
        attr1.add( BYTES1, ( byte[] ) null, BYTES2 );
        assertTrue( attr1.remove( ( byte[] ) null, BYTES1 ) );
        assertEquals( 1, attr1.size() );
    }
View Full Code Here

        assertTrue( attr1.remove( "b", "c" ) );
        assertEquals( 0, attr1.size() );

        assertFalse( attr1.remove( "d" ) );

        attr1.clear();
        attr1.add( "a", "b", "c" );
        assertFalse( attr1.remove( "b", "e" ) );
        assertEquals( 2, attr1.size() );

        attr1.clear();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.