You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2007/10/29 17:58:58 UTC
svn commit: r589741 -
/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java
Author: odeakin
Date: Mon Oct 29 09:58:57 2007
New Revision: 589741
URL: http://svn.apache.org/viewvc?rev=589741&view=rev
Log:
Let JUnit deal with unexpected Exceptions rather than catching them ourselves - rmi module.
Modified:
harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java
Modified: harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java?rev=589741&r1=589740&r2=589741&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/MarshalledObjectTest.java Mon Oct 29 09:58:57 2007
@@ -106,33 +106,25 @@
Object obj = null;
// 1-st get: thread context classloader is equal to system classloader
- try {
- obj = mo.get();
+ obj = mo.get();
- if (obj.getClass().getClassLoader() != old_cl) {
- fail("1-st get failed: loaded through: "
- + obj.getClass().getClassLoader() + ", expected: " + old_cl);
+ if (obj.getClass().getClassLoader() != old_cl) {
+ fail("1-st get failed: loaded through: "
+ + obj.getClass().getClassLoader() + ", expected: " + old_cl);
} else {
System.out.println("1-st get passed.");
}
- } catch (Exception ex) {
- fail("1-st get failed: " + ex);
- }
// 2-nd get: thread context classloader is equal to null
Thread.currentThread().setContextClassLoader(null);
- try {
- obj = mo.get();
+ obj = mo.get();
- if (obj.getClass().getClassLoader() != old_cl) {
- fail("2-nd get failed: loaded through: "
- + obj.getClass().getClassLoader() + ", expected: " + old_cl);
- } else {
- System.out.println("2-nd get passed.");
- }
- } catch (Exception ex) {
- fail("2-nd get failed: " + ex);
+ if (obj.getClass().getClassLoader() != old_cl) {
+ fail("2-nd get failed: loaded through: "
+ + obj.getClass().getClassLoader() + ", expected: " + old_cl);
+ } else {
+ System.out.println("2-nd get passed.");
}
} finally {
// restore thread context classloader