{
LdapConnection sysRoot = getAdminConnection( ldapServer );
long revision = service.getChangeLog().getCurrentRevision();
// add new test entry
Entry entry = new DefaultClientEntry( new DN( "ou=test0,ou=system" ) );
entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
entry.add( SchemaConstants.OU_AT, "test0" );
sysRoot.add( entry );
assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
Tag t0 = service.getChangeLog().tag();
assertEquals( t0, service.getChangeLog().getLatest() );
assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
assertEquals( revision + 1, t0.getRevision() );
// add another test entry
entry = new DefaultClientEntry( new DN( "ou=test1,ou=system" ) );
entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
entry.put( SchemaConstants.OU_AT, "test1" );
sysRoot.add( entry );
assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
Tag t1 = service.getChangeLog().tag();
assertEquals( t1, service.getChangeLog().getLatest() );
assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
assertEquals( revision + 2, t1.getRevision() );
ldapServer.stop();
ldapServer.start();
sysRoot = getAdminConnection( ldapServer );
assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
assertEquals( t1, service.getChangeLog().getLatest() );
assertEquals( revision + 2, t1.getRevision() );
// add third test entry
entry = new DefaultClientEntry( new DN( "ou=test2,ou=system" ) );
entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
entry.put( SchemaConstants.OU_AT, "test2" );
sysRoot.add( entry );
assertEquals( revision + 3, service.getChangeLog().getCurrentRevision() );
service.revert();