[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/api ...
Manik Surtani
msurtani at jboss.com
Tue Oct 10 09:51:42 EDT 2006
User: msurtani
Date: 06/10/10 09:51:42
Modified: tests/functional/org/jboss/cache/api CacheAPITest.java
Log:
Updated behaviour of getRegion()
Revision Changes Path
1.3 +19 -3 JBossCache/tests/functional/org/jboss/cache/api/CacheAPITest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheAPITest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests/functional/org/jboss/cache/api/CacheAPITest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- CacheAPITest.java 9 Oct 2006 08:14:05 -0000 1.2
+++ CacheAPITest.java 10 Oct 2006 13:51:42 -0000 1.3
@@ -273,7 +273,7 @@
public void testRegion()
{
Region rootRegion = cache.getRegion(Fqn.ROOT, true);
- assertNotNull(rootRegion); // guaranteed never to return null. cache.getRegion() will create a new region if necessary.
+ assertNotNull(rootRegion); // guaranteed never to return null if createIfAbsent is true.
assertSame(rootRegion, cache.getRegion(Fqn.ROOT, true));
Region otherRegion = cache.getRegion(Fqn.fromString("/other/region"), true);
@@ -284,13 +284,29 @@
/**
* Again, see org.jboss.cache for more extensive tests on Regions. This just tests the getRegion API on cache.
*/
- public void testNullRegion()
+ public void testParentRegion()
{
Region rootRegion = cache.getRegion(Fqn.ROOT, true);
- assertNotNull(rootRegion); // guaranteed never to return null. cache.getRegion() will create a new region if necessary.
+ assertNotNull(rootRegion); // guaranteed never to return null if createIfAbsent is true.
assertSame(rootRegion, cache.getRegion(Fqn.ROOT, false));
Region otherRegion = cache.getRegion(Fqn.fromString("/other/region"), false);
+ // should return the same parent region as root.
+
+ assertSame(otherRegion, rootRegion);
+ }
+
+ /**
+ * Again, see org.jboss.cache for more extensive tests on Regions. This just tests the getRegion API on cache.
+ */
+ public void testNullRegion()
+ {
+ Region myRegion = cache.getRegion(Fqn.fromString("/myregion"), true);
+ assertNotNull(myRegion); // guaranteed never to return null if createIfAbsent is true.
+ assertSame(myRegion, cache.getRegion(Fqn.fromString("/myregion"), false));
+
+ Region otherRegion = cache.getRegion(Fqn.fromString("/other/region"), false);
+ // should return null since createIfAbsent is null and none of the parents have defined regions
assertNull(otherRegion);
}
More information about the jboss-cvs-commits
mailing list