]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc/src/test/java/org/argeo/slc/example/ExampleTask.java
Improve formatting of the code.
[gpl/argeo-slc.git] / org.argeo.slc / src / test / java / org / argeo / slc / example / ExampleTask.java
index 7e8b61733603633cac72edc00bd06077b854641f..c77e4513f7324ad862b65cd2d400c020ba0f3b21 100644 (file)
@@ -1,6 +1,7 @@
 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
@@ -9,33 +10,31 @@ import org.argeo.slc.core.test.TestDefinition;
 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