*/
@Test
public void testRemoveUpIdElipsis() throws Exception
{
Dn dn = new Dn( schemaManager, "cn=test" );
DefaultEntry entry = new DefaultEntry( schemaManager, dn );
AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );
byte[] b1 = Strings.getBytesUtf8( "test1" );
byte[] b2 = Strings.getBytesUtf8( "test2" );
Value<String> test1 = new StringValue( atCN, "test1" );
Value<String> test2 = new StringValue( atCN, "test2" );
Value<byte[]> testB1 = new BinaryValue( atPassword, b1 );
Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );
// test a removal of an non existing attribute
entry.removeAttributes( atCN );
// Test a simple removal
entry.add( "cN", atCN, test1 );
assertEquals( 1, entry.size() );
assertNotNull( entry.get( atCN ) );
entry.removeAttributes( "CN" );
assertEquals( 0, entry.size() );
assertNull( entry.get( atCN ) );
// Test a removal of many elements
entry.put( "CN", test1, test2 );
entry.put( "userPassword", testB1, testB2 );
assertEquals( 2, entry.size() );
assertNotNull( entry.get( atCN ) );
assertNotNull( entry.get( atPassword ) );
AttributeType OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
entry.removeAttributes( "cN", "UsErPaSsWoRd" );
assertEquals( 0, entry.size() );
assertNull( entry.get( atCN ) );
assertNull( entry.get( atPassword ) );
assertFalse( entry.contains( OBJECT_CLASS_AT, "top" ) );
// test the removal of a bad Attribute
entry.put( "CN", test1, test2 );
entry.put( "userPassword", testB1, testB2 );
assertEquals( 2, entry.size() );
assertNotNull( entry.get( atCN ) );
assertNotNull( entry.get( atPassword ) );
entry.removeAttributes( "badAttribute" );
}