DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
// Add telephoneNumber attribute
String[] newValues =
{ "1234567890", "999999999" };
Attribute attr = new BasicAttribute( "telephoneNumber" );
attr.add( newValues[0] );
attr.add( newValues[1] );
Attributes attrs = new BasicAttributes( true );
attrs.put( attr );
ctx.modifyAttributes( RDN_TORI_AMOS, DirContext.ADD_ATTRIBUTE, attrs );
// Verify, that
// - case of attribute description is correct
// - attribute values are present
attrs = ctx.getAttributes( RDN_TORI_AMOS );
attr = attrs.get( "telephoneNumber" );
assertNotNull( attr );
assertEquals( "telephoneNumber", attr.getID() );
assertTrue( attr.contains( newValues[0] ) );
assertTrue( attr.contains( newValues[1] ) );
assertEquals( newValues.length, attr.size() );
}