1 26 27 package net.sourceforge.groboutils.pmti.v1.itf.impl; 28 29 import net.sourceforge.groboutils.pmti.v1.*; 30 import net.sourceforge.groboutils.pmti.v1.itf.*; 31 32 import org.easymock.EasyMock; 33 import org.easymock.MockControl; 34 import junit.framework.Test; 35 import junit.framework.TestCase; 36 import junit.framework.TestSuite; 37 import net.sourceforge.groboutils.autodoc.v1.*; 38 import net.sourceforge.groboutils.junit.v1.iftc.*; 39 import junit.framework.AssertionFailedError; 40 41 42 49 public class SuiteTestIssueRecordCollatorUTest extends TestCase 50 { 51 54 private static final Class THIS_CLASS = 55 SuiteTestIssueRecordCollatorUTest.class; 56 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 57 58 public SuiteTestIssueRecordCollatorUTest( String name ) 59 { 60 super( name ); 61 } 62 63 64 67 71 protected void setUp() throws Exception 72 { 73 super.setUp(); 74 75 } 77 78 79 82 83 public void testGetFactor1() 84 { 85 SuiteTestIssueRecordCollator atirc = new SuiteTestIssueRecordCollator(); 86 IIssueRecord ir = new DefaultIssueRecord( "", null ); 87 DefaultTestRecord tr = new DefaultTestRecord(); 88 ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); 89 90 Object r = atirc.getFactor( tir ); 91 assertEquals( 92 "Not right default (null) factor", 93 "<unknown test suite>", 94 r ); 95 } 96 97 98 public void testGetFactor2() 99 { 100 SuiteTestIssueRecordCollator atirc = new SuiteTestIssueRecordCollator(); 101 IIssueRecord ir = new DefaultIssueRecord( "", null ); 102 DefaultTestRecord tr = new DefaultTestRecord(); 103 tr.setTestSuite( "1" ); 104 ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); 105 106 Object r = atirc.getFactor( tir ); 107 assertEquals( 108 "Not right factor", 109 "1", 110 r ); 111 } 112 113 114 117 118 121 122 public static Test suite() 123 { 124 InterfaceTestSuite suite = AbstractTestIssueRecordCollatorUTestI.suite(); 125 suite.addTestSuite( THIS_CLASS ); 126 suite.addFactory( new CxFactory( "A" ) { 127 public Object createImplObject() { 128 return new SuiteTestIssueRecordCollator(); 129 } 130 } ); 131 132 return suite; 133 } 134 135 public static void main( String [] args ) 136 { 137 String [] name = { THIS_CLASS.getName() }; 138 139 142 junit.textui.TestRunner.main( name ); 143 } 144 145 146 150 protected void tearDown() throws Exception 151 { 152 154 155 super.tearDown(); 156 } 157 } 158 159 | Popular Tags |