ctx.addNamingListener( "", SearchControls.SUBTREE_SCOPE, listener );
Attributes testEntry = new BasicAttributes( "ou", "testentry", true );
Attribute objectClass = new BasicAttribute( "objectClass", "top" );
objectClass.add( "organizationalUnit" );
testEntry.put( objectClass );
ctx.createSubcontext( "ou=testentry", testEntry );
// Wait 1 second, as the process is asynchronous
Thread.sleep( 1000 );
assertEquals( 1, listener.getEventRecords().size() );