]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.core/src/main/java/org/argeo/slc/msg/test/tree/ResultPartRequest.java
Fix the format of tree test result attributes.
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / msg / test / tree / ResultPartRequest.java
index ac09087114e7d4bd8f60b3c3305aaf7a88d8c1d3..0b4278f34d5ff1483856320567fcc8f102841342 100644 (file)
@@ -1,9 +1,9 @@
 package org.argeo.slc.msg.test.tree;\r
 \r
 import java.util.Map;\r
+import java.util.SortedMap;\r
 \r
 import org.argeo.slc.core.SlcException;\r
-import org.argeo.slc.core.process.SlcExecution;\r
 import org.argeo.slc.core.structure.StructureElement;\r
 import org.argeo.slc.core.structure.tree.TreeSPath;\r
 import org.argeo.slc.core.test.SimpleResultPart;\r
@@ -17,6 +17,7 @@ public class ResultPartRequest {
        private TreeSPath path;\r
        private Map<TreeSPath, StructureElement> relatedElements;\r
        private TestRunDescriptor testRunDescriptor;\r
+       private Map<String, String> attributes;\r
 \r
        public ResultPartRequest() {\r
 \r
@@ -26,10 +27,11 @@ public class ResultPartRequest {
                        SimpleResultPart resultPart) {\r
                resultUuid = ttr.getUuid();\r
                this.resultPart = resultPart;\r
-               this.path = path;\r
-               relatedElements = ttr.getRelatedElements(path);\r
+               this.path = (path != null ? path : ttr.getCurrentPath());\r
+               relatedElements = ttr.getRelatedElements(this.path);\r
                if (ttr.getCurrentTestRun() != null)\r
                        testRunDescriptor = new TestRunDescriptor(ttr.getCurrentTestRun());\r
+               attributes = ttr.getAttributes();\r
        }\r
 \r
        public ResultPartRequest(TreeTestResult ttr) {\r
@@ -90,4 +92,16 @@ public class ResultPartRequest {
                this.relatedElements = relatedElements;\r
        }\r
 \r
+       public Map<String, String> getAttributes() {\r
+               return attributes;\r
+       }\r
+\r
+       public void setAttributes(SortedMap<String, String> attributes) {\r
+               this.attributes = attributes;\r
+       }\r
+\r
+       @Override\r
+       public String toString() {\r
+               return getClass().getSimpleName() + "#" + resultUuid + " " + path;\r
+       }\r
 }\r