@Test
public void testCompareTo() throws LdapException
{
BinaryValue bv1 = new BinaryValue( ( byte[] ) null );
BinaryValue bv2 = new BinaryValue( ( byte[] ) null );
assertEquals( 0, bv1.compareTo( bv2 ) );
bv1 = new BinaryValue( BYTES1 );
assertEquals( 1, bv1.compareTo( bv2 ) );
assertEquals( -1, bv2.compareTo( bv1 ) );
bv2 = new BinaryValue( BYTES1 );
assertEquals( 0, bv1.compareTo( bv2 ) );
// Now check that the equals method works on normalized values.
bv1 = new BinaryValue( BYTES2 );
bv2 = new BinaryValue( BYTES1 );
bv1.apply( at );
assertEquals( 0, bv1.compareTo( bv2 ) );
bv1 = new BinaryValue( BYTES1 );
bv2 = new BinaryValue( BYTES2 );
assertEquals( 1, bv1.compareTo( bv2 ) );
bv1 = new BinaryValue( BYTES2 );
bv2 = new BinaryValue( BYTES1 );
assertEquals( -1, bv1.compareTo( bv2 ) );
}