[jboss-cvs] JBossCache/tests-50/functional/org/jboss/cache/pojo/collection ...
Ben Wang
bwang at jboss.com
Wed Jan 3 10:55:18 EST 2007
User: bwang
Date: 07/01/03 10:55:18
Modified: tests-50/functional/org/jboss/cache/pojo/collection
CachedMapTest.java
Log:
upd
Revision Changes Path
1.7 +8 -7 JBossCache/tests-50/functional/org/jboss/cache/pojo/collection/CachedMapTest.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CachedMapTest.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/tests-50/functional/org/jboss/cache/pojo/collection/CachedMapTest.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- CachedMapTest.java 30 Dec 2006 19:48:48 -0000 1.6
+++ CachedMapTest.java 3 Jan 2007 15:55:18 -0000 1.7
@@ -8,6 +8,7 @@
import org.jboss.aop.proxy.ClassProxy;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.pojo.PojoCacheException;
import org.jboss.cache.pojo.test.Address;
import java.io.Serializable;
@@ -339,12 +340,12 @@
cache_.attach("/keytest", map); // this should throw RuntimeException with cause of java.io.NotSerializableException
fail("failed to get expected runtimeException when adding nonserializable key to pojocache map");
}
- catch (RuntimeException e)
+ catch (PojoCacheException e)
{
Throwable t = e;
- while ((t.getCause() instanceof RuntimeException)) // get through wrapped runtimeexceptions
- t = t.getCause();
- assertTrue("we got expected RuntimeException, test that cause is java.io.NotSerializableException, t.getCause()= " + t.getCause().getClass().getName(), t.getCause() instanceof java.io.NotSerializableException);
+
+ assertTrue("we got expected PojoCacheException "
+ + t.getCause().getClass().getName(), t.getCause() instanceof PojoCacheException);
}
map.clear();
cache_.attach("/keytest", map); // this should succeed
@@ -359,9 +360,9 @@
catch (RuntimeException e)
{
Throwable t = e;
- while ((t.getCause() instanceof RuntimeException)) // get through wrapped runtimeexceptions
- t = t.getCause();
- assertTrue("we got expected RuntimeException, test that cause is java.io.NotSerializableException, t.getCause()= " + t.getCause().getClass().getName(), t.getCause() instanceof java.io.NotSerializableException);
+
+ assertTrue("we got expected PojoCacheException "
+ + t.getClass().getName(), t instanceof PojoCacheException);
}
}
More information about the jboss-cvs-commits
mailing list