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 NameTestIssueRecordCollatorUTest extends TestCase 50 { 51 54 private static final Class THIS_CLASS = 55 NameTestIssueRecordCollatorUTest.class; 56 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 57 58 public NameTestIssueRecordCollatorUTest( 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 public void testGetFactor1() 83 { 84 NameTestIssueRecordCollator atirc = new NameTestIssueRecordCollator(); 85 IIssueRecord ir = new DefaultIssueRecord( "", null ); 86 DefaultTestRecord tr = new DefaultTestRecord(); 87 ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); 88 89 Object r = atirc.getFactor( tir ); 90 assertEquals( 91 "Not right default (null) factor", 92 "<unknown test name>", 93 r ); 94 } 95 96 97 public void testGetFactor2() 98 { 99 NameTestIssueRecordCollator atirc = new NameTestIssueRecordCollator(); 100 IIssueRecord ir = new DefaultIssueRecord( "", null ); 101 DefaultTestRecord tr = new DefaultTestRecord(); 102 tr.setTestName( "1" ); 103 ITestIssueRecord tir = new DefaultTestIssueRecord( ir, tr, "text 1" ); 104 105 Object r = atirc.getFactor( tir ); 106 assertEquals( 107 "Not right factor", 108 "1", 109 r ); 110 } 111 112 113 116 117 120 121 public static Test suite() 122 { 123 InterfaceTestSuite suite = AbstractTestIssueRecordCollatorUTestI.suite(); 124 suite.addTestSuite( THIS_CLASS ); 125 suite.addFactory( new CxFactory( "A" ) { 126 public Object createImplObject() { 127 return new NameTestIssueRecordCollator(); 128 } 129 } ); 130 131 return suite; 132 } 133 134 public static void main( String [] args ) 135 { 136 String [] name = { THIS_CLASS.getName() }; 137 138 141 junit.textui.TestRunner.main( name ); 142 } 143 144 145 149 protected void tearDown() throws Exception 150 { 151 153 154 super.tearDown(); 155 } 156 } 157 158 | Popular Tags |