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=5ae9dc81ad1c3ddfa99a8456b0c5263dd483642d;hp=bab085990ba9a22560a1f70c417cbc67e2436203;hpb=289c85bbe2b06073b69fb661380ef742328b77dd;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 bab085990..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 @@ -9,6 +9,7 @@ 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; @@ -21,13 +22,14 @@ import org.argeo.slc.test.WritableTestRun; * references to the various parts of a test run. */ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, - SlcExecutionRelated { + SlcExecutionRelated, StructureAware { private String uuid; private String slcExecutionUuid; private String slcExecutionStepUuid; - private String path; + private TreeSPath path; + private StructureRegistry registry; private DeployedSystem deployedSystem; private TestData testData; @@ -35,28 +37,20 @@ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, private TestResult testResult; /** Executes the underlying test definition. */ - public void execute() { - TreeSPath basePath = null; - StructureRegistry registry = null; - if (path != null) { - // TODO: generalize - basePath = new TreeSPath(path); - registry = new TreeSRegistry(); - } - + public void run() { uuid = UUID.randomUUID().toString(); if (testResult != null) testResult.notifyTestRun(this); // Structure - if (testResult != null && basePath != null + if (testResult != null && path != null && testResult instanceof StructureAware) ((StructureAware) testResult).notifyCurrentPath( - registry, basePath); + registry, path); - if (basePath != null && testDefinition instanceof StructureAware) + if (path != null && testDefinition instanceof StructureAware) ((StructureAware) testDefinition).notifyCurrentPath( - registry, basePath); + registry, path); testDefinition.execute(this); } @@ -127,7 +121,9 @@ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, } } - public void setPath(String path) { + public void notifyCurrentPath(StructureRegistry registry, + TreeSPath path) { + this.registry = registry; this.path = path; }