X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Ftest%2FSimpleTestRun.java;h=86b35323b2353e55572fec4469ec27fbc99ff2d2;hb=1ae5fdc24aff37e79a9b984156ce591820240d62;hp=bbe5b215cc332d5bfec88249552a4a56002738ac;hpb=19a9d8d57baf647f8a1a9aac3d9cb55c86dccbcc;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/test/SimpleTestRun.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/test/SimpleTestRun.java index bbe5b215c..86b35323b 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/test/SimpleTestRun.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/test/SimpleTestRun.java @@ -2,30 +2,56 @@ package org.argeo.slc.core.test; import java.util.UUID; -import org.argeo.slc.core.deploy.DeployedSystem; -import org.argeo.slc.core.process.SlcExecution; -import org.argeo.slc.core.process.SlcExecutionStep; +import org.argeo.slc.core.structure.tree.TreeSPath; +import org.argeo.slc.core.structure.tree.TreeSRegistry; +import org.argeo.slc.deploy.DeployedSystem; +import org.argeo.slc.process.SlcExecution; +import org.argeo.slc.process.SlcExecutionRelated; +import org.argeo.slc.process.SlcExecutionStep; +import org.argeo.slc.structure.StructureAware; +import org.argeo.slc.structure.StructureElement; +import org.argeo.slc.structure.StructureRegistry; +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 { +public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, + SlcExecutionRelated, StructureAware { private String uuid; private String slcExecutionUuid; private String slcExecutionStepUuid; + private TreeSPath path; + private StructureRegistry registry; + private DeployedSystem deployedSystem; private TestData testData; private TestDefinition testDefinition; private TestResult testResult; /** Executes the underlying test definition. */ - public void execute() { + public void run() { uuid = UUID.randomUUID().toString(); if (testResult != null) testResult.notifyTestRun(this); + + // Structure + if (testResult != null && path != null + && testResult instanceof StructureAware) + ((StructureAware) testResult).notifyCurrentPath( + registry, path); + + if (path != null && testDefinition instanceof StructureAware) + ((StructureAware) testDefinition).notifyCurrentPath( + registry, path); + testDefinition.execute(this); } @@ -95,4 +121,10 @@ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun { } } + public void notifyCurrentPath(StructureRegistry registry, + TreeSPath path) { + this.registry = registry; + this.path = path; + } + }