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