@Test
public void testCsnLessEqualitySearch() throws Exception
{
LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );
Dn dn = new Dn( "cn=testLowerCsnAdd,ou=system" );
Entry entry = new DefaultEntry( dn );
entry.add( "objectClass", SchemaConstants.PERSON_OC );
entry.add( "cn", "testLowerCsnAdd_cn" );
entry.add( "sn", "testLowerCsnAdd_sn" );
connection.add( entry );
// add an entry to have a entry with higher CSN value
Dn dn2 = new Dn( "cn=testHigherCsnAdd,ou=system" );
Entry entry2 = new DefaultEntry( dn2,
"objectClass :person",
"cn: testHigherCsnAdd_cn",
"sn: testHigherCsnAdd_sn" );
connection.add( entry2 );
entry = connection.lookup( dn.getName(), "+" );
entry2 = connection.lookup( dn2.getName(), "+" );
String lowerCsn = entry.get( "entryCsn" ).getString();
String higherCsn = entry2.get( "entryCsn" ).getString();
// usecases