@SuppressWarnings("deprecation")
public void testCache() throws Exception
{
URL url = getResource("/vfs/test/nested");
VFSCache cache = createCache();
cache.start();
try
{
VFSCacheFactory.setInstance(cache);
try
{
configureCache(cache);
VirtualFile root = VFS.getRoot(url);
VirtualFile file = root.findChild("/nested.jar/META-INF/empty.txt");
URL fileURL = file.toURL();
VirtualFile nested = root.findChild("/nested.jar/complex.jar/subfolder/subsubfolder/subsubchild");
URL nestedURL = nested.toURL();
assertEquals(file, VFS.getRoot(fileURL));
assertEquals(nested, VFS.getRoot(nestedURL));
VFSCacheFactory.setInstance(null);
VFSCache wrapper = new WrapperVFSCache(cache);
VFSCacheFactory.setInstance(wrapper);
assertEquals(file, VFS.getRoot(fileURL));
assertEquals(nested, VFS.getRoot(nestedURL));
}