1 26 27 package net.sourceforge.groboutils.junit.v1; 28 29 import junit.framework.Test; 30 import junit.framework.TestCase; 31 import junit.framework.TestSuite; 32 33 import java.io.IOException ; 34 import java.lang.reflect.Method ; 35 36 37 45 public class JUnitTestCaseEUTest extends TestCase 46 { 47 50 private static final Class THIS_CLASS = JUnitTestCaseEUTest.class; 51 52 public JUnitTestCaseEUTest( String name ) 53 { 54 super( name ); 55 } 56 57 58 59 60 63 64 public static class MyTestCase1 extends TestCase 65 { 66 String myName; 67 public MyTestCase1() 68 { 69 super( "test1" ); 71 } 72 public void test1() 73 { 74 } 76 public String getName() 77 { 78 return myName; 79 } 80 public String name() 81 { 82 return getName(); 83 } 84 85 public void runTest() throws Throwable 86 { 87 super.runTest(); 88 } 89 } 90 91 92 99 public void testRunTestName1() throws Throwable 100 { 101 MyTestCase1 tc = new MyTestCase1(); 102 tc.myName = "Just Another Test"; 103 104 tc.runTest(); 106 } 107 108 109 112 113 public static Test suite() 114 { 115 TestSuite suite = new TestSuite( THIS_CLASS ); 116 117 return suite; 118 } 119 120 public static void main( String [] args ) 121 { 122 String [] name = { THIS_CLASS.getName() }; 123 124 127 junit.textui.TestRunner.main( name ); 128 } 129 130 131 135 protected void setUp() throws Exception 136 { 137 super.setUp(); 138 139 } 141 142 143 147 protected void tearDown() throws Exception 148 { 149 151 152 super.tearDown(); 153 } 154 } 155 156 | Popular Tags |