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

Manik Surtani msurtani at jboss.com
Sat Dec 30 22:01:20 EST 2006


  User: msurtani
  Date: 06/12/30 22:01:20

  Modified:    tests/functional/org/jboss/cache/api   
                        NodeReplicatedMoveTest.java SyncReplTest.java
                        NodeMoveAPITest.java
  Log:
  move api still WIP
  
  Revision  Changes    Path
  1.7       +5 -5      JBossCache/tests/functional/org/jboss/cache/api/NodeReplicatedMoveTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeReplicatedMoveTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/NodeReplicatedMoveTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- NodeReplicatedMoveTest.java	30 Dec 2006 17:49:53 -0000	1.6
  +++ NodeReplicatedMoveTest.java	31 Dec 2006 03:01:20 -0000	1.7
  @@ -69,7 +69,7 @@
         assertEquals(vB, cache[1].getRoot().getChild(A).getChild(B).get(k));
   
         // now move...
  -      nodeB.move(rootNode);
  +      cache[0].move(nodeB.getFqn(), Fqn.ROOT);
   
         assertEquals(vA, cache[0].getRoot().getChild(A).get(k));
         assertEquals(vB, cache[0].getRoot().getChild(B).get(k));
  @@ -100,7 +100,7 @@
         assertNull(cache[1].getRoot().getChild(B));
   
         // now move...
  -      nodeB.move(rootNode);
  +      cache[0].move(nodeB.getFqn(), Fqn.ROOT);
   
         assertEquals(vA, cache[0].getRoot().getChild(A).get(k));
         assertEquals(vB, cache[0].getRoot().getChild(B).get(k));
  @@ -113,7 +113,7 @@
   
         try
         {
  -         cache[0].getRoot().getChild(B).move(cache[0].getRoot().getChild(A)); // should throw an NPE
  +         cache[0].move(cache[0].getRoot().getChild(B).getFqn(), cache[0].getRoot().getChild(A).getFqn()); // should throw an NPE
            fail("Expecting an exception");
         }
         catch (Exception e)
  @@ -138,7 +138,7 @@
   
         // now move...
         tm.begin();
  -      nodeB.move(rootNode);
  +      cache[0].move(nodeB.getFqn(), Fqn.ROOT);
   
         assertEquals(vA, cache[0].getRoot().getChild(A).get(k));
         assertEquals(vB, cache[0].getRoot().getChild(B).get(k));
  @@ -167,7 +167,7 @@
   
         // now move...
         tm.begin();
  -      nodeB.move(rootNode);
  +      cache[0].move(nodeB.getFqn(), Fqn.ROOT);
   
         assertEquals(vA, cache[0].getRoot().getChild(A).get(k));
         assertEquals(vB, cache[0].getRoot().getChild(B).get(k));
  
  
  
  1.7       +2 -2      JBossCache/tests/functional/org/jboss/cache/api/SyncReplTest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SyncReplTest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/SyncReplTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- SyncReplTest.java	30 Dec 2006 17:49:53 -0000	1.6
  +++ SyncReplTest.java	31 Dec 2006 03:01:20 -0000	1.7
  @@ -140,7 +140,7 @@
   
      private void assertInvocationContextInitState(Cache c)
      {
  -      InvocationContext ctx = ((CacheSPI) c).getInvocationContext();
  +      InvocationContext ctx = c.getInvocationContext();
         InvocationContext control = null;
         try
         {
  @@ -148,7 +148,7 @@
         }
         catch (CloneNotSupportedException e)
         {
  -         fail("Unable to clone InvocationCOntext");
  +         fail("Unable to clone InvocationContext");
         }
   
         control.reset();
  
  
  
  1.16      +10 -9     JBossCache/tests/functional/org/jboss/cache/api/NodeMoveAPITest.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeMoveAPITest.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/NodeMoveAPITest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- NodeMoveAPITest.java	30 Dec 2006 17:49:53 -0000	1.15
  +++ NodeMoveAPITest.java	31 Dec 2006 03:01:20 -0000	1.16
  @@ -77,7 +77,7 @@
   
         log.info("BEFORE MOVE " + cache);
         // move
  -      nodeC.move(nodeB);
  +      cache.move(nodeC.getFqn(), nodeB.getFqn());
         log.info("POST MOVE " + cache);
         log.info("HC " + nodeC + " " + System.identityHashCode(nodeC));
         Node x = cache.getRoot().getChild(Fqn.fromString("b/c"));
  @@ -139,7 +139,7 @@
   
         // move
         log.info("move " + nodeC + " to " + nodeB);
  -      nodeC.move(nodeB);
  +      cache.move(nodeC.getFqn(), nodeB.getFqn());
         //System.out.println("nodeB " + nodeB);
         //System.out.println("nodeC " + nodeC);      
   
  @@ -184,7 +184,7 @@
   
         tm.begin();
         // move node B up to hang off the root
  -      nodeB.move(rootNode);
  +      cache.move(nodeB.getFqn(), Fqn.ROOT);
   
         tm.commit();
   
  @@ -212,7 +212,7 @@
   
         tm.begin();
         // move node B up to hang off the root
  -      nodeB.move(rootNode);
  +      cache.move(nodeB.getFqn(), Fqn.ROOT);
   
         // need to think of a way to test the same with optimistically locked nodes
         if (!optimistic)
  @@ -317,7 +317,7 @@
   
         // move
         if (useTx) tm.begin();
  -      nodeC.move(nodeB);
  +      cache.move(nodeC.getFqn(), nodeB.getFqn());
         if (useTx) tm.commit();
   
         log.info("Post commit tree is " + cache.printDetails());
  @@ -386,7 +386,7 @@
         assertEquals(0, cache.getNumberOfLocksHeld());
         tm.begin();
   
  -      nodeB.move(nodeC);
  +      cache.move(nodeC.getFqn(), nodeB.getFqn());
   //       nodeC should have a RL, nodeA should have a RL, nodeB should have a WL, nodeD should have a WL
   
         System.out.println("LOCKS: " + cache.printLockInfo());
  @@ -407,7 +407,8 @@
         assertEquals(0, cache.getNumberOfLocksHeld());
         tm.begin();
   
  -      nodeB.move(nodeC);
  +      cache.move(nodeC.getFqn(), nodeB.getFqn());
  +
   //       nodeC should have a RL, nodeA should have a RL, nodeB should have a WL
   
         System.out.println("LOCKS: " + cache.printLockInfo());
  @@ -474,7 +475,7 @@
                     System.out.println(getName() + ": Attempt " + counter);
                     try
                     {
  -                     NODE_X.move(NODES[r.nextInt(NODES.length)]);
  +                     cache.move(NODE_X.getFqn(), NODES[r.nextInt(NODES.length)].getFqn());
                     }
                     catch (NodeNotExistsException e)
                     {
  @@ -483,7 +484,7 @@
                     TestingUtil.sleepRandom(250);
                     try
                     {
  -                     NODE_Y.move(NODES[r.nextInt(NODES.length)]);
  +                     cache.move(NODE_Y.getFqn(), NODES[r.nextInt(NODES.length)].getFqn());
                     }
                     catch (NodeNotExistsException e)
                     {
  
  
  



More information about the jboss-cvs-commits mailing list