]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc/src/test/java/org/argeo/slc/example/ExampleTask.java
Introduce complex tree test definition
[gpl/argeo-slc.git] / org.argeo.slc / src / test / java / org / argeo / slc / example / ExampleTask.java
1 package org.argeo.slc.example;
2
3 import org.argeo.slc.core.structure.StructureAware;
4 import org.argeo.slc.core.structure.StructureElement;
5 import org.argeo.slc.core.structure.StructurePath;
6 import org.argeo.slc.core.structure.StructureRegistry;
7 import org.argeo.slc.core.structure.tree.TreeSPath;
8 import org.argeo.slc.core.test.SimpleResultPart;
9 import org.argeo.slc.core.test.TestDefinition;
10 import org.argeo.slc.core.test.TestResult;
11 import org.argeo.slc.core.test.TestRun;
12
13 public class ExampleTask implements StructureAware, TestDefinition,
14 StructureElement {
15 private TreeSPath path;
16 private String description;
17
18 public void execute(TestRun testRun) {
19 SimpleResultPart part = new SimpleResultPart();
20 part.setStatus(SimpleResultPart.PASSED);
21 part.setMessage("Sub task with path " + path + " executed");
22
23 TestResult result = testRun.getTestResult();
24 result.addResultPart(part);
25 }
26
27 public void notifyCurrentPath(StructureRegistry registry, StructurePath path) {
28 this.path = (TreeSPath) path;
29 }
30
31 public String getDescription() {
32 return description;
33 }
34
35 public void setDescription(String description) {
36 this.description = description;
37 }
38
39 }