1 26 27 package net.sourceforge.groboutils.pmti.v1.autodoc.v1; 28 29 import net.sourceforge.groboutils.autodoc.v1.testserver.junit.*; 30 import org.easymock.EasyMock; 31 import org.easymock.MockControl; 32 import junit.framework.Test; 33 import junit.framework.TestCase; 34 import junit.framework.TestSuite; 35 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 36 import net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitListenerUTestI; 37 import net.sourceforge.groboutils.autodoc.v1.testserver.TestData; 38 import net.sourceforge.groboutils.junit.v1.iftc.*; 39 import junit.framework.AssertionFailedError; 40 41 42 49 public class ITFJUnitListenerJDK13UTest extends TestCase 50 { 51 54 private static final Class THIS_CLASS = ITFJUnitListenerJDK13UTest.class; 55 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 56 57 public ITFJUnitListenerJDK13UTest( String name ) 58 { 59 super( name ); 60 } 61 62 63 66 private MockControl testControl; 67 private Test mockTest; 68 69 70 74 protected void setUp() throws Exception 75 { 76 super.setUp(); 77 78 this.testControl = EasyMock.controlFor( Test.class ); 80 this.mockTest = (Test)this.testControl.getMock(); 81 } 82 83 84 87 88 public void testAddFailure1() 89 { 90 DOC.getIT().testsIssue( 526454 ); 91 92 createListener().addFailure( (TestData)null, null ); 93 } 94 95 96 public void testAddFailure1a() 97 { 98 DOC.getIT().testsIssue( 526454 ); 99 100 createListener().addFailure( (Test)null, null ); 101 } 102 103 104 public void testAddFailure2() 105 { 106 DOC.getIT().testsIssue( 526454 ); 107 108 createListener().addFailure( (TestData)null, 109 new AssertionFailedError( "ignore error") ); 110 } 111 112 113 public void testAddFailure2a() 114 { 115 DOC.getIT().testsIssue( 526454 ); 116 117 createListener().addFailure( (Test)null, 118 new AssertionFailedError( "ignore error") ); 119 } 120 121 122 public void testAddFailure3() 123 { 124 this.testControl.activate(); 125 126 createListener().addFailure( this.mockTest, 127 new AssertionFailedError( "ignore error") ); 128 129 this.testControl.verify(); 130 } 131 132 133 public void testAddError1() 134 { 135 DOC.getIT().testsIssue( 526454 ); 136 137 createListener().addError( (TestData)null, null ); 138 } 139 140 141 public void testAddError1a() 142 { 143 DOC.getIT().testsIssue( 526454 ); 144 145 createListener().addError( (Test)null, null ); 146 } 147 148 149 public void testAddError2() 150 { 151 DOC.getIT().testsIssue( 526454 ); 152 153 createListener().addError( (TestData)null, new Throwable ( 154 "ignore error") ); 155 } 156 157 158 public void testAddError2a() 159 { 160 DOC.getIT().testsIssue( 526454 ); 161 162 createListener().addError( (Test)null, new Throwable ( 163 "ignore error") ); 164 } 165 166 167 public void testAddError3() 168 { 169 this.testControl.activate(); 170 171 createListener().addError( this.mockTest, 172 new Throwable ( "ignore error") ); 173 174 this.testControl.verify(); 175 } 176 177 178 179 180 183 protected ITFJUnitListener createListener() 184 { 185 return new ITFJUnitListener(); 186 } 187 188 189 192 193 public static Test suite() 194 { 195 InterfaceTestSuite suite = JUnitTestListenerUTestI.suite(); 196 suite.addTestSuite( THIS_CLASS ); 197 suite.addFactory( new CxFactory( "A" ) { 198 public Object createImplObject() { 199 return new ITFJUnitListener(); 200 } 201 } ); 202 203 return suite; 204 } 205 206 public static void main( String [] args ) 207 { 208 String [] name = { THIS_CLASS.getName() }; 209 210 213 junit.textui.TestRunner.main( name ); 214 } 215 216 217 221 protected void tearDown() throws Exception 222 { 223 225 226 super.tearDown(); 227 } 228 } 229 230 | Popular Tags |