1 package org
.argeo
.slc
.runtime
.test
;
6 import java
.util
.TreeMap
;
8 import java
.util
.Vector
;
10 import org
.argeo
.slc
.SlcException
;
11 import org
.argeo
.slc
.test
.TestResult
;
12 import org
.argeo
.slc
.test
.TestResultPart
;
13 import org
.argeo
.slc
.test
.TestRun
;
16 * Basic implementation of a test result containing only a list of result parts.
18 public class SimpleTestResult
implements TestResult
{
20 private String currentTestRunUuid
;
22 private Boolean throwError
= true;
24 private Date closeDate
;
25 private List
<TestResultPart
> parts
= new Vector
<TestResultPart
>();
27 private Map
<String
, String
> attributes
= new TreeMap
<String
, String
>();
29 public void addResultPart(TestResultPart part
) {
30 if (throwError
&& part
.getStatus() == ERROR
) {
31 throw new SlcException("There was an error in the underlying test: " + part
.getExceptionMessage());
34 // if (log.isDebugEnabled())
40 closeDate
= new Date();
43 public List
<TestResultPart
> getParts() {
47 public Date
getCloseDate() {
51 public void setThrowError(Boolean throwError
) {
52 this.throwError
= throwError
;
55 public void notifyTestRun(TestRun testRun
) {
56 currentTestRunUuid
= testRun
.getUuid();
59 public String
getUuid() {
61 uuid
= UUID
.randomUUID().toString();
66 public void setUuid(String uuid
) {
70 public String
getCurrentTestRunUuid() {
71 return currentTestRunUuid
;
74 public Map
<String
, String
> getAttributes() {
78 public void setAttributes(Map
<String
, String
> attributes
) {
79 this.attributes
= attributes
;