From 6faef5d8f00af8a6b54a24fec5cf2620f0a66fa4 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Wed, 9 Oct 2002 17:20:44 +0000 Subject: [PATCH] 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 --- .../lang/exception/NestableExceptionTestCase.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java b/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java index 2db6f181e..449ca9495 100644 --- a/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java +++ b/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java @@ -68,7 +68,7 @@ * Tests the org.apache.commons.lang.exception.NestableException class. * * @author Steven Caswell - * @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 getThrowableClass() } 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 void testSerialization() ByteArrayInputStream bais = null; ObjectOutputStream oos = null; ObjectInputStream ois = null; - + try - { + { oos = new ObjectOutputStream(baos); oos.writeObject(ex); oos.flush(); @@ -286,11 +287,6 @@ public void testSerialization() deserializedThrowable.getMessage()); } } - catch (Exception caughtEx) - { - fail("an unexpected exception occurred: " - + caughtEx.toString()); - } finally { if (null != oos)