mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added missing callbacks to AVMNodeService. This makes things slow.
Have to do something about that. Added getPaths call to AVMService. Retrieves all possible paths to a node. Need to do timing tests. I believe, the 6th version of a Pair template class. This one's public and perhaps when we have time we could use it in place of all the inner class implementations. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3964 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -56,6 +56,7 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* Big test of AVM behavior.
|
||||
@@ -63,6 +64,31 @@ import org.alfresco.util.GUID;
|
||||
*/
|
||||
public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
/**
|
||||
* Test getting all paths for a node.
|
||||
*
|
||||
*/
|
||||
public void testGetPaths()
|
||||
{
|
||||
try
|
||||
{
|
||||
setupBasicTree();
|
||||
fService.createBranch(-1, "main:/a", "main:/", "abranch");
|
||||
fService.createSnapshot("main");
|
||||
fService.createBranch(-1, "main:/a/b", "main:/", "bbranch");
|
||||
List<Pair<Integer, String>> paths = fService.getPaths(fService.lookup(-1, "main:/a/b/c/foo"));
|
||||
for (Pair<Integer, String> path : paths)
|
||||
{
|
||||
System.out.println(path.getFirst() + " " + path.getSecond());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace(System.err);
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test partial flatten.
|
||||
*/
|
||||
@@ -85,6 +111,7 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
assertTrue(b.isLayeredDirectory());
|
||||
AVMNodeDescriptor c = fService.lookup(-1, "layer:/a/b/c");
|
||||
assertTrue(c.isPlainDirectory());
|
||||
assertEquals(1, fSyncService.compare(-1, "layer:/a", -1, "main:/a").size());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user