01: package org.mactor.ui;
02:
03: import java.util.LinkedList;
04: import org.mactor.framework.TestContext;
05: import org.mactor.framework.TestEvent;
06: import org.mactor.framework.TestSummary;
07:
08: public class TestProgressInfo {
09: private TestContext contex;
10: private LinkedList<TestEvent> log = new LinkedList<TestEvent>();
11: private TestSummary testSummary = null;
12:
13: public TestProgressInfo(TestContext contex) {
14: super ();
15: this .contex = contex;
16: }
17:
18: public boolean addEvent(TestEvent event) {
19: log.add(event);
20: if (event.isTestCompleteEvent()) {
21: testSummary = TestSummary.create(this .contex, log);
22: this .log = null;
23: this .contex = null;
24: return true;
25: }
26: return false;
27: }
28:
29: public boolean hasTestSummary() {
30: return testSummary != null;
31: }
32:
33: public LinkedList<TestEvent> getLog() {
34: return log;
35: }
36:
37: public TestSummary getTestSummary() {
38: return testSummary;
39: }
40:
41: public TestContext getContex() {
42: return contex;
43: }
44:
45: }
|