]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc/src/test/java/org/argeo/slc/example/ExampleTask.java
Improve comments
[gpl/argeo-slc.git] / org.argeo.slc / src / test / java / org / argeo / slc / example / ExampleTask.java
index 09561607f98c5a93725970393ef56f026f6ac58b..9da9c8e481f233610993325e56813509f97809ab 100644 (file)
@@ -1,8 +1,40 @@
 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