1 package org
.argeo
.slc
.core
.test
;
6 import java
.util
.TreeMap
;
8 import java
.util
.Vector
;
10 import org
.apache
.commons
.logging
.Log
;
11 import org
.apache
.commons
.logging
.LogFactory
;
13 import org
.argeo
.slc
.core
.SlcException
;
16 * Basic implementation of a test result containing only a list of result parts.
18 public class SimpleTestResult
implements TestResult
{
19 private static Log log
= LogFactory
.getLog(SimpleTestResult
.class);
22 private String currentTestRunUuid
;
24 private Boolean throwError
= true;
26 private Date closeDate
;
27 private List
<TestResultPart
> parts
= new Vector
<TestResultPart
>();
29 private Map
<String
, String
> attributes
= new TreeMap
<String
, String
>();
31 public void addResultPart(TestResultPart part
) {
32 if (throwError
&& part
.getStatus() == ERROR
) {
33 throw new SlcException(
34 "There was an error in the underlying test: "
35 + part
.getExceptionMessage());
38 if (log
.isDebugEnabled())
44 closeDate
= new Date();
47 public List
<TestResultPart
> getParts() {
51 public Date
getCloseDate() {
55 public void setThrowError(Boolean throwError
) {
56 this.throwError
= throwError
;
59 public void notifyTestRun(TestRun testRun
) {
60 currentTestRunUuid
= testRun
.getUuid();
63 public String
getUuid() {
65 uuid
= UUID
.randomUUID().toString();
70 public void setUuid(String uuid
) {
74 public String
getCurrentTestRunUuid() {
75 return currentTestRunUuid
;
78 public Map
<String
, String
> getAttributes() {