Introducing a new API call into AVMService:

LayeringDescriptor getLayeringInfo(version, path);

LayeringDescriptor has three methods:

isBackground() Is the looked up node a background node.
getPathAVMStore() Gets a descriptor for the store the path was looked up in.
getNativeAVMStore() Gets the store that the actual node was found in.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3348 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-18 19:08:21 +00:00
parent fff2fb6b05
commit e5eb45da0f
8 changed files with 224 additions and 6 deletions

View File

@@ -36,6 +36,49 @@ import org.alfresco.repo.avm.util.BulkLoader;
*/
public class AVMServiceTest extends AVMServiceTestBase
{
/**
* Test layering info.
*/
public void testLayeringInfo()
{
try
{
setupBasicTree();
fService.createAVMStore("layer");
fService.createLayeredDirectory("main:/a", "layer:/", "alayer");
fService.createSnapshot("layer");
LayeringDescriptor info = fService.getLayeringInfo(-1, "layer:/alayer");
assertFalse(info.isBackground());
assertEquals("layer", info.getPathAVMStore().getName());
assertEquals("layer", info.getNativeAVMStore().getName());
info = fService.getLayeringInfo(-1, "layer:/alayer/b/c");
assertTrue(info.isBackground());
assertEquals("layer", info.getPathAVMStore().getName());
assertEquals("main", info.getNativeAVMStore().getName());
fService.createFile("layer:/alayer/b", "figs").close();
fService.createSnapshot("layer");
info = fService.getLayeringInfo(-1, "layer:/alayer/b/figs");
assertFalse(info.isBackground());
assertEquals("layer", info.getPathAVMStore().getName());
assertEquals("layer", info.getNativeAVMStore().getName());
info = fService.getLayeringInfo(-1, "layer:/alayer/b/c");
assertTrue(info.isBackground());
assertEquals("layer", info.getPathAVMStore().getName());
assertEquals("main", info.getNativeAVMStore().getName());
fService.createLayeredDirectory("layer:/alayer/b", "layer:/", "blayer");
fService.createSnapshot("layer");
info = fService.getLayeringInfo(-1, "layer:/blayer/c");
assertEquals("main", info.getNativeAVMStore().getName());
info = fService.getLayeringInfo(-1, "layer:/blayer/figs");
assertEquals("layer", info.getNativeAVMStore().getName());
}
catch (Exception e)
{
e.printStackTrace(System.err);
fail();
}
}
/**
* Another test of renaming in a layer.
*/