cache.start();
// setup VFS
VFS vfs = VFS.getVFS(rootURL);
VFSUtils.enableCopy(vfs);
TrackingTempStore store = new TrackingTempStore(new MockTempStore(new Random().nextLong()));
vfs.setTempStore(store);
try
{
URL directRootURL = new URL("file://" + rootText);
VirtualFile root = VFS.getRoot(directRootURL);
// assertEquals(vfs, root.getVFS()); // this is actually the real cause
VirtualFile file = root.getChild(testPath);
assertNotNull(file);
assertTrue(file.getSize() > 0);
assertCopies(store);
URL url = file.toURL();
URLConnection conn = url.openConnection();
assertCopies(store);
assertEquals(file.getLastModified(), conn.getLastModified());
directRootURL = new URL("vfszip://" + rootText + testPath);
conn = directRootURL.openConnection();
assertCopies(store);
assertEquals(file.getLastModified(), conn.getLastModified());
}
finally
{
store.clear();
}
}
finally
{
VFSCacheFactory.setInstance(null);