01: package com.mockrunner.test;
02:
03: import junit.framework.TestCase;
04:
05: import com.mockrunner.base.NestedApplicationException;
06:
07: public class NestedApplicationExceptionTest extends TestCase {
08: private NestedApplicationException nested;
09: private Exception exception;
10:
11: protected void setUp() throws Exception {
12: super .setUp();
13: exception = new Exception("TestException");
14: nested = new NestedApplicationException(
15: new NestedApplicationException(exception));
16: }
17:
18: public void testGetNested() {
19: assertNotSame(exception, nested.getNested());
20: assertTrue(nested.getNested() instanceof NestedApplicationException);
21: }
22:
23: public void testGetRootCause() {
24: assertSame(exception, nested.getRootCause());
25: }
26:
27: public void testGetMessage() {
28: assertTrue(nested.getMessage().indexOf("TestException") != -1);
29: }
30: }
|