1 package org
.argeo
.slc
.core
.test
;
6 import java
.util
.Vector
;
8 import org
.apache
.commons
.logging
.Log
;
9 import org
.apache
.commons
.logging
.LogFactory
;
11 import org
.argeo
.slc
.core
.SlcException
;
14 * Basic implementation of a test result containing only a list of result parts.
16 public class SimpleTestResult
implements TestResult
{
17 private static Log log
= LogFactory
.getLog(SimpleTestResult
.class);
20 private String currentTestRunUuid
;
22 private Boolean throwError
= true;
24 private Date closeDate
;
25 private List
<TestResultPart
> parts
= new Vector
<TestResultPart
>();
27 public void addResultPart(TestResultPart part
) {
28 if (throwError
&& part
.getStatus() == ERROR
) {
29 throw new SlcException(
30 "There was an error in the underlying test: "
31 + 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
;