public void testResolveFileInUnpackedJar()
throws Exception
{
log.info("+++ testResolveFileInUnpackedJar, cwd="+(new File(".").getCanonicalPath()));
URL rootURL = getResource("/vfs/test");
VFS vfs = VFS.getVFS(rootURL);
// Check resolving the root file
VirtualFile root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
assertFalse("root isDirectory", root.isLeaf());
// Find the outer.jar
VirtualFile outerJar = vfs.findChild("unpacked-outer.jar");
assertNotNull("unpacked-outer.jar", outerJar);
assertEquals("unpacked-outer.jar name", "unpacked-outer.jar", outerJar.getName());
assertEquals("unpacked-outer.jar path", "unpacked-outer.jar", outerJar.getPathName());
VirtualFile outerJarMF = vfs.findChild("unpacked-outer.jar/META-INF/MANIFEST.MF");
assertNotNull("unpacked-outer.jar/META-INF/MANIFEST.MF", outerJarMF);
// Test a non-canonical path
rootURL = getResource("/test/sundry/../test");
// Check resolving the root file
root = vfs.findChild("");
assertEquals("root name", "test", root.getName());
assertEquals("root path", "", root.getPathName());
assertFalse("root isDirectory", root.isLeaf());
}