db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r724544 - /db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java
Date Mon, 08 Dec 2008 23:05:43 GMT
Author: clr
Date: Mon Dec  8 15:05:42 2008
New Revision: 724544

URL: http://svn.apache.org/viewvc?rev=724544&view=rev
Log:
Fix java 5 warningstest/java/javax/jdo/identity/ObjectIdentityTest.java

Modified:
    db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java

Modified: db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java?rev=724544&r1=724543&r2=724544&view=diff
==============================================================================
--- db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java (original)
+++ db/jdo/trunk/api2/test/java/javax/jdo/identity/ObjectIdentityTest.java Mon Dec  8 15:05:42
2008
@@ -397,12 +397,15 @@
         assertEquals("keyAsObject doesn't match.", c1.getKeyAsObject(), new IdClass(1));
     }
 
-    private void validateNestedException(JDOUserException ex, Class expected) {
+    private <T> void validateNestedException(JDOUserException ex, Class<T> expected)
{
         Throwable[] nesteds = ex.getNestedExceptions();
-        if (nesteds == null || nesteds.length == 0) {
+        if (nesteds == null || nesteds.length != 1) {
             fail ("Nested exception is null or length 0");
         }
         Throwable nested = nesteds[0];
+        if (nested != ex.getCause()) {
+            fail ("Nested exception is not == getCause()");
+        }
         if (!(expected.isAssignableFrom(nested.getClass()))) {
             fail ("Wrong nested exception. Expected ClassNotFoundException, got "
                     + nested.toString());



Mime
View raw message