@Test
public void testLookups() throws Exception
{
initIndex();
ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( schemaManager, "cn=key" ) );
assertNull( idx.forwardLookup( key ) );
idx.add( key, Strings.getUUID( 0L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( key ) );
assertEquals( key, idx.reverseLookup( Strings.getUUID( 0L ) ) );
// check with the different case in UP name, this ensures that the custom
// key comparator is used
key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( schemaManager, "cn=KEY" ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( key ) );
assertEquals( key, idx.reverseLookup( Strings.getUUID( 0L ) ) );
}