1 26 27 package net.sourceforge.groboutils.pmti.v1.itf; 28 29 import net.sourceforge.groboutils.autodoc.v1.AutoDoc; 30 import org.easymock.EasyMock; 31 import org.easymock.MockControl; 32 import net.sourceforge.groboutils.junit.v1.iftc.*; 33 import junit.framework.Test; 34 import junit.framework.TestCase; 35 import junit.framework.TestSuite; 36 37 38 45 public class ITestRecordUTestI extends InterfaceTestCase 46 { 47 50 private static final Class THIS_CLASS = ITestRecordUTestI.class; 51 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 52 53 public ITestRecordUTestI( String name, ImplFactory f ) 54 { 55 super( name, ITestRecord.class, f ); 56 } 57 58 59 public ITestRecord createITestRecord() 60 { 61 return (ITestRecord)createImplObject(); 62 } 63 64 65 68 69 public void testGetTestName1() 70 { 71 ITestRecord tr = createITestRecord(); 72 String name = tr.getTestName(); 73 } 74 75 76 public void testGetTestSuite1() 77 { 78 ITestRecord tr = createITestRecord(); 79 String name = tr.getTestSuite(); 80 } 81 82 83 public void testGetLog1() 84 { 85 ITestRecord tr = createITestRecord(); 86 String log = tr.getLog(); 87 } 88 89 90 public void testGetTestCount1() 91 { 92 ITestRecord tr = createITestRecord(); 93 int count = tr.getTestCount(); 94 assertTrue( 95 "Not valid count "+count+".", 96 count >= 0 ); 97 } 98 99 100 public void testGetRuntime1() 101 { 102 ITestRecord tr = createITestRecord(); 103 long time = tr.getRuntime(); 104 assertTrue( 105 "Not valid runtime "+time+".", 106 time >= 0L ); 107 } 108 109 110 public void testGetFailures1() 111 { 112 ITestRecord tr = createITestRecord(); 113 String f[] = tr.getFailures(); 114 assertNotNull( 115 "Returned null failure list.", 116 f ); 117 for (int i = 0; i < f.length; ++i) 118 { 119 assertNotNull( 120 "Returned null failure at index "+i+".", 121 f[i] ); 122 assertTrue( 123 "Returned empty failure string at index "+i+".", 124 f[i].length() > 0 ); 125 } 126 } 127 128 129 public void testGetErrors1() 130 { 131 ITestRecord tr = createITestRecord(); 132 String e[] = tr.getErrors(); 133 assertNotNull( 134 "Returned null failure list.", 135 e ); 136 for (int i = 0; i < e.length; ++i) 137 { 138 assertNotNull( 139 "Returned null failure at index "+i+".", 140 e[i] ); 141 assertTrue( 142 "Returned empty failure string at index "+i+".", 143 e[i].length() > 0 ); 144 } 145 } 146 147 148 public void testCombo1() 149 { 150 ITestRecord tr = createITestRecord(); 151 int count = tr.getTestCount(); 152 String e[] = tr.getErrors(); 153 String f[] = tr.getFailures(); 154 155 assertTrue( 156 "Test Count ("+count+ 157 ") is less than the number of errors ("+e.length+ 158 ") and failures ("+f.length+").", 159 count >= e.length + f.length ); 160 } 161 162 163 166 167 public static InterfaceTestSuite suite() 168 { 169 InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); 170 171 return suite; 172 } 173 174 public static void main( String [] args ) 175 { 176 String [] name = { THIS_CLASS.getName() }; 177 178 181 junit.textui.TestRunner.main( name ); 182 } 183 184 185 189 protected void setUp() throws Exception 190 { 191 super.setUp(); 192 193 } 195 196 197 201 protected void tearDown() throws Exception 202 { 203 205 206 super.tearDown(); 207 } 208 } 209 210 | Popular Tags |