* Test method for for {@link org.apache.directory.shared.ldap.model.entry.DefaultEntry#toString()}.
*/
@Test
public void testToString()
{
Entry entry = new DefaultEntry( EXAMPLE_DN );
assertEquals( "Entry\n dn: dc=example,dc=com\n", entry.toString() );
Value<String> strValueTop = new StringValue( "top" );
Value<String> strValuePerson = new StringValue( "person" );
Value<String> strNullValue = new StringValue( ( String ) null );
Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
Value<byte[]> binNullValue = new BinaryValue( ( byte[] ) null );
entry.put( "ObjectClass", strValueTop, strValuePerson, strNullValue );
entry.put( "UserPassword", binValue1, binValue2, binNullValue );
String expected =
"Entry\n" +
" dn: dc=example,dc=com\n" +
" ObjectClass: top\n" +
" ObjectClass: person\n" +
" ObjectClass: ''\n" +
" UserPassword: '0x61 0x62 '\n" +
" UserPassword: '0x62 '\n" +
" UserPassword: ''\n";
assertEquals( expected, entry.toString() );
}