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=b01e103ead65f5a3fc7086ebb7a986aa64ccdf93;hb=cebfbf8efbf6a6b99a543bd309d2976478123989;hp=f48e21165998ff68bfd1ac9107e3f47dc804b632;hpb=7804a8856f205e744a374696951c31d0ba068798;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 f48e21165..b01e103ea 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,21 +2,35 @@ 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.SlcExecutionRelated; -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, SlcExecutionRelated { +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; @@ -27,6 +41,17 @@ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, SlcExe 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); } @@ -96,4 +121,10 @@ public class SimpleTestRun implements WritableTestRun, ExecutableTestRun, SlcExe } } + public void notifyCurrentPath(StructureRegistry registry, + TreeSPath path) { + this.registry = registry; + this.path = path; + } + }