1 17 18 package org.apache.avalon.framework.test; 19 20 import org.apache.avalon.framework.CascadingRuntimeException; 21 import org.apache.avalon.framework.CascadingThrowable; 22 23 import junit.framework.TestCase; 24 25 31 public class CascadingRuntimeExceptionTestCase extends TestCase 32 { 33 public void testConstructor() 34 { 35 assertNotNull( new CascadingRuntimeException( null, null ) ); 36 assertNotNull( new CascadingRuntimeException( "msg", null ) ); 37 assertNotNull( 38 new CascadingRuntimeException( "msg", new RuntimeException () ) ); 39 assertNotNull( 40 new CascadingRuntimeException( null, new RuntimeException () ) ); 41 } 42 43 public void testGetCause() 44 { 45 RuntimeException re = new RuntimeException (); 46 CascadingRuntimeException e = new CascadingRuntimeException( "msg", 47 re ); 48 49 assertEquals( re, e.getCause() ); 50 51 e = new CascadingRuntimeException( "msg", null ); 52 assertNull( e.getCause() ); 53 54 72 } 73 74 public void testCasts() 75 { 76 CascadingRuntimeException e = new CascadingRuntimeException( "msg", 77 null ); 78 assertTrue( e instanceof RuntimeException ); 79 assertTrue( e instanceof CascadingThrowable ); 80 } 81 } 82 | Popular Tags |