1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.slc.core.test;
17
18 import java.util.UUID;
19
20 import org.argeo.slc.deploy.DeployedSystem;
21 import org.argeo.slc.test.ExecutableTestRun;
22 import org.argeo.slc.test.TestData;
23 import org.argeo.slc.test.TestDefinition;
24 import org.argeo.slc.test.TestResult;
25 import org.argeo.slc.test.WritableTestRun;
26
27
28
29
30
31 public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {
32 private String uuid;
33
34
35
36
37 private DeployedSystem deployedSystem;
38 private TestData testData;
39 private TestDefinition testDefinition;
40 private TestResult testResult;
41
42
43 public void run() {
44 uuid = UUID.randomUUID().toString();
45 if (testResult != null)
46 testResult.notifyTestRun(this);
47
48 testDefinition.execute(this);
49 }
50
51 @SuppressWarnings("unchecked")
52 public <T extends DeployedSystem> T getDeployedSystem() {
53 return (T) deployedSystem;
54 }
55
56 public void setDeployedSystem(DeployedSystem deployedSystem) {
57 this.deployedSystem = deployedSystem;
58 }
59
60 @SuppressWarnings("unchecked")
61 public <T extends TestData> T getTestData() {
62 return (T) testData;
63 }
64
65 public void setTestData(TestData testData) {
66 this.testData = testData;
67 }
68
69 @SuppressWarnings("unchecked")
70 public <T extends TestDefinition> T getTestDefinition() {
71 return (T) testDefinition;
72 }
73
74 public void setTestDefinition(TestDefinition testDefinition) {
75 this.testDefinition = testDefinition;
76 }
77
78 @SuppressWarnings("unchecked")
79 public <T extends TestResult> T getTestResult() {
80 return (T) testResult;
81 }
82
83 public void setTestResult(TestResult testResult) {
84 this.testResult = testResult;
85 }
86
87 public String getUuid() {
88 return uuid;
89 }
90
91 public void setUuid(String uuid) {
92 this.uuid = uuid;
93 }
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 }