package org.argeo.slc.example;\r
\r
-public class ExampleTask {\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.SimpleResultPart;\r
+import org.argeo.slc.core.test.TestDefinition;\r
+import org.argeo.slc.core.test.TestResult;\r
+import org.argeo.slc.core.test.TestRun;\r
\r
- public void execute(){\r
- \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(PASSED,\r
+ "Sub task with path " + path + " executed", null);\r
+\r
+ TestResult result = testRun.getTestResult();\r
+ result.addResultPart(part);\r
}\r
+\r
+ public void notifyCurrentPath(StructureRegistry registry, StructurePath 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