[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/factories ...

Manik Surtani manik at jboss.org
Tue May 22 07:43:36 EDT 2007


  User: msurtani
  Date: 07/05/22 07:43:36

  Modified:    tests/functional/org/jboss/cache/factories 
                        InterceptorChainFactoryTest.java
  Log:
  JBCACHE-1045 and made ICF a singleton
  
  Revision  Changes    Path
  1.11      +31 -31    JBossCache/tests/functional/org/jboss/cache/factories/InterceptorChainFactoryTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: InterceptorChainFactoryTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/factories/InterceptorChainFactoryTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- InterceptorChainFactoryTest.java	28 Feb 2007 19:08:07 -0000	1.10
  +++ InterceptorChainFactoryTest.java	22 May 2007 11:43:36 -0000	1.11
  @@ -40,8 +40,8 @@
      public void testBareConfig() throws Exception
      {
         cache.getConfiguration().setExposeManagementStatistics(false);
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testBareConfig interceptors are:\n" + list);
  @@ -64,8 +64,8 @@
         cache.getConfiguration().setExposeManagementStatistics(false);
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
   
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testTxConfig interceptors are:\n" + list);
  @@ -112,8 +112,8 @@
         cache.getConfiguration().setCacheMode("REPL_ASYNC");
         cache.getConfiguration().setFetchInMemoryState(false);
         cache.create();
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testSharedCacheLoaderConfig interceptors are:\n" + list);
  @@ -142,8 +142,8 @@
         cache.getConfiguration().setCacheMode("REPL_ASYNC");
         cache.getConfiguration().setFetchInMemoryState(false);
         cache.create();
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testUnsharedCacheLoaderConfig interceptors are:\n" + list);
  @@ -169,8 +169,8 @@
         cache.getConfiguration().setExposeManagementStatistics(false);
         cache.getConfiguration().setCacheMode("repl_sync");
         cache.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testTxAndRepl interceptors are:\n" + list);
  @@ -196,10 +196,10 @@
         cache.getConfiguration().setExposeManagementStatistics(false);
         cache.getConfiguration().setNodeLockingOptimistic(true);
   
  -      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      List<Interceptor> list = InterceptorChainFactory.asList(next);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
         Iterator<Interceptor> interceptors = list.iterator();
   
         Assert.assertEquals(8, list.size());
  @@ -223,10 +223,10 @@
         cache.getConfiguration().setNodeLockingOptimistic(true);
         cache.getConfiguration().setCacheMode("REPL_SYNC");
   
  -      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      List<Interceptor> list = InterceptorChainFactory.asList(next);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
         Iterator<Interceptor> interceptors = list.iterator();
   
         Assert.assertEquals(9, list.size());
  @@ -251,10 +251,10 @@
         cache.getConfiguration().setNodeLockingOptimistic(true);
         cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
         cache.create();
  -      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      List<Interceptor> list = InterceptorChainFactory.asList(next);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
         Iterator<Interceptor> interceptors = list.iterator();
   
         Assert.assertEquals(10, list.size());
  @@ -280,10 +280,10 @@
         cache.getConfiguration().setNodeLockingOptimistic(true);
         cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(true, false));
         cache.create();
  -      Interceptor next = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor next = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      List<Interceptor> list = InterceptorChainFactory.asList(next);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(next);
         Iterator<Interceptor> interceptors = list.iterator();
   
         Assert.assertEquals(10, list.size());
  @@ -309,10 +309,10 @@
         cache.getConfiguration().setExposeManagementStatistics(false);
         cache.getConfiguration().setCacheMode("REPL_ASYNC");
   
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         Assert.assertEquals(7, list.size());
  @@ -331,10 +331,10 @@
         cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache(false);
         cache.getConfiguration().setExposeManagementStatistics(false);
         cache.getConfiguration().setCacheMode("INVALIDATION_ASYNC");
  -      chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
         // test the chain size.
  -      list = InterceptorChainFactory.asList(chain);
  +      list = InterceptorChainFactory.getInstance().asList(chain);
         interceptors = list.iterator();
   
         Assert.assertEquals(7, list.size());
  @@ -353,8 +353,8 @@
      public void testCacheMgmtConfig() throws Exception
      {
         cache.getConfiguration().setExposeManagementStatistics(true);
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testCacheMgmtConfig interceptors are:\n" + list);
  @@ -383,8 +383,8 @@
            }
         }
         );
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
  @@ -419,9 +419,9 @@
         cache.getConfiguration().setCacheMode("REPL_SYNC");
         cache.getConfiguration().setNodeLockingScheme("OPTIMISTIC");
         cache.create();// initialise various subsystems such as BRManager
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
  @@ -458,9 +458,9 @@
   
         cache.getConfiguration().setCacheMode("REPL_SYNC");
         cache.create();// initialise various subsystems such as BRManager
  -      Interceptor chain = new InterceptorChainFactory().buildInterceptorChain(cache);
  +      Interceptor chain = InterceptorChainFactory.getInstance().buildInterceptorChain(cache);
   
  -      List<Interceptor> list = InterceptorChainFactory.asList(chain);
  +      List<Interceptor> list = InterceptorChainFactory.getInstance().asList(chain);
         Iterator<Interceptor> interceptors = list.iterator();
   
         System.out.println("testEvictionInterceptorConfig interceptors are:\n" + list);
  
  
  



More information about the jboss-cvs-commits mailing list