Package org.jboss.virtual.plugins.copy

Examples of org.jboss.virtual.plugins.copy.TrackingTempStore


         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);
View Full Code Here


         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);
View Full Code Here

   {
      long seed = System.nanoTime();
      URL url = getResource("/vfs/test/nested");
      VFS vfs = VFS.getVFS(url);
      VFSUtils.enableCopy(vfs);
      TempStore store = new MkdirTempStore(new TrackingTempStore(new MockTempStore(seed)));
      try
      {
         vfs.setTempStore(store);
         VirtualFile file = vfs.getChild("nested.jar");
         assertNotNull(file.getChild("complex.jar/subfolder/subchild"));
View Full Code Here

TOP

Related Classes of org.jboss.virtual.plugins.copy.TrackingTempStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.