Refactor Argeo API
[gpl/argeo-slc.git] / org.argeo.slc.runtime / src / org / argeo / slc / runtime / test / SimpleTestRun.java
index a00c48dfa2f3169e046a789d19a117f4d1cdf9ae..44737931d79d1320b04e0e571fe17fb45e660823 100644 (file)
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *         http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.runtime.test;\r
-\r
-import java.util.UUID;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-import org.argeo.slc.test.ExecutableTestRun;\r
-import org.argeo.slc.test.TestData;\r
-import org.argeo.slc.test.TestDefinition;\r
-import org.argeo.slc.test.TestResult;\r
-import org.argeo.slc.test.WritableTestRun;\r
-\r
-/**\r
- * A basic bean implementation of a <code>WritableTestRun</code>, holding\r
- * references to the various parts of a test run.\r
- */\r
-public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {\r
-       private String uuid;\r
-\r
-       // private String slcExecutionUuid;\r
-       // private String slcExecutionStepUuid;\r
-\r
-       private DeployedSystem deployedSystem;\r
-       private TestData testData;\r
-       private TestDefinition testDefinition;\r
-       private TestResult testResult;\r
-\r
-       /** Executes the underlying test definition. */\r
-       public void run() {\r
-               uuid = UUID.randomUUID().toString();\r
-               if (testResult != null)\r
-                       testResult.notifyTestRun(this);\r
-\r
-               testDefinition.execute(this);\r
-       }\r
-\r
-       @SuppressWarnings("unchecked")\r
-       public <T extends DeployedSystem> T getDeployedSystem() {\r
-               return (T) deployedSystem;\r
-       }\r
-\r
-       public void setDeployedSystem(DeployedSystem deployedSystem) {\r
-               this.deployedSystem = deployedSystem;\r
-       }\r
-\r
-       @SuppressWarnings("unchecked")\r
-       public <T extends TestData> T getTestData() {\r
-               return (T) testData;\r
-       }\r
-\r
-       public void setTestData(TestData testData) {\r
-               this.testData = testData;\r
-       }\r
-\r
-       @SuppressWarnings("unchecked")\r
-       public <T extends TestDefinition> T getTestDefinition() {\r
-               return (T) testDefinition;\r
-       }\r
-\r
-       public void setTestDefinition(TestDefinition testDefinition) {\r
-               this.testDefinition = testDefinition;\r
-       }\r
-\r
-       @SuppressWarnings("unchecked")\r
-       public <T extends TestResult> T getTestResult() {\r
-               return (T) testResult;\r
-       }\r
-\r
-       public void setTestResult(TestResult testResult) {\r
-               this.testResult = testResult;\r
-       }\r
-\r
-       public String getUuid() {\r
-               return uuid;\r
-       }\r
-\r
-       public void setUuid(String uuid) {\r
-               this.uuid = uuid;\r
-       }\r
-\r
-       // public String getSlcExecutionUuid() {\r
-       // return slcExecutionUuid;\r
-       // }\r
-       //\r
-       // public void setSlcExecutionUuid(String slcExecutionUuid) {\r
-       // this.slcExecutionUuid = slcExecutionUuid;\r
-       // }\r
-       //\r
-       // public String getSlcExecutionStepUuid() {\r
-       // return slcExecutionStepUuid;\r
-       // }\r
-       //\r
-       // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {\r
-       // this.slcExecutionStepUuid = slcExecutionStepUuid;\r
-       // }\r
-}\r
+package org.argeo.slc.runtime.test;
+
+import java.util.UUID;
+
+import org.argeo.api.slc.deploy.DeployedSystem;
+import org.argeo.api.slc.test.ExecutableTestRun;
+import org.argeo.api.slc.test.TestData;
+import org.argeo.api.slc.test.TestDefinition;
+import org.argeo.api.slc.test.TestResult;
+import org.argeo.api.slc.test.WritableTestRun;
+
+/**
+ * A basic bean implementation of a <code>WritableTestRun</code>, holding
+ * references to the various parts of a test run.
+ */
+public class SimpleTestRun implements WritableTestRun, ExecutableTestRun {
+       private String uuid;
+
+       // private String slcExecutionUuid;
+       // private String slcExecutionStepUuid;
+
+       private DeployedSystem deployedSystem;
+       private TestData testData;
+       private TestDefinition testDefinition;
+       private TestResult testResult;
+
+       /** Executes the underlying test definition. */
+       public void run() {
+               uuid = UUID.randomUUID().toString();
+               if (testResult != null)
+                       testResult.notifyTestRun(this);
+
+               testDefinition.execute(this);
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T extends DeployedSystem> T getDeployedSystem() {
+               return (T) deployedSystem;
+       }
+
+       public void setDeployedSystem(DeployedSystem deployedSystem) {
+               this.deployedSystem = deployedSystem;
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T extends TestData> T getTestData() {
+               return (T) testData;
+       }
+
+       public void setTestData(TestData testData) {
+               this.testData = testData;
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T extends TestDefinition> T getTestDefinition() {
+               return (T) testDefinition;
+       }
+
+       public void setTestDefinition(TestDefinition testDefinition) {
+               this.testDefinition = testDefinition;
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T extends TestResult> T getTestResult() {
+               return (T) testResult;
+       }
+
+       public void setTestResult(TestResult testResult) {
+               this.testResult = testResult;
+       }
+
+       public String getUuid() {
+               return uuid;
+       }
+
+       public void setUuid(String uuid) {
+               this.uuid = uuid;
+       }
+
+       // public String getSlcExecutionUuid() {
+       // return slcExecutionUuid;
+       // }
+       //
+       // public void setSlcExecutionUuid(String slcExecutionUuid) {
+       // this.slcExecutionUuid = slcExecutionUuid;
+       // }
+       //
+       // public String getSlcExecutionStepUuid() {
+       // return slcExecutionStepUuid;
+       // }
+       //
+       // public void setSlcExecutionStepUuid(String slcExecutionStepUuid) {
+       // this.slcExecutionStepUuid = slcExecutionStepUuid;
+       // }
+}