X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2Ftest%2FSimpleTestRun.java;fp=cms%2Forg.argeo.slc.runtime%2Fsrc%2Forg%2Fargeo%2Fslc%2Fruntime%2Ftest%2FSimpleTestRun.java;h=bc0145295be9b3c80fb2042947352e52d4cde3f4;hb=ecc22e604e47533c79de9cecdcdeacbc752cbff1;hp=0000000000000000000000000000000000000000;hpb=e07ded4632e53f8b8869763bc1f1f4091361e76e;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.runtime/src/org/argeo/slc/runtime/test/SimpleTestRun.java b/cms/org.argeo.slc.runtime/src/org/argeo/slc/runtime/test/SimpleTestRun.java new file mode 100644 index 000000000..bc0145295 --- /dev/null +++ b/cms/org.argeo.slc.runtime/src/org/argeo/slc/runtime/test/SimpleTestRun.java @@ -0,0 +1,95 @@ +package org.argeo.slc.runtime.test; + +import java.util.UUID; + +import org.argeo.slc.deploy.DeployedSystem; +import org.argeo.slc.test.ExecutableTestRun; +import org.argeo.slc.test.TestData; +import org.argeo.slc.test.TestDefinition; +import org.argeo.slc.test.TestResult; +import org.argeo.slc.test.WritableTestRun; + +/** + * A basic bean implementation of a WritableTestRun, 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 getDeployedSystem() { + return (T) deployedSystem; + } + + public void setDeployedSystem(DeployedSystem deployedSystem) { + this.deployedSystem = deployedSystem; + } + + @SuppressWarnings("unchecked") + public T getTestData() { + return (T) testData; + } + + public void setTestData(TestData testData) { + this.testData = testData; + } + + @SuppressWarnings("unchecked") + public T getTestDefinition() { + return (T) testDefinition; + } + + public void setTestDefinition(TestDefinition testDefinition) { + this.testDefinition = testDefinition; + } + + @SuppressWarnings("unchecked") + public 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; + // } +}