]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/main/java/org/argeo/slc/core/test/SimpleTestResult.java
Improve error logging and reporting
[gpl/argeo-slc.git] / org.argeo.slc / src / main / java / org / argeo / slc / core / test / SimpleTestResult.java
1 package org.argeo.slc.core.test;
2
3 import java.util.Date;
4 import java.util.List;
5 import java.util.Vector;
6
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9
10 /**
11 * Basic implementation of a test result containing only a list of result parts.
12 */
13 public class SimpleTestResult implements TestResult {
14 private static Log log = LogFactory.getLog(SimpleTestResult.class);
15
16 private TestResultId testResultId;
17 private Date closeDate;
18 private List<TestResultPart> parts = new Vector<TestResultPart>();
19
20 public void addResultPart(TestResultPart part) {
21 parts.add(part);
22 if (log.isDebugEnabled())
23 log.debug(part);
24 }
25
26 public void close() {
27 parts.clear();
28 closeDate = new Date();
29 }
30
31 public TestResultId getTestResultId() {
32 return testResultId;
33 }
34
35 /** Sets the test result id. */
36 public void setTestResultId(TestResultId testResultId) {
37 this.testResultId = testResultId;
38 }
39
40 public List<TestResultPart> getParts() {
41 return parts;
42 }
43
44 public Date getCloseDate() {
45 return closeDate;
46 }
47
48 }