package org.argeo.slc.example;\r
\r
import org.argeo.slc.core.structure.StructureAware;\r
+import org.argeo.slc.core.structure.StructureElement;\r
import org.argeo.slc.core.structure.StructurePath;\r
import org.argeo.slc.core.structure.StructureRegistry;\r
import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.TestResult;\r
import org.argeo.slc.core.test.TestRun;\r
\r
-public class ExampleTask implements StructureAware,TestDefinition{\r
+/** Example task.*/\r
+public class ExampleTask implements StructureAware, TestDefinition,\r
+ StructureElement {\r
private TreeSPath path;\r
private String description;\r
\r
- public void execute(TestRun testRun){\r
- SimpleResultPart part = new SimpleResultPart();\r
- part.setStatus(SimpleResultPart.PASSED);\r
- part.setMessage("Sub task executed");\r
- \r
+ public void execute(TestRun testRun) {\r
+ SimpleResultPart part = new SimpleResultPart(PASSED,\r
+ "Sub task with path " + path + " executed", null);\r
+\r
TestResult result = testRun.getTestResult();\r
- if(result instanceof StructureAware){\r
- ((StructureAware)result).notifyCurrentPath(null, path);\r
- }\r
result.addResultPart(part);\r
}\r
\r
public void notifyCurrentPath(StructureRegistry registry, StructurePath path) {\r
- this.path = (TreeSPath)path; \r
+ this.path = (TreeSPath) path;\r
}\r
\r
public String getDescription() {\r
return description;\r
}\r
\r
+ /** Sets the description.*/\r
public void setDescription(String description) {\r
this.description = description;\r
}\r
- \r
- \r
+\r
}\r