01: package org.mactor.framework;
02:
03: import java.util.Calendar;
04: import org.mactor.framework.TestSummary.MessageInfo;
05:
06: public class TestSuiteSummary {
07: private Calendar testStart;
08: private Calendar testComplete;
09: private int successCount;
10: private int failedCount;
11: private long averageSuccessCompleteTimeMs;
12: private long averageFailedCompleteTimeMs;
13: private int messageSentCount;
14: private int messageReceivedCount;
15:
16: public void addSummary(TestSummary summary) {
17: if (testStart == null)
18: testStart = summary.getTestStartTime();
19: testComplete = summary.getTestCompleteTime();
20: long t = (summary.getTestCompleteTime().getTime().getTime() - summary
21: .getTestStartTime().getTime().getTime());
22: if (summary.isSuccess()) {
23: successCount++;
24: averageSuccessCompleteTimeMs += t;
25: } else {
26: failedCount++;
27: averageFailedCompleteTimeMs += t;
28: }
29: for (MessageInfo mi : summary.getMessageHistory()) {
30: if (mi.isIncoming())
31: messageReceivedCount++;
32: else
33: messageSentCount++;
34: }
35: }
36:
37: public long getAverageFailedCompleteTimeMs() {
38: return averageFailedCompleteTimeMs;
39: }
40:
41: public long getAverageSuccessCompleteTimeMs() {
42: return averageSuccessCompleteTimeMs;
43: }
44:
45: public int getFailedCount() {
46: return failedCount;
47: }
48:
49: public int getMessageReceivedCount() {
50: return messageReceivedCount;
51: }
52:
53: public int getMessageSentCount() {
54: return messageSentCount;
55: }
56:
57: public int getSuccessCount() {
58: return successCount;
59: }
60:
61: public Calendar getTestComplete() {
62: return testComplete;
63: }
64:
65: public Calendar getTestStart() {
66: return testStart;
67: }
68: }
|