2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.core
.test
;
18 import java
.util
.UUID
;
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
;
28 * A basic bean implementation of a <code>WritableTestRun</code>, holding
29 * references to the various parts of a test run.
31 public class SimpleTestRun
implements WritableTestRun
, ExecutableTestRun
{
34 // private String slcExecutionUuid;
35 // private String slcExecutionStepUuid;
37 private DeployedSystem deployedSystem
;
38 private TestData testData
;
39 private TestDefinition testDefinition
;
40 private TestResult testResult
;
42 /** Executes the underlying test definition. */
44 uuid
= UUID
.randomUUID().toString();
45 if (testResult
!= null)
46 testResult
.notifyTestRun(this);
48 testDefinition
.execute(this);
51 @SuppressWarnings("unchecked")
52 public <T
extends DeployedSystem
> T
getDeployedSystem() {
53 return (T
) deployedSystem
;
56 public void setDeployedSystem(DeployedSystem deployedSystem
) {
57 this.deployedSystem
= deployedSystem
;
60 @SuppressWarnings("unchecked")
61 public <T
extends TestData
> T
getTestData() {
65 public void setTestData(TestData testData
) {
66 this.testData
= testData
;
69 @SuppressWarnings("unchecked")
70 public <T
extends TestDefinition
> T
getTestDefinition() {
71 return (T
) testDefinition
;
74 public void setTestDefinition(TestDefinition testDefinition
) {
75 this.testDefinition
= testDefinition
;
78 @SuppressWarnings("unchecked")
79 public <T
extends TestResult
> T
getTestResult() {
80 return (T
) testResult
;
83 public void setTestResult(TestResult testResult
) {
84 this.testResult
= testResult
;
87 public String
getUuid() {
91 public void setUuid(String uuid
) {
95 // public String getSlcExecutionUuid() {
96 // return slcExecutionUuid;
99 // public void setSlcExecutionUuid(String slcExecutionUuid) {
100 // this.slcExecutionUuid = slcExecutionUuid;
103 // public String getSlcExecutionStepUuid() {
104 // return slcExecutionStepUuid;
107 // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {
108 // this.slcExecutionStepUuid = slcExecutionStepUuid;