]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.example/src/main/java/org/argeo/slc/example/ExampleTask.java
Various fixes so that SLC example works again
[gpl/argeo-slc.git] / org.argeo.slc.example / src / main / java / org / argeo / slc / example / ExampleTask.java
1 package org.argeo.slc.example;
2
3 import org.argeo.slc.core.structure.SimpleSElement;
4 import org.argeo.slc.core.structure.StructureAware;
5 import org.argeo.slc.core.structure.StructureElement;
6 import org.argeo.slc.core.structure.StructureElementProvider;
7 import org.argeo.slc.core.structure.StructurePath;
8 import org.argeo.slc.core.structure.StructureRegistry;
9 import org.argeo.slc.core.structure.tree.TreeSPath;
10 import org.argeo.slc.core.test.SimpleResultPart;
11 import org.argeo.slc.core.test.TestDefinition;
12 import org.argeo.slc.core.test.TestResult;
13 import org.argeo.slc.core.test.TestRun;
14
15 /** Example task. */
16 public class ExampleTask implements StructureAware<TreeSPath>, TestDefinition,
17 StructureElementProvider {
18 private TreeSPath path;
19 private String description;
20
21 public void execute(TestRun testRun) {
22 SimpleResultPart part = new SimpleResultPart(PASSED,
23 "Sub task with path " + path + " executed", null);
24
25 TestResult result = testRun.getTestResult();
26 result.addResultPart(part);
27 }
28
29 public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,
30 TreeSPath path) {
31 this.path = path;
32 }
33
34 public StructureElement createStructureElement() {
35 return new SimpleSElement(description);
36 }
37
38 /** Sets the description. */
39 public void setDescription(String description) {
40 this.description = description;
41 }
42
43 }