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

Elias Ross genman at noderunner.net
Tue Nov 28 23:16:13 EST 2006


  User: genman  
  Date: 06/11/28 23:16:13

  Modified:    tests/functional/org/jboss/cache/api  NodeMoveAPITest.java
  Log:
  JBCACHE-867 - test was wrong (I think I messed it up originally)
  
  Revision  Changes    Path
  1.13      +33 -11    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.12
  retrieving revision 1.13
  diff -u -b -r1.12 -r1.13
  --- NodeMoveAPITest.java	20 Nov 2006 03:53:56 -0000	1.12
  +++ NodeMoveAPITest.java	29 Nov 2006 04:16:13 -0000	1.13
  @@ -61,6 +61,10 @@
         nodeB.put(k, vB);
         nodeC = nodeA.addChild(C);
         nodeC.put(k, vC);
  +      /*
  +         /a/c
  +         /b
  +       */
   
         assertTrue(rootNode.hasChild(A));
         assertTrue(rootNode.hasChild(B));
  @@ -75,9 +79,18 @@
         // parentage
         assertEquals(nodeA, nodeC.getParent());
   
  +      log.info("BEFORE MOVE " + cache);
         // move
         nodeC.move(nodeB);
  -      assertEquals("/a/b/c", nodeC.getFqn().toString());
  +      log.info("POST MOVE " + cache);
  +      log.info("HC " + nodeC + " " + System.identityHashCode(nodeC));
  +      Node x = cache.getChild(Fqn.fromString("b/c"));
  +      log.info("HC " + x + " " + System.identityHashCode(x));    
  +      /*
  +         /a
  +         /b/c
  +      */
  +      assertEquals("NODE C " + nodeC, "/b/c", nodeC.getFqn().toString());
   
         assertTrue(rootNode.hasChild(A));
         assertTrue(rootNode.hasChild(B));
  @@ -129,6 +142,7 @@
         assertEquals(nodeD, nodeE.getParent());
   
         // move
  +      log.info("move " + nodeC + " to " + nodeB);
         nodeC.move(nodeB);
         //System.out.println("nodeB " + nodeB);
         //System.out.println("nodeC " + nodeC);      
  @@ -269,6 +283,12 @@
         nodeD.put(k, vD);
         nodeE = nodeD.addChild(E);
         nodeE.put(k, vE);
  +      /*
  +      Node nodeF = nodeE.addChild(Fqn.fromString("F"));
  +      nodeF.put(k, vE);
  +      Node nodeG = nodeF.addChild(Fqn.fromString("G"));
  +      nodeG.put(k, vE);
  +      */
   
         assertTrue(rootNode.hasChild(A));
         assertTrue(rootNode.hasChild(B));
  @@ -293,34 +313,36 @@
   
         System.out.println("Loader" + loader);
   
  -      System.out.println("Current tree is " + treeCache.printLockInfo());
  +      log.info("Current tree is " + treeCache.printLockInfo());
   
         cache.evict(Fqn.ROOT, true);
   
  -      System.out.println("Current tree is " + treeCache.printLockInfo());
  +      log.info("POST EVICT tree is " + treeCache.printLockInfo());
   
         // move
         if (useTx) tm.begin();
         nodeC.move(nodeB);
  -      System.out.println(" XXXXXXXX " + nodeB);
  -      System.out.println(" XXXXXXXX ");
         if (useTx) tm.commit();
   
  +      log.info("Post commit tree is " + treeCache.printDetails());
  +
         // after eviction, the node objects we hold are probably stale.
         nodeA = rootNode.getChild(A);
         nodeB = rootNode.getChild(B);
         nodeC = nodeB.getChild(C);
  +      log.info("Current tree is " + treeCache.printDetails());
  +      log.info("nodeC get child B ");      
         nodeD = nodeC.getChild(D);
  +      log.info("Current tree is " + treeCache.printDetails());      
  +      log.info("nodeD get child E ");
         nodeE = nodeD.getChild(E);
   
  -
  -      System.out.println("Current tree is " + treeCache.printLockInfo());
  +      log.info("Current tree is " + treeCache.printDetails());
   
         Fqn old_C = new Fqn(C);
         Fqn old_D = new Fqn(old_C, D);
         Fqn old_E = new Fqn(old_D, E);
   
  -
         assertTrue(rootNode.hasChild(A));
         assertTrue(rootNode.hasChild(B));
         assertFalse(rootNode.hasChild(C));
  
  
  



More information about the jboss-cvs-commits mailing list