mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user