[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/api ...
Manik Surtani
manik at jboss.org
Tue Jul 17 10:10:22 EDT 2007
User: msurtani
Date: 07/07/17 10:10:22
Modified: tests/functional/org/jboss/cache/api NodeAPITest.java
Log:
JBCACHE-1136
Revision Changes Path
1.17 +23 -0 JBossCache/tests/functional/org/jboss/cache/api/NodeAPITest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeAPITest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/NodeAPITest.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- NodeAPITest.java 26 Apr 2007 12:03:07 -0000 1.16
+++ NodeAPITest.java 17 Jul 2007 14:10:22 -0000 1.17
@@ -9,7 +9,9 @@
import javax.transaction.TransactionManager;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
/**
* Tests {@link org.jboss.cache.Node}-centric operations
@@ -264,4 +266,25 @@
assertEquals("v5", rootNode.get("k5"));
}
+ public void testGetChildrenNames() throws Exception
+ {
+ rootNode.addChild(A).put("k", "v");
+ rootNode.addChild(B).put("k", "v");
+
+ Set childrenNames = new HashSet();
+ childrenNames.add(A.getLastElement());
+ childrenNames.add(B.getLastElement());
+
+ assertEquals(childrenNames, rootNode.getChildrenNames());
+
+ // now delete a child, within a tx
+ tm.begin();
+ rootNode.removeChild(B);
+ assertFalse(rootNode.hasChild(B));
+ childrenNames.remove(B.getLastElement());
+ assertEquals(childrenNames, rootNode.getChildrenNames());
+ tm.commit();
+ assertEquals(childrenNames, rootNode.getChildrenNames());
+ }
+
}
More information about the jboss-cvs-commits
mailing list