1 package org
.argeo
.slc
.core
.test
;
5 import org
.argeo
.slc
.deploy
.DeployedSystem
;
6 import org
.argeo
.slc
.process
.SlcExecution
;
7 import org
.argeo
.slc
.process
.SlcExecutionRelated
;
8 import org
.argeo
.slc
.process
.SlcExecutionStep
;
9 import org
.argeo
.slc
.test
.ExecutableTestRun
;
10 import org
.argeo
.slc
.test
.TestData
;
11 import org
.argeo
.slc
.test
.TestDefinition
;
12 import org
.argeo
.slc
.test
.TestResult
;
13 import org
.argeo
.slc
.test
.WritableTestRun
;
16 * A basic bean implementation of a <code>WritableTestRun</code>, holding
17 * references to the various parts of a test run.
19 public class SimpleTestRun
implements WritableTestRun
, ExecutableTestRun
, SlcExecutionRelated
{
22 private String slcExecutionUuid
;
23 private String slcExecutionStepUuid
;
25 private DeployedSystem deployedSystem
;
26 private TestData testData
;
27 private TestDefinition testDefinition
;
28 private TestResult testResult
;
30 /** Executes the underlying test definition. */
31 public void execute() {
32 uuid
= UUID
.randomUUID().toString();
33 if (testResult
!= null)
34 testResult
.notifyTestRun(this);
35 testDefinition
.execute(this);
38 public <T
extends DeployedSystem
> T
getDeployedSystem() {
39 return (T
) deployedSystem
;
42 public void setDeployedSystem(DeployedSystem deployedSystem
) {
43 this.deployedSystem
= deployedSystem
;
46 public <T
extends TestData
> T
getTestData() {
50 public void setTestData(TestData testData
) {
51 this.testData
= testData
;
54 public <T
extends TestDefinition
> T
getTestDefinition() {
55 return (T
) testDefinition
;
58 public void setTestDefinition(TestDefinition testDefinition
) {
59 this.testDefinition
= testDefinition
;
62 public <T
extends TestResult
> T
getTestResult() {
63 return (T
) testResult
;
66 public void setTestResult(TestResult testResult
) {
67 this.testResult
= testResult
;
70 public String
getUuid() {
74 public void setUuid(String uuid
) {
78 public String
getSlcExecutionUuid() {
79 return slcExecutionUuid
;
82 public void setSlcExecutionUuid(String slcExecutionUuid
) {
83 this.slcExecutionUuid
= slcExecutionUuid
;
86 public String
getSlcExecutionStepUuid() {
87 return slcExecutionStepUuid
;
90 public void setSlcExecutionStepUuid(String slcExecutionStepUuid
) {
91 this.slcExecutionStepUuid
= slcExecutionStepUuid
;
94 public void notifySlcExecution(SlcExecution slcExecution
) {
95 if (slcExecution
!= null) {
96 slcExecutionUuid
= slcExecution
.getUuid();
97 SlcExecutionStep step
= slcExecution
.currentStep();
99 slcExecutionStepUuid
= step
.getUuid();