1 26 27 package net.sourceforge.groboutils.pmti.v1; 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 IProblemManagerInfoUTestI extends InterfaceTestCase 46 { 47 50 private static final Class THIS_CLASS = IProblemManagerInfoUTestI.class; 51 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 52 53 public IProblemManagerInfoUTestI( String name, ImplFactory f ) 54 { 55 super( name, IProblemManagerInfo.class, f ); 56 } 57 58 59 public IProblemManagerInfo createIProblemManagerInfo() 60 { 61 return (IProblemManagerInfo)createImplObject(); 62 } 63 64 65 68 69 public void testGetIssueTypes1() 70 { 71 IProblemManagerInfo pmi = createIProblemManagerInfo(); 72 String [] it = pmi.getIssueTypes(); 73 assertNotNull( 74 "Null issue types array.", 75 it ); 76 for (int i = 0; i < it.length; ++i) 77 { 78 assertNotNull( 79 "Null issue type at index "+i+".", 80 it[i] ); 81 assertTrue( 82 "Empty issue type at index "+i+".", 83 it[i].trim().length() > 0 ); 84 } 85 } 86 87 88 public void testGetDefaultType1() 89 { 90 IProblemManagerInfo pmi = createIProblemManagerInfo(); 91 String dt = pmi.getDefaultType(); 92 assertNotNull( 93 "Null default type.", 94 dt ); 95 96 String [] it = pmi.getIssueTypes(); 98 for (int i = 0; i < it.length; ++i) 99 { 100 if (it[i].equals( dt )) 101 { 102 return; 103 } 104 } 105 fail( "Issue type list did not contain default type." ); 106 } 107 108 109 public void testGetTypeInfo1() 110 { 111 IProblemManagerInfo pmi = createIProblemManagerInfo(); 112 String [] it = pmi.getIssueTypes(); 113 for (int i = 0; i < it.length; ++i) 114 { 115 IIssueTypeInfo iti = pmi.getTypeInfo( it[i] ); 116 assertNotNull( 117 "Null type info for type "+it[i]+".", 118 iti ); 119 } 120 } 121 122 123 124 127 128 public static InterfaceTestSuite suite() 129 { 130 InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); 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 setUp() throws Exception 151 { 152 super.setUp(); 153 154 } 156 157 158 162 protected void tearDown() throws Exception 163 { 164 166 167 super.tearDown(); 168 } 169 } 170 171 | Popular Tags |