cleaned up exception handling in the serialization test code
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6200e1369f
commit
6faef5d8f0
|
@ -68,7 +68,7 @@ import junit.textui.TestRunner;
|
|||
* Tests the org.apache.commons.lang.exception.NestableException class.
|
||||
*
|
||||
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
|
||||
* @version $Id: NestableExceptionTestCase.java,v 1.6 2002/10/09 05:28:53 sullis Exp $
|
||||
* @version $Id: NestableExceptionTestCase.java,v 1.7 2002/10/09 17:20:44 sullis Exp $
|
||||
*/
|
||||
public class NestableExceptionTestCase extends AbstractNestableTestCase
|
||||
{
|
||||
|
@ -247,6 +247,7 @@ public class NestableExceptionTestCase extends AbstractNestableTestCase
|
|||
}
|
||||
|
||||
public void testSerialization()
|
||||
throws java.io.IOException, ClassNotFoundException
|
||||
{
|
||||
RuntimeException nestedEx = new RuntimeException("nested exception message");
|
||||
NestableExceptionTester1 ex = new NestableExceptionTester1("serialization test", nestedEx);
|
||||
|
@ -259,9 +260,9 @@ public class NestableExceptionTestCase extends AbstractNestableTestCase
|
|||
ByteArrayInputStream bais = null;
|
||||
ObjectOutputStream oos = null;
|
||||
ObjectInputStream ois = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
oos = new ObjectOutputStream(baos);
|
||||
oos.writeObject(ex);
|
||||
oos.flush();
|
||||
|
@ -286,11 +287,6 @@ public class NestableExceptionTestCase extends AbstractNestableTestCase
|
|||
deserializedThrowable.getMessage());
|
||||
}
|
||||
}
|
||||
catch (Exception caughtEx)
|
||||
{
|
||||
fail("an unexpected exception occurred: "
|
||||
+ caughtEx.toString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (null != oos)
|
||||
|
|
Loading…
Reference in New Issue