[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo/region ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 12:49:59 EST 2006
User: msurtani
Date: 06/12/30 12:49:59
Modified: tests-50/functional/org/jboss/cache/pojo/region
LocalTest.java NewLocalTest.java
Log:
Major changes to restructure cache and node object model
Revision Changes Path
1.7 +20 -16 JBossCache/tests-50/functional/org/jboss/cache/pojo/region/LocalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LocalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/region/LocalTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- LocalTest.java 31 Oct 2006 11:07:18 -0000 1.6
+++ LocalTest.java 30 Dec 2006 17:49:59 -0000 1.7
@@ -7,25 +7,28 @@
package org.jboss.cache.pojo.region;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.pojo.*;
-import org.jboss.cache.pojo.test.Person;
-import org.jboss.cache.pojo.test.Address;
-import org.jboss.cache.pojo.test.Student;
+import org.jboss.aop.proxy.ClassProxy;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.aop.proxy.ClassProxy;
+import org.jboss.cache.pojo.InternalConstant;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.test.Address;
+import org.jboss.cache.pojo.test.Person;
+import org.jboss.cache.pojo.test.Student;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
import java.util.Set;
-import java.util.HashSet;
/**
* Basic PojoCache test case.
@@ -98,10 +101,10 @@
assertEquals((Object) "Joe Black", p.getName());
assertTrue("Region node should exist ",
- cache_.getCache().hasChild(new Fqn(REGION)));
+ cache_.getCache().getRoot().hasChild(new Fqn(REGION)));
Fqn fqn = new Fqn(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
assertTrue("Internal region node should exist ",
- cache_.getCache().hasChild(fqn));
+ cache_.getCache().getRoot().hasChild(fqn));
}
public void testModification() throws Exception
@@ -117,11 +120,11 @@
Person joe = createPerson("person/test3", "Joe", 32);
cache_.detach("person/test3");
- String str = ((org.jboss.cache.TreeCacheProxyImpl)cache_.getCache()).printDetails();
- System.out.println("**** Details ***/n" +str);
+ String str = ((CacheImpl) cache_.getCache()).printDetails();
+ System.out.println("**** Details ***/n" + str);
Fqn fqn = new Fqn(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
- Node n = cache_.getCache().getChild(fqn);
+ Node n = cache_.getCache().getRoot().getChild(fqn);
assertTrue("Internal region node should not exist ",
n.getChildren().size() == 0);
}
@@ -137,7 +140,8 @@
person.setAge(60);
med = person.getMedication();
assertEquals("Medication ", (Object) "Lipitor", (Object) med.get(0));
- } catch (Exception e)
+ }
+ catch (Exception e)
{
// should be thrown
}
@@ -195,7 +199,7 @@
cache_.detach("person/test1");
Fqn fqn = new Fqn(Fqn.fromString(REGION), InternalConstant.JBOSS_INTERNAL);
- Node n = cache_.getCache().getChild(fqn);
+ Node n = cache_.getCache().getRoot().getChild(fqn);
assertTrue("Internal region node should not exist ",
n.getChildren().size() == 0);
1.6 +11 -6 JBossCache/tests-50/functional/org/jboss/cache/pojo/region/NewLocalTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NewLocalTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/region/NewLocalTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- NewLocalTest.java 31 Oct 2006 11:07:18 -0000 1.5
+++ NewLocalTest.java 30 Dec 2006 17:49:59 -0000 1.6
@@ -7,14 +7,16 @@
package org.jboss.cache.pojo.region;
-import junit.framework.TestCase;
import junit.framework.Test;
+import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.pojo.*;
-import org.jboss.cache.pojo.test.Person;
import org.jboss.cache.Fqn;
+import org.jboss.cache.pojo.InternalConstant;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.test.Person;
import java.util.Map;
@@ -55,6 +57,7 @@
/**
* Not applied anymore.
+ *
* @throws Exception
*/
public void XtestBadFqn() throws Exception
@@ -72,7 +75,8 @@
{
cache_.attach(InternalConstant.JBOSS_INTERNAL_STRING, test);
fail("putObject under JBoss_Internal should fail");
- } catch (IllegalArgumentException iex)
+ }
+ catch (IllegalArgumentException iex)
{
// ok
}
@@ -81,7 +85,8 @@
{
cache_.detach(InternalConstant.JBOSS_INTERNAL_STRING);
fail("putObject under JBoss_Internal should fail");
- } catch (IllegalArgumentException iex)
+ }
+ catch (IllegalArgumentException iex)
{
// ok
}
@@ -116,7 +121,7 @@
assertNull("Object should be null ", cache_.find("person"));
assertEquals("Age should be updated as ", 20, test.getAge());
- assertNull("DataNode should not exisit ", cache_.getCache().get("person"));
+ assertNull("DataNode should not exisit ", cache_.getCache().getRoot().get("person"));
}
public void testFindObjects() throws Exception
More information about the jboss-cvs-commits
mailing list