* Test method add( byte[]... )
*/
@Test
public void testAddByteArray() throws LdapInvalidAttributeValueException
{
Attribute attr1 = new DefaultAttribute( atPwd );
int nbAdded = attr1.add( ( byte[] ) null );
assertEquals( 1, nbAdded );
assertFalse( attr1.isHumanReadable() );
assertTrue( Arrays.equals( NULL_BINARY_VALUE.getBytes(), attr1.getBytes() ) );
Attribute attr2 = new DefaultAttribute( atPwd );
nbAdded = attr2.add( StringConstants.EMPTY_BYTES );
assertEquals( 1, nbAdded );
assertFalse( attr2.isHumanReadable() );
assertTrue( Arrays.equals( StringConstants.EMPTY_BYTES, attr2.getBytes() ) );
Attribute attr3 = new DefaultAttribute( atPwd );
nbAdded = attr3.add( BYTES1 );
assertEquals( 1, nbAdded );
assertFalse( attr3.isHumanReadable() );
assertTrue( Arrays.equals( BYTES1, attr3.getBytes() ) );
Attribute attr4 = new DefaultAttribute( atPwd );
nbAdded = attr4.add( BYTES1, BYTES2, BYTES3, BYTES4 );
assertEquals( 4, nbAdded );
assertFalse( attr4.isHumanReadable() );
assertTrue( attr4.contains( BYTES1 ) );
assertTrue( attr4.contains( BYTES2 ) );
assertTrue( attr4.contains( BYTES3 ) );
assertTrue( attr4.contains( BYTES4 ) );
Attribute attr5 = new DefaultAttribute( atPwd );
nbAdded = attr5.add( BYTES1, BYTES2, ( byte[] ) null, BYTES3 );
assertEquals( 4, nbAdded );
assertFalse( attr5.isHumanReadable() );
assertTrue( attr5.contains( BYTES1 ) );
assertTrue( attr5.contains( BYTES2 ) );
assertTrue( attr5.contains( ( byte[] ) null ) );
assertTrue( attr5.contains( BYTES3 ) );
Attribute attr6 = new DefaultAttribute( atPwd );
nbAdded = attr6.add( "ab", ( String ) null );
assertEquals( 2, nbAdded );
assertFalse( attr6.isHumanReadable() );
}