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 IProblemManagerUTestI extends InterfaceTestCase 46 { 47 50 private static final Class THIS_CLASS = IProblemManagerUTestI.class; 51 private static final AutoDoc DOC = new AutoDoc( THIS_CLASS ); 52 53 public IProblemManagerUTestI( String name, ImplFactory f ) 54 { 55 super( name, IProblemManager.class, f ); 56 } 57 58 59 public IProblemManager createIProblemManager() 60 { 61 return (IProblemManager)createImplObject(); 62 } 63 64 65 68 69 public void testGetIssueIDs1() 70 throws ProblemManagerException 71 { 72 IProblemManager pm = createIProblemManager(); 73 String [] ids = pm.getIssueIDs(); 74 assertNotNull( 75 "ID list is null.", 76 ids ); 77 for (int i = 0; i < ids.length; ++i) 78 { 79 assertNotNull( 80 "ID index "+i+" is null.", 81 ids[i] ); 82 assertTrue( 83 "ID index "+i+" is empty.", 84 ids[i].trim().length() > 0 ); 85 } 86 } 87 88 89 public void testGetIssueByID1() 90 throws ProblemManagerException 91 { 92 IProblemManager pm = createIProblemManager(); 93 String [] ids = pm.getIssueIDs(); 94 for (int i = 0; i < ids.length; ++i) 95 { 96 IIssue issue = pm.getIssueByID( ids[i] ); 97 assertNotNull( 98 "Issue id "+ids[i]+" is null.", 99 issue ); 100 } 101 } 102 103 104 public void testGetProblemManagerInfo() 105 { 106 IProblemManager pm = createIProblemManager(); 107 IProblemManagerInfo pmi = pm.getProblemManagerInfo(); 108 assertNotNull( 109 "Null info.", 110 pmi ); 111 } 112 113 114 115 118 119 public static InterfaceTestSuite suite() 120 { 121 InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS ); 122 123 return suite; 124 } 125 126 public static void main( String [] args ) 127 { 128 String [] name = { THIS_CLASS.getName() }; 129 130 133 junit.textui.TestRunner.main( name ); 134 } 135 136 137 141 protected void setUp() throws Exception 142 { 143 super.setUp(); 144 145 } 147 148 149 153 protected void tearDown() throws Exception 154 { 155 157 158 super.tearDown(); 159 } 160 } 161 162 | Popular Tags |