01: package org.objectweb.celtix.pat.internal;
02:
03: public class TestRunner implements Runnable {
04:
05: protected TestCaseBase testCase;
06: private String name;
07:
08: public TestRunner() {
09: this ("Default runner");
10: }
11:
12: public TestRunner(String cname) {
13: this (cname, null);
14: }
15:
16: public TestRunner(String cname, TestCaseBase test) {
17: this .name = cname;
18: this .testCase = test;
19: }
20:
21: public void run() {
22: System.out.println("TestRunner " + name + " is running");
23: try {
24: testCase.internalTestRun(name);
25: } catch (Exception e) {
26: e.printStackTrace();
27: }
28: System.out.println("TestRunner " + name + " is finished");
29: }
30:
31: public void start() {
32: Thread thread = new Thread(this );
33: thread.start();
34: }
35:
36: public String getName() {
37: return name;
38: }
39: }
|