]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.runtime/src/org/argeo/slc/runtime/test/SimpleTestRun.java
Prepare next development cycle
[gpl/argeo-slc.git] / org.argeo.slc.runtime / src / org / argeo / slc / runtime / test / SimpleTestRun.java
1 package org.argeo.slc.runtime.test;
2
3 import java.util.UUID;
4
5 import org.argeo.api.slc.deploy.DeployedSystem;
6 import org.argeo.api.slc.test.ExecutableTestRun;
7 import org.argeo.api.slc.test.TestData;
8 import org.argeo.api.slc.test.TestDefinition;
9 import org.argeo.api.slc.test.TestResult;
10 import org.argeo.api.slc.test.WritableTestRun;
11
12 /**
13 * A basic bean implementation of a <code>WritableTestRun</code>, holding
14 * references to the various parts of a test run.
15 */
16 public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {
17 private String uuid;
18
19 // private String slcExecutionUuid;
20 // private String slcExecutionStepUuid;
21
22 private DeployedSystem deployedSystem;
23 private TestData testData;
24 private TestDefinition testDefinition;
25 private TestResult testResult;
26
27 /** Executes the underlying test definition. */
28 public void run() {
29 uuid = UUID.randomUUID().toString();
30 if (testResult != null)
31 testResult.notifyTestRun(this);
32
33 testDefinition.execute(this);
34 }
35
36 @SuppressWarnings("unchecked")
37 public <T extends DeployedSystem> T getDeployedSystem() {
38 return (T) deployedSystem;
39 }
40
41 public void setDeployedSystem(DeployedSystem deployedSystem) {
42 this.deployedSystem = deployedSystem;
43 }
44
45 @SuppressWarnings("unchecked")
46 public <T extends TestData> T getTestData() {
47 return (T) testData;
48 }
49
50 public void setTestData(TestData testData) {
51 this.testData = testData;
52 }
53
54 @SuppressWarnings("unchecked")
55 public <T extends TestDefinition> T getTestDefinition() {
56 return (T) testDefinition;
57 }
58
59 public void setTestDefinition(TestDefinition testDefinition) {
60 this.testDefinition = testDefinition;
61 }
62
63 @SuppressWarnings("unchecked")
64 public <T extends TestResult> T getTestResult() {
65 return (T) testResult;
66 }
67
68 public void setTestResult(TestResult testResult) {
69 this.testResult = testResult;
70 }
71
72 public String getUuid() {
73 return uuid;
74 }
75
76 public void setUuid(String uuid) {
77 this.uuid = uuid;
78 }
79
80 // public String getSlcExecutionUuid() {
81 // return slcExecutionUuid;
82 // }
83 //
84 // public void setSlcExecutionUuid(String slcExecutionUuid) {
85 // this.slcExecutionUuid = slcExecutionUuid;
86 // }
87 //
88 // public String getSlcExecutionStepUuid() {
89 // return slcExecutionStepUuid;
90 // }
91 //
92 // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {
93 // this.slcExecutionStepUuid = slcExecutionStepUuid;
94 // }
95 }