mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Adjusted AVMCrawlTestPP to be more stringent now that we have retryin
transactions. History is noww correctly maintained for cases of deletes followed by renames or creates. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4587 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -71,6 +71,39 @@ import org.alfresco.util.Pair;
|
||||
*/
|
||||
public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
/**
|
||||
* Test relinking of nodes to history.
|
||||
*/
|
||||
public void testHistoryRelink()
|
||||
{
|
||||
try
|
||||
{
|
||||
setupBasicTree();
|
||||
fService.createAVMStore("branch");
|
||||
fService.createBranch(-1, "main:/a", "branch:/", "a");
|
||||
fService.removeNode("branch:/a/b/c/foo");
|
||||
List<AVMDifference> diffs = fSyncService.compare(-1, "branch:/a", -1, "main:/a", null);
|
||||
assertEquals(1, diffs.size());
|
||||
assertEquals(AVMDifference.NEWER, diffs.get(0).getDifferenceCode());
|
||||
fService.createFile("branch:/a/b/c", "foo").close();
|
||||
diffs = fSyncService.compare(-1, "branch:/a", -1, "main:/a", null);
|
||||
assertEquals(1, diffs.size());
|
||||
assertEquals(AVMDifference.NEWER, diffs.get(0).getDifferenceCode());
|
||||
fSyncService.update(diffs, null, false, false, false, false, null, null);
|
||||
fService.removeNode("branch:/a/b/c/bar");
|
||||
fService.createFile("branch:/a/b/c", "pismo").close();
|
||||
fService.rename("branch:/a/b/c", "pismo", "branch:/a/b/c", "bar");
|
||||
diffs = fSyncService.compare(-1, "branch:/a", -1, "main:/a", null);
|
||||
assertEquals(1, diffs.size());
|
||||
assertEquals(AVMDifference.NEWER, diffs.get(0).getDifferenceCode());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test renaming a store.
|
||||
*/
|
||||
@@ -775,13 +808,13 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
// Get synced again by doing an override conflict.
|
||||
// Get synced again by doing an override older.
|
||||
System.out.println(recursiveList("main", -1, true));
|
||||
diffs.clear();
|
||||
diffs.add(new AVMDifference(-1, "main:/a/monkey",
|
||||
-1, "main:/abranch/monkey",
|
||||
AVMDifference.NEWER));
|
||||
fSyncService.update(diffs, null, false, false, true, false, null, null);
|
||||
fSyncService.update(diffs, null, false, false, false, true, null, null);
|
||||
assertEquals(0, fSyncService.compare(-1, "main:/abranch", -1, "main:/a", excluder).size());
|
||||
fService.createSnapshot("main", null, null);
|
||||
System.out.println(recursiveList("main", -1, true));
|
||||
@@ -859,13 +892,13 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
// Get synced again by doing an override conflict.
|
||||
// Get synced again by doing an override older.
|
||||
System.out.println(recursiveList("main", -1, true));
|
||||
diffs.clear();
|
||||
diffs.add(new AVMDifference(-1, "main:/a/monkey",
|
||||
-1, "main:/layer/monkey",
|
||||
AVMDifference.NEWER));
|
||||
fSyncService.update(diffs, null, false, false, true, false, null, null);
|
||||
fSyncService.update(diffs, null, false, false, false, true, null, null);
|
||||
assertEquals(0, fSyncService.compare(-1, "main:/layer", -1, "main:/a", excluder).size());
|
||||
fService.createSnapshot("main", null, null);
|
||||
System.out.println(recursiveList("main", -1, true));
|
||||
|
Reference in New Issue
Block a user