import org.argeo.slc.process.SlcExecutionRelated;\r
import org.argeo.slc.process.SlcExecutionStep;\r
import org.argeo.slc.structure.StructureAware;\r
+import org.argeo.slc.structure.StructureElement;\r
import org.argeo.slc.structure.StructureRegistry;\r
import org.argeo.slc.test.ExecutableTestRun;\r
import org.argeo.slc.test.TestData;\r
* references to the various parts of a test run.\r
*/\r
public class SimpleTestRun implements WritableTestRun, ExecutableTestRun,\r
- SlcExecutionRelated {\r
+ SlcExecutionRelated, StructureAware<TreeSPath> {\r
private String uuid;\r
\r
private String slcExecutionUuid;\r
private String slcExecutionStepUuid;\r
\r
- private String path;\r
+ private TreeSPath path;\r
+ private StructureRegistry<TreeSPath> registry;\r
\r
private DeployedSystem deployedSystem;\r
private TestData testData;\r
private TestResult testResult;\r
\r
/** Executes the underlying test definition. */\r
- public void execute() {\r
- TreeSPath basePath = null;\r
- StructureRegistry<TreeSPath> registry = null;\r
- if (path != null) {\r
- // TODO: generalize\r
- basePath = new TreeSPath(path);\r
- registry = new TreeSRegistry();\r
- }\r
-\r
+ public void run() {\r
uuid = UUID.randomUUID().toString();\r
if (testResult != null)\r
testResult.notifyTestRun(this);\r
\r
// Structure\r
- if (testResult != null && basePath != null\r
+ if (testResult != null && path != null\r
&& testResult instanceof StructureAware)\r
((StructureAware<TreeSPath>) testResult).notifyCurrentPath(\r
- registry, basePath);\r
+ registry, path);\r
\r
- if (basePath != null && testDefinition instanceof StructureAware)\r
+ if (path != null && testDefinition instanceof StructureAware)\r
((StructureAware<TreeSPath>) testDefinition).notifyCurrentPath(\r
- registry, basePath);\r
+ registry, path);\r
\r
testDefinition.execute(this);\r
}\r
}\r
}\r
\r
- public void setPath(String path) {\r
+ public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,\r
+ TreeSPath path) {\r
+ this.registry = registry;\r
this.path = path;\r
}\r
\r