This in theory makes AVMSyncService feature complete, by added flatten, which

essentially resets a users layer to be as much like the target tree as possible
to keep comparisons fast.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3797 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-14 19:59:08 +00:00
parent 1386cedef5
commit 348ec8b265
2 changed files with 52 additions and 5 deletions

View File

@@ -58,6 +58,43 @@ import org.alfresco.service.transaction.TransactionService;
*/
public class AVMServiceTest extends AVMServiceTestBase
{
/**
* Test the flatten operation, with a little bit of compare and update.
*/
public void testFlatten()
{
try
{
setupBasicTree();
fService.createLayeredDirectory("main:/a", "main:/", "layer");
fService.createSnapshot("main");
System.out.println(recursiveList("main", -1, true));
// Change some stuff.
fService.createFile("main:/layer/b", "fig").close();
fService.getFileOutputStream("main:/layer/b/c/foo").close();
fService.createSnapshot("main");
System.out.println(recursiveList("main", -1, true));
// Do a compare.
List<AVMDifference> diffs =
fSyncService.compare(-1, "main:/layer", -1, "main:/a");
for (AVMDifference diff : diffs)
{
System.out.println(diff);
}
// Update.
fSyncService.update(diffs, false, false, false, false);
System.out.println(recursiveList("main", -1, true));
// Flatten.
fSyncService.flatten("main:/layer", "main:/a");
System.out.println(recursiveList("main", -1, true));
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
/**
* Test of Descriptor indirection field.
*/