KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > pat > internal > TestRunner


1 package org.objectweb.celtix.pat.internal;
2
3 public class TestRunner implements Runnable JavaDoc {
4
5     protected TestCaseBase testCase;
6     private String JavaDoc name;
7     
8
9     public TestRunner() {
10         this("Default runner");
11     }
12
13     public TestRunner(String JavaDoc cname) {
14         this(cname, null);
15     }
16
17     public TestRunner(String JavaDoc cname, TestCaseBase test) {
18         this.name = cname;
19         this.testCase = test;
20     }
21
22     public void run() {
23         System.out.println("TestRunner " + name + " is running");
24         try {
25             testCase.internalTestRun(name);
26         } catch (Exception JavaDoc e) {
27             e.printStackTrace();
28         }
29         System.out.println("TestRunner " + name + " is finished");
30     }
31   
32     public void start() {
33         Thread JavaDoc thread = new Thread JavaDoc(this);
34         thread.start();
35     }
36
37     public String JavaDoc getName() {
38         return name;
39     }
40 }
41
Popular Tags