1 package org
.argeo
.slc
.core
.test
;
5 import org
.argeo
.slc
.core
.deploy
.DeployedSystem
;
6 import org
.argeo
.slc
.core
.process
.SlcExecution
;
7 import org
.argeo
.slc
.core
.process
.SlcExecutionStep
;
10 * A basic bean implementation of a <code>WritableTestRun</code>, holding
11 * references to the various parts of a test run.
13 public class SimpleTestRun
implements WritableTestRun
, ExecutableTestRun
{
16 private String slcExecutionUuid
;
17 private String slcExecutionStepUuid
;
19 private DeployedSystem deployedSystem
;
20 private TestData testData
;
21 private TestDefinition testDefinition
;
22 private TestResult testResult
;
24 /** Executes the underlying test definition. */
25 public void execute() {
26 uuid
= UUID
.randomUUID().toString();
27 if (testResult
!= null)
28 testResult
.notifyTestRun(this);
29 testDefinition
.execute(this);
32 public <T
extends DeployedSystem
> T
getDeployedSystem() {
33 return (T
) deployedSystem
;
36 public void setDeployedSystem(DeployedSystem deployedSystem
) {
37 this.deployedSystem
= deployedSystem
;
40 public <T
extends TestData
> T
getTestData() {
44 public void setTestData(TestData testData
) {
45 this.testData
= testData
;
48 public <T
extends TestDefinition
> T
getTestDefinition() {
49 return (T
) testDefinition
;
52 public void setTestDefinition(TestDefinition testDefinition
) {
53 this.testDefinition
= testDefinition
;
56 public <T
extends TestResult
> T
getTestResult() {
57 return (T
) testResult
;
60 public void setTestResult(TestResult testResult
) {
61 this.testResult
= testResult
;
64 public String
getUuid() {
68 public void setUuid(String uuid
) {
72 public String
getSlcExecutionUuid() {
73 return slcExecutionUuid
;
76 public void setSlcExecutionUuid(String slcExecutionUuid
) {
77 this.slcExecutionUuid
= slcExecutionUuid
;
80 public String
getSlcExecutionStepUuid() {
81 return slcExecutionStepUuid
;
84 public void setSlcExecutionStepUuid(String slcExecutionStepUuid
) {
85 this.slcExecutionStepUuid
= slcExecutionStepUuid
;
88 public void notifySlcExecution(SlcExecution slcExecution
) {
89 if (slcExecution
!= null) {
90 slcExecutionUuid
= slcExecution
.getUuid();
91 SlcExecutionStep step
= slcExecution
.currentStep();
93 slcExecutionStepUuid
= step
.getUuid();