{
DN adminDn = new DN( "uid=admin,ou=system" ).normalize( schemaManager.getNormalizerMapping() );
CoreSession session = new MockCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), new MockDirectoryService( 1 ) );
AddOperationContext addCtx = new AddOperationContext( session );
ClonedServerEntry rootEntry = createEntry( "ou=test,ou=system" );
rootEntry.put( "ObjectClass", "top", "domain" );
rootEntry.put( "ou", "test" );
addCtx.setEntry( rootEntry );
partition.add( addCtx );
ClonedServerEntry childEntry1 = createEntry( "dc=child1,ou=test,ou=system" );
childEntry1.put( "ObjectClass", "top", "domain" );
childEntry1.put( "dc", "child1" );
addCtx.setEntry( childEntry1 );
partition.add( addCtx );
ClonedServerEntry childEntry2 = createEntry( "dc=child2,ou=test,ou=system" );
childEntry2.put( "ObjectClass", "top", "domain" );
childEntry2.put( "dc", "child2" );
addCtx.setEntry( childEntry2 );
partition.add( addCtx );
ClonedServerEntry grandChild11 = createEntry( "dc=grandChild11,dc=child1,ou=test,ou=system" );
grandChild11.put( "ObjectClass", "top", "domain" );
grandChild11.put( "dc", "grandChild11" );
addCtx.setEntry( grandChild11 );
partition.add( addCtx );
ClonedServerEntry grandChild12 = createEntry( "dc=grandChild12,dc=child1,ou=test,ou=system" );
grandChild12.put( "ObjectClass", "top", "domain" );
grandChild12.put( "dc", "grandChild12" );
addCtx.setEntry( grandChild12 );
partition.add( addCtx );
ClonedServerEntry greatGrandChild111 = createEntry( "dc=greatGrandChild111,dc=grandChild11,dc=child1,ou=test,ou=system" );
greatGrandChild111.put( "ObjectClass", "top", "domain" );
greatGrandChild111.put( "dc", "greatGrandChild111" );
addCtx.setEntry( greatGrandChild111 );
partition.add( addCtx );
assertTrue( new File( wkdir, "ou=test,ou=system" ).exists() );