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

Manik Surtani msurtani at jboss.com
Thu Jul 20 06:31:45 EDT 2006


  User: msurtani
  Date: 06/07/20 06:31:45

  Modified:    tests/functional/org/jboss/cache/optimistic      
                        NodeInterceptorKeyValTest.java
                        NodeInterceptorRemoveNodeTest.java
                        NodeInterceptorTransactionTest.java
                        ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
                        TxInterceptorTest.java
                        ValidatorInterceptorTest.java
  Log:
  Fixed some broken UTs to use the new xml parsers, cache factories, etc.
  
  Revision  Changes    Path
  1.8       +27 -27    JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeInterceptorKeyValTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorKeyValTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- NodeInterceptorKeyValTest.java	26 Jan 2006 20:36:29 -0000	1.7
  +++ NodeInterceptorKeyValTest.java	20 Jul 2006 10:31:45 -0000	1.8
  @@ -31,11 +31,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -48,8 +48,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
   
  @@ -84,11 +84,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -101,8 +101,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
   
  @@ -141,11 +141,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -158,8 +158,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
   
  @@ -197,11 +197,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -214,8 +214,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
   
  @@ -255,11 +255,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -272,8 +272,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
   
  @@ -285,8 +285,8 @@
           //start a new transaction
           mgr.begin();
           Transaction tx2 = mgr.getTransaction();
  -        cache.getInvocationContext().setTransaction(tx2);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx2));
  +        InvocationContext.getCurrent().setTransaction(tx2);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx2));
   
           SamplePojo pojo2 = new SamplePojo(21, "test");
   
  
  
  
  1.9       +35 -35    JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeInterceptorRemoveNodeTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- NodeInterceptorRemoveNodeTest.java	21 Feb 2006 22:52:40 -0000	1.8
  +++ NodeInterceptorRemoveNodeTest.java	20 Jul 2006 10:31:45 -0000	1.9
  @@ -40,11 +40,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -57,8 +57,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
   
           cache.remove("/one/two");
  @@ -91,11 +91,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -108,8 +108,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -152,11 +152,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -169,8 +169,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -213,11 +213,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -230,8 +230,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -297,11 +297,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -314,8 +314,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -383,11 +383,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -400,8 +400,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -470,11 +470,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -487,8 +487,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  
  
  
  1.6       +6 -6      JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeInterceptorTransactionTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/NodeInterceptorTransactionTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- NodeInterceptorTransactionTest.java	14 Dec 2005 15:40:24 -0000	1.5
  +++ NodeInterceptorTransactionTest.java	20 Jul 2006 10:31:45 -0000	1.6
  @@ -33,11 +33,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -65,11 +65,11 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  
  
  
  1.12      +8 -8      JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ThreadedOptimisticCreateIfNotExistsInterceptorTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/ThreadedOptimisticCreateIfNotExistsInterceptorTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ThreadedOptimisticCreateIfNotExistsInterceptorTest.java	5 May 2006 12:06:58 -0000	1.11
  +++ ThreadedOptimisticCreateIfNotExistsInterceptorTest.java	20 Jul 2006 10:31:45 -0000	1.12
  @@ -37,14 +37,14 @@
   
       protected void setTransactionsInInvocationCtx(TransactionManager mgr, TreeCache cache) throws Exception
       {
  -        cache.getInvocationContext().setTransaction(mgr.getTransaction());
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction());
  +        InvocationContext.getCurrent().setTransaction(mgr.getTransaction());
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction());
       }
   
       protected void resetInvocationCtx(TreeCache cache)
       {
  -        cache.getInvocationContext().setTransaction(null);
  -        cache.getInvocationContext().setGlobalTransaction(null);
  +        InvocationContext.getCurrent().setTransaction(null);
  +        InvocationContext.getCurrent().setGlobalTransaction(null);
       }
   
       public void testDifferentTransactions() throws Exception
  @@ -57,9 +57,9 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           interceptor.setNext(dummy);
   
           cache.setInterceptorChain(interceptor);
  @@ -122,9 +122,9 @@
           final TreeCache cache = createCacheWithListener(listener);
   
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           interceptor.setNext(dummy);
   
           cache.setInterceptorChain(interceptor);
  
  
  
  1.12      +60 -60    JBossCache/tests/functional/org/jboss/cache/optimistic/TxInterceptorTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TxInterceptorTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/TxInterceptorTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- TxInterceptorTest.java	16 May 2006 22:42:26 -0000	1.11
  +++ TxInterceptorTest.java	20 Jul 2006 10:31:45 -0000	1.12
  @@ -47,13 +47,13 @@
           TreeCache cache = createCache();
   
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -87,13 +87,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -135,13 +135,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -178,13 +178,13 @@
       {
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -218,13 +218,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -258,13 +258,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -313,13 +313,13 @@
       {
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -362,13 +362,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -478,13 +478,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  @@ -607,15 +607,15 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
  -        replicationInterceptor.setCache(cache);
  +        replicationInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(replicationInterceptor);
           replicationInterceptor.setNext(createInterceptor);
  @@ -746,15 +746,15 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
  -        replicationInterceptor.setCache(cache);
  +        replicationInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(replicationInterceptor);
           replicationInterceptor.setNext(createInterceptor);
  @@ -884,15 +884,15 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
  -        replicationInterceptor.setCache(cache);
  +        replicationInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(replicationInterceptor);
           replicationInterceptor.setNext(createInterceptor);
  @@ -1026,15 +1026,15 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor replicationInterceptor = new OptimisticReplicationInterceptor();
  -        replicationInterceptor.setCache(cache);
  +        replicationInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(replicationInterceptor);
           replicationInterceptor.setNext(createInterceptor);
  @@ -1163,13 +1163,13 @@
   
           TreeCache cache = createCache();
           Interceptor txInterceptor = new TxInterceptor();
  -        txInterceptor.setCache(cache);
  +        txInterceptor.setCache(cache.getSPI());
           Interceptor createInterceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        createInterceptor.setCache(cache);
  +        createInterceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
   
           txInterceptor.setNext(createInterceptor);
           createInterceptor.setNext(nodeInterceptor);
  
  
  
  1.12      +30 -30    JBossCache/tests/functional/org/jboss/cache/optimistic/ValidatorInterceptorTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ValidatorInterceptorTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/optimistic/ValidatorInterceptorTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ValidatorInterceptorTest.java	16 May 2006 22:42:27 -0000	1.11
  +++ ValidatorInterceptorTest.java	20 Jul 2006 10:31:45 -0000	1.12
  @@ -41,13 +41,13 @@
           TreeCache cache = createCacheWithListener();
   
           Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
  -        validateInterceptor.setCache(cache);
  +        validateInterceptor.setCache(cache.getSPI());
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           validateInterceptor.setNext(interceptor);
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -60,8 +60,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -124,13 +124,13 @@
           TreeCache cache = createCacheWithListener();
   
           Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
  -        validateInterceptor.setCache(cache);
  +        validateInterceptor.setCache(cache.getSPI());
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           validateInterceptor.setNext(interceptor);
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -143,8 +143,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -200,13 +200,13 @@
           TreeCache cache = createCacheWithListener();
   
           Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
  -        validateInterceptor.setCache(cache);
  +        validateInterceptor.setCache(cache.getSPI());
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           validateInterceptor.setNext(interceptor);
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -219,8 +219,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -311,13 +311,13 @@
           TreeCache cache = createCacheWithListener();
   
           Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
  -        validateInterceptor.setCache(cache);
  +        validateInterceptor.setCache(cache.getSPI());
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           validateInterceptor.setNext(interceptor);
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -330,8 +330,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  @@ -416,13 +416,13 @@
   
           TreeCache cache = createCacheWithListener();
           Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
  -        validateInterceptor.setCache(cache);
  +        validateInterceptor.setCache(cache.getSPI());
           Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
  -        interceptor.setCache(cache);
  +        interceptor.setCache(cache.getSPI());
           Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
  -        nodeInterceptor.setCache(cache);
  +        nodeInterceptor.setCache(cache.getSPI());
           MockInterceptor dummy = new MockInterceptor();
  -        dummy.setCache(cache);
  +        dummy.setCache(cache.getSPI());
           validateInterceptor.setNext(interceptor);
           interceptor.setNext(nodeInterceptor);
           nodeInterceptor.setNext(dummy);
  @@ -435,8 +435,8 @@
           Transaction tx = mgr.getTransaction();
   
           // inject InvocationContext
  -        cache.getInvocationContext().setTransaction(tx);
  -        cache.getInvocationContext().setGlobalTransaction(cache.getCurrentTransaction(tx));
  +        InvocationContext.getCurrent().setTransaction(tx);
  +        InvocationContext.getCurrent().setGlobalTransaction(cache.getCurrentTransaction(tx));
   
           SamplePojo pojo = new SamplePojo(21, "test");
           Map temp = new HashMap();
  
  
  



More information about the jboss-cvs-commits mailing list