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

Brian Stansberry brian.stansberry at jboss.com
Thu Jul 20 22:51:33 EDT 2006


  User: bstansberry
  Date: 06/07/20 22:51:33

  Modified:    tests/functional/org/jboss/cache   Tag:
                        Branch_JBossCache_1_4_0_MUX CallbackTest.java
                        FqnTest.java
  Log:
  Sync to JBossCache_1_4_0_GA
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.4.1   +1 -48     JBossCache/tests/functional/org/jboss/cache/CallbackTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CallbackTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/CallbackTest.java,v
  retrieving revision 1.7
  retrieving revision 1.7.4.1
  diff -u -b -r1.7 -r1.7.4.1
  --- CallbackTest.java	5 May 2006 12:06:59 -0000	1.7
  +++ CallbackTest.java	21 Jul 2006 02:51:33 -0000	1.7.4.1
  @@ -12,7 +12,7 @@
   /**
    * Tests whether modifications within callbacks (TreeCacheListener) are handled correctly
    * @author Bela Ban
  - * @version $Id: CallbackTest.java,v 1.7 2006/05/05 12:06:59 msurtani Exp $
  + * @version $Id: CallbackTest.java,v 1.7.4.1 2006/07/21 02:51:33 bstansberry Exp $
    */
   public class CallbackTest extends TestCase {
      TreeCache cache=null, cache2;
  @@ -113,53 +113,6 @@
         // PessimisticLockInterceptor, which registers for TX completion, we don't even get that far
      }
   
  -   /*public void testSyncReplicationWith2Caches() throws Exception, NotSupportedException {
  -      cache=createCache(TreeCache.REPL_SYNC, IsolationLevel.SERIALIZABLE);
  -      cache2=createCache(TreeCache.REPL_SYNC, IsolationLevel.SERIALIZABLE);
  -      cache.setSyncCommitPhase(true);
  -      cache2.setSyncCommitPhase(true);
  -
  -      // cache.setSyncReplTimeout(60000); // todo: remove again, just for debugging
  -      // cache2.setSyncReplTimeout(60000); // todo: remove again, just for debugging
  -
  -      assertEquals(2, cache.getMembers().size());
  -      System.out.println("view is correct: " + cache.getMembers() + " (2 members)");
  -      cache2.addTreeCacheListener(new PutListener(cache2));
  -
  -      tx=startTransaction();
  -      cache.put("/a", null);
  -      tx.commit();
  -
  -      // 1. cache: put("/a")
  -      // 2. tx.commit() in cache causes 2PC to cache2
  -      // 3. cache2 is updated with "/a"
  -      // 4. listener in cache2 is called, creates FQN
  -      // 5. cache2 replicates FQN over to cache as part of its own 2PC protocol
  -
  -      assertTrue(cache.exists("/a"));  // original modification to cache
  -      assertTrue(cache.exists(FQN));   // result of replication from cache
  -      assertTrue(cache2.exists("/a")); // result of replication from cache
  -      assertTrue(cache2.exists(FQN));  // created by listener, triggered by replication of "/a" from cache
  -      TransactionTable tx_table1, tx_table2;
  -      tx_table1=cache.getTransactionTable();
  -      tx_table2=cache2.getTransactionTable();
  -      System.out.println("tx_table1=" + tx_table1 + ", tx_table2=" + tx_table2);
  -      assertEquals(0, tx_table1.getNumLocalTransactions());
  -      assertEquals(0, tx_table2.getNumLocalTransactions());
  -      assertEquals(0, tx_table1.getNumGlobalTransactions());
  -      assertEquals(0, tx_table2.getNumGlobalTransactions());
  -   }*/
  -
  -
  -
  -/*   public static void main(String[] args) {
  -      try {
  -         new CallbackTest().testSyncReplicationWith2Caches();
  -      }
  -      catch(Exception e) {
  -         e.printStackTrace();
  -      }
  -   }*/
   
   
      TreeCache createCache(int mode, IsolationLevel level) throws Exception {
  
  
  
  1.9.4.1   +18 -1     JBossCache/tests/functional/org/jboss/cache/FqnTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FqnTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/FqnTest.java,v
  retrieving revision 1.9
  retrieving revision 1.9.4.1
  diff -u -b -r1.9 -r1.9.4.1
  --- FqnTest.java	25 Apr 2006 17:15:48 -0000	1.9
  +++ FqnTest.java	21 Jul 2006 02:51:33 -0000	1.9.4.1
  @@ -17,7 +17,7 @@
   /**
    * Tests {@link Fqn}.
    * @author <a href="mailto:bela at jboss.org">Bela Ban</a> May 9, 2003
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.9.4.1 $
    */
   public class FqnTest extends TestCase {
   
  @@ -272,6 +272,23 @@
           assertEquals(object.toString(), objectFqn.getName());
      }
   
  +   public void testRemovalNonString() throws Exception
  +   {
  +       Fqn f = new Fqn(new Object[] {"test", new Integer(1)});
  +       TreeCache tc = new TreeCache();
  +       tc.setCacheMode("LOCAL");
  +       tc.startService();
  +
  +       tc.put(f, "key",  "value");
  +       assertEquals("value", tc.get(f, "key"));
  +       assertTrue(tc.exists(f));
  +
  +       tc.remove(f);
  +
  +       assertNull(tc.get(f, "key"));
  +       assertFalse(tc.exists(f));
  +   }
  +
   
      Fqn marshalAndUnmarshal(Fqn fqn) throws Exception {
         byte[] buf=Util.objectToByteBuffer(fqn);
  
  
  



More information about the jboss-cvs-commits mailing list