assertFalse( cursor.next() );
// dn id 12
DN martinDn = new DN( "cn=Marting King,ou=Sales,o=Good Times Co." );
martinDn.normalize( schemaManager.getNormalizerMapping() );
DefaultServerEntry entry = new DefaultServerEntry( schemaManager, martinDn );
entry.add( "objectClass", "top", "person", "organizationalPerson" );
entry.add( "ou", "Sales" );
entry.add( "cn", "Martin King" );
entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
entry.add( "entryUUID", UUID.randomUUID().toString() );
store.add( entry );
cursor = idx.forwardCursor( 2L );
cursor.afterLast();
assertTrue( cursor.previous() );
assertEquals( 12, ( long ) cursor.get().getId() );
DN newParentDn = new DN( "ou=Board of Directors,o=Good Times Co." );
newParentDn.normalize( schemaManager.getNormalizerMapping() );
store.move( martinDn, newParentDn );
cursor = idx.forwardCursor( 3L );
cursor.afterLast();
assertTrue( cursor.previous() );
assertEquals( 12, ( long ) cursor.get().getId() );
// dn id 13
DN marketingDn = new DN( "ou=Marketing,ou=Sales,o=Good Times Co." );
marketingDn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, marketingDn );
entry.add( "objectClass", "top", "organizationalUnit" );
entry.add( "ou", "Marketing" );
entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
entry.add( "entryUUID", UUID.randomUUID().toString() );
store.add( entry );
// dn id 14
DN jimmyDn = new DN( "cn=Jimmy Wales,ou=Marketing, ou=Sales,o=Good Times Co." );
jimmyDn.normalize( schemaManager.getNormalizerMapping() );
entry = new DefaultServerEntry( schemaManager, jimmyDn );
entry.add( "objectClass", "top", "person", "organizationalPerson" );
entry.add( "ou", "Marketing" );
entry.add( "cn", "Jimmy Wales" );
entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
entry.add( "entryUUID", UUID.randomUUID().toString() );
store.add( entry );
store.move( marketingDn, newParentDn );
cursor = idx.forwardCursor( 3L );