* Test method for add( String, AttributeType, Value<?>... )
*/
@Test
public void testAddStringAttributeTypeValueArray() throws Exception
{
Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );
Value<String> strValue1 = new StringValue( atDC, "test1" );
Value<String> strValue2 = new StringValue( atDC, "test2" );
Value<String> strValue3 = new StringValue( atDC, "test3" );
Value<String> strNullValue = new StringValue( atDC, null );
Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( atPwd, BYTES2 );
Value<byte[]> binValue3 = new BinaryValue( atPwd, BYTES3 );
try
{
entry.add( "cn", ( AttributeType ) null, strValue1 );
fail();
}
catch ( IllegalArgumentException iae )
{
assertTrue( true );
}
entry.add( "DC", atDC, strValue1, strValue2, strValue1 );
entry.add( "UserPassword", atPwd, binValue1, binValue2, binValue1 );
assertEquals( 2, entry.size() );
assertTrue( entry.contains( atDC, "test1", "test2" ) );
assertTrue( entry.contains( atPwd, BYTES1, BYTES2 ) );
assertEquals( "DC", entry.get( atDC ).getUpId() );
assertEquals( "0.9.2342.19200300.100.1.25", entry.get( atDC ).getId() );
assertEquals( "UserPassword", entry.get( atPwd ).getUpId() );
assertEquals( "2.5.4.35", entry.get( atPwd ).getId() );
entry.add( "DC", atDC, strValue3, strNullValue );
assertEquals( 4, entry.get( atDC ).size() );
assertTrue( entry.contains( atDC, strNullValue ) );
entry.add( atDC, binValue3 );
assertFalse( entry.contains( atDC, binValue3 ) );
try
{
entry.add( "SN", atDC, "test" );
fail();
}
catch ( IllegalArgumentException iae )
{
assertTrue( true );