TestTransducer.java
01 package gate.jape.functest;
02 
03 import java.util.Calendar;
04 import org.apache.log4j.Logger;
05 import junit.extensions.TestSetup;
06 import junit.framework.Test;
07 import junit.framework.TestCase;
08 import junit.framework.TestSuite;
09 
10 /**
11  * Executes all tests on given JAPE Transducer.
12  <p/>
13  * See {@link BaseJapeTests#transducerType}
14  *
15  */
16 public class TestTransducer extends TestCase {
17     private static final Logger logger = Logger.getLogger(TestTransducer.class);
18     private static Calendar executionTime; 
19     
20     public static Test suite() {
21   TestSuite tests = new TestSuite("All JAPE tests");
22   tests.addTest(TestJape.suite());
23   tests.addTest(TestConstraints.suite());
24   
25   Test suite = new TestSetup(tests) {
26       protected void setUp() {
27     executionTime = Calendar.getInstance();
28       }
29       
30       protected void tearDown() {
31     long executedIn = Calendar.getInstance().getTimeInMillis() - executionTime.getTimeInMillis();
32     logger.info("Test suite executed in: " + executedIn/1000  " second(s).");
33       }
34   };
35   
36   return suite;
37     }
38 
39     public static void main(String... args) {
40   junit.textui.TestRunner.run(TestTransducer.suite());
41     }
42 }