package com.waldura.util; /** * The test case for the {@link ChainingException ChainingException} class. * * @see ChainingException */ public class ChainingExceptionTest extends junit.framework.TestCase { /** * Dummy exception class used for testing. */ private static class TestException extends ChainingException { public TestException() {} public TestException(String s) { super(s); } public TestException(Exception e) { super(e); } public TestException(String s, Exception e) { super(s, e); } } public ChainingExceptionTest(String testName) { super(testName); } public void testSimple() { TestException e = new TestException("test 1"); System.out.println( "\nmessage = " + e.getMessage() ); System.out.println( "string = " + e.toString() ); System.out.println( "stacktrace = " + e.getChainedStackTrace() ); } public void testDouble() { TestException e = new TestException("test 2", new Exception("test 22")); System.out.println( "\nmessage = " + e.getMessage() ); System.out.println( "string = " + e.toString() ); System.out.println( "stacktrace = " + e.getChainedStackTrace() ); } public void testTriple() { TestException e = new TestException("test 3", new TestException("test 33", new Exception("test 333"))); System.out.println( "\nmessage = " + e.getMessage() ); System.out.println( "string = " + e.toString() ); System.out.println( "stacktrace = " + e.getChainedStackTrace() ); } }