Examples of VFSCache


Examples of org.jboss.virtual.spi.cache.VFSCache

      //this should resolve as file:/home/csams/tmp/deploy
      URL dir = (URL) editor.getValue();

      CombinedVFSCache cache = new CombinedVFSCache();
      VFSCacheFactory.setInstance(cache);
      VFSCache realCache = new NoopVFSCache();
      realCache.start();
      cache.setRealCache(realCache);

      try
      {
        cache.setPermanentRoots(Collections.<URL, ExceptionHandler>singletonMap(dir, null));
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

      assertNotNull(testPath);
      assertNotNull(testName);

      CombinedVFSCache cache = new CombinedVFSCache();                          
      VFSCache realCache = new NoopVFSCache();
      realCache.start();
      cache.setRealCache(realCache);
      VFSCacheFactory.setInstance(cache);
      try
      {
         String rootText = StringPropertyReplacer.replaceProperties("${test.dir}");
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

      assertNotNull(testPath);
      assertNotNull(testName);

      CombinedVFSCache cache = new CombinedVFSCache();                          
      VFSCache realCache = new NoopVFSCache();
      realCache.start();
      cache.setRealCache(realCache);
      VFSCacheFactory.setInstance(cache);
      try
      {
         String rootText = StringPropertyReplacer.replaceProperties("${test.dir}");
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

      if (cache != null)
      {
         if (cache instanceof CombinedWrapperVFSCache)
         {
            CombinedWrapperVFSCache cwvc = (CombinedWrapperVFSCache)cache;
            VFSCache temp = cwvc.getTemp();
            temp.stop();
         }
         cache.stop();
      }
   }
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

      doTestClassLoader();
   }

   public void testClassLoaderWithCache() throws Exception
   {
      VFSCache cache = new IterableTimedVFSCache();
      cache.start();
      VFSCacheFactory.setInstance(cache);
      try
      {
         doTestClassLoader();
      }
      finally
      {
         VFSCacheFactory.setInstance(null);
         cache.stop();        
      }
   }
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

         }
         assertTrue("mkdir " + tempDir, tempDir.mkdir());

         System.setProperty("jboss.server.temp.dir", tempDir.getCanonicalPath());

         VFSCache cache = new LRUVFSCache(2, 5);
         cache.start();
         VFSCacheFactory.setInstance(cache);
      }
      catch (Exception e)
      {
         tearDown();
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

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

Examples of org.jboss.virtual.spi.cache.VFSCache

   public void testCacheStatistics() throws Exception
   {
      URL url = getResource("/vfs/test/nested");

      VFSCache cache = createCache();
      cache.start();
      try
      {
         if (cache instanceof CacheStatistics)
         {
            CacheStatistics statistics = CacheStatistics.class.cast(cache);
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

      }
   }

   protected Class<? extends VFSCache> getCacheClass()
   {
      VFSCache cache = createCache();
      return cache.getClass();
   }
View Full Code Here

Examples of org.jboss.virtual.spi.cache.VFSCache

   protected abstract Map<Object, Object> getMap();

   public void testCacheFactory() throws Exception
   {
      VFSCache cache = null;
      String cacheClassName = getCacheClass().getName();

      VFSCacheFactory.setInstance(null);
      try
      {
         Iterable<String> keys = populateRequiredSystemProperties();
         try
         {
            cache = VFSCacheFactory.getInstance(cacheClassName);
            assertNotNull(cache);
            assertTrue(cache instanceof NoopVFSCache == false);
            cache.flush();
         }
         finally
         {
            for (String key : keys)
               System.clearProperty(key);
         }

         VFSCacheFactory.setInstance(null);

         VFSCache mapParamCache = VFSCacheFactory.getInstance(cacheClassName, getMap());
         // need new instance, so we know we're really testing map parameter
         assertNotSame(cache, mapParamCache);
         cache = mapParamCache;
         assertNotNull(cache);
         assertTrue(cache instanceof NoopVFSCache == false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.