1 64 65 package com.jcorporate; 66 67 import com.jcorporate.expresso.services.test.TestSystemInitializer; 68 import junit.framework.TestSuite; 69 import org.apache.log4j.Logger; 70 71 import java.lang.reflect.Method ; 72 73 74 82 83 86 public class AllProjectsTestSuite 87 extends TestSuite { 88 89 private static Logger log = Logger.getLogger(AllProjectsTestSuite.class); 90 91 public AllProjectsTestSuite() 92 throws Exception { 93 TestSystemInitializer.setUp(); 94 } 95 96 public AllProjectsTestSuite(String name) 97 throws Exception { 98 super(name); 99 TestSystemInitializer.setUp(); 100 } 101 102 public static void main(String [] args) 103 throws Exception { 104 105 junit.textui.TestRunner.run(suite()); 107 } 108 109 114 public static junit.framework.Test suite() 115 throws Exception { 116 AllProjectsTestSuite ts = new AllProjectsTestSuite("All JCorporate Projects Test Suite"); 117 addTestSuite("com.jcorporate.expresso.core.ExpressoTestSuite", ts); 118 addTestSuite("com.jcorporate.eforum.EForumTestSuite", ts); 119 addTestSuite("com.jcorporate.epoll.PollTestSuite", ts); 120 addTestSuite("com.jcorporate.esearch.SearchTestSuite", ts); 121 122 return ts; 124 } 125 126 130 private static void addTestSuite(String className, TestSuite ts) { 131 try { 132 Class c = Class.forName(className); 133 Method m = c.getMethod("suite", null); 134 ts.addTest((junit.framework.Test) m.invoke(null, null)); 135 } catch (Exception e) { 136 log.warn("Unable to load test suite " + className, e); 137 } 138 } 139 140 141 }
| Popular Tags
|