1 26 27 package net.sourceforge.groboutils.util.throwable.v1; 28 29 import java.io.PrintStream ; 30 import java.io.PrintWriter ; 31 import java.io.StringWriter ; 32 import java.io.ByteArrayOutputStream ; 33 import net.sourceforge.groboutils.autodoc.v1.*; 34 import net.sourceforge.groboutils.junit.v1.iftc.*; 35 import junit.framework.Test; 36 import junit.framework.TestCase; 37 import junit.framework.TestSuite; 38 39 40 47 public class ChainableExceptionUTest extends TestCase 48 { 49 52 private static final Class THIS_CLASS = 53 ChainableExceptionUTest.class; 54 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 55 56 public ChainableExceptionUTest( String name ) 57 { 58 super( name ); 59 DOC.getLog().info( "ChainableExceptionUTest() constructor"); 60 } 61 62 63 66 70 protected void setUp() throws Exception 71 { 72 super.setUp(); 73 74 } 76 77 78 81 public void testAllTestsCoveredByInterfaceTests() 82 { 83 } 85 86 87 90 91 94 95 public static class CEFactory 96 implements IChainableExceptionUTestI.IChainableExceptionFactory 97 { 98 public IChainableException createException() 99 { 100 return new ChainableException(); 101 } 102 103 public IChainableException createException( String message ) 104 { 105 return new ChainableException( message ); 106 } 107 108 public IChainableException createException( Throwable cause ) 109 { 110 return new ChainableException( cause ); 111 } 112 113 public IChainableException createException( String message, 114 Throwable cause ) 115 { 116 return new ChainableException( message, cause ); 117 } 118 119 public IChainableException createException( Throwable cause, 120 String message ) 121 { 122 return new ChainableException( cause, message ); 123 } 124 } 125 126 127 128 public static Test suite() 129 { 130 InterfaceTestSuite suite = IChainableExceptionUTestI.suite(); 131 132 suite.addTestSuite( THIS_CLASS ); 135 136 DOC.getLog().info( "Adding factory to suite." ); 137 suite.addFactory( new CxFactory( "A" ) { 138 public Object createImplObject() { 139 DOC.getLog().info( "Creating factory implementation object." ); 140 return new CEFactory(); 141 } 143 } ); 144 145 DOC.getLog().info( "Returning suite." ); 146 return suite; 147 } 148 149 public static void main( String [] args ) 150 { 151 String [] name = { THIS_CLASS.getName() }; 152 153 156 junit.textui.TestRunner.main( name ); 157 } 158 159 160 164 protected void tearDown() throws Exception 165 { 166 168 169 super.tearDown(); 170 } 171 } 172 173 | Popular Tags |