### Question:
LdifPartition extends AbstractLdifPartition { @Override public void move( MoveOperationContext moveContext ) throws LdapException { PartitionTxn partitionTxn = moveContext.getTransaction(); Dn oldDn = moveContext.getDn(); String id = getEntryId( partitionTxn, oldDn ); super.move( moveContext ); Entry modifiedEntry = fetch( moveContext.getTransaction(), id, moveContext.getNewDn() ); try { entryMoved( partitionTxn, oldDn, modifiedEntry, id ); } catch ( Exception e ) { throw new LdapOperationErrorException( e.getMessage(), e ); } } LdifPartition( SchemaManager schemaManager, DnFactory dnFactory ); @Override void add( AddOperationContext addContext ); @Override Entry delete( PartitionTxn partitionTxn, String id ); @Override void modify( ModifyOperationContext modifyContext ); @Override void move( MoveOperationContext moveContext ); @Override void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ); @Override void rename( RenameOperationContext renameContext );  }### Answer:
@Test public void testLdifMoveEntry() throws Exception { CoreSession session = injectEntries(); Entry childEntry1 = partition.fetch( partition.beginReadTransaction(), partition.getEntryId( partition.beginReadTransaction(), new Dn( schemaManager, "dc=child1,ou=test,ou=system" ) ) ); Entry childEntry2 = partition.fetch( partition.beginReadTransaction(), partition.getEntryId( partition.beginReadTransaction(), new Dn( schemaManager, "dc=child2,ou=test,ou=system" ) ) ); MoveOperationContext moveOpCtx = new MoveOperationContext( session, childEntry1.getDn(), childEntry2.getDn() ); moveOpCtx.setPartition( partition ); moveOpCtx.setTransaction( partition.beginWriteTransaction() ); partition.move( moveOpCtx ); assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1" ).exists() ); assertFalse( new File( wkdir, "ou=test,ou=system/dc=child1.ldif" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2.ldif" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1.ldif" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild11" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild11.ldif" ).exists() ); assertFalse( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild12" ).exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild12.ldif" ).exists() ); assertFalse( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild11/dc=greatgrandchild111" ) .exists() ); assertTrue( new File( wkdir, "ou=test,ou=system/dc=child2/dc=child1/dc=grandchild11/dc=greatgrandchild111.ldif" ) .exists() ); }