1 package org
.argeo
.slc
.msg
.test
.tree
;
4 import java
.util
.SortedMap
;
6 import org
.argeo
.slc
.SlcException
;
7 import org
.argeo
.slc
.core
.structure
.tree
.TreeSPath
;
8 import org
.argeo
.slc
.core
.test
.SimpleResultPart
;
9 import org
.argeo
.slc
.core
.test
.tree
.PartSubList
;
10 import org
.argeo
.slc
.core
.test
.tree
.TreeTestResult
;
11 import org
.argeo
.slc
.structure
.StructureElement
;
12 import org
.argeo
.slc
.test
.TestRunDescriptor
;
14 public class ResultPartRequest
{
15 private String resultUuid
;
16 private SimpleResultPart resultPart
;
17 private TreeSPath path
;
18 private Map
<TreeSPath
, StructureElement
> relatedElements
;
19 private TestRunDescriptor testRunDescriptor
;
20 private Map
<String
, String
> attributes
;
22 public ResultPartRequest() {
26 public ResultPartRequest(TreeTestResult ttr
, TreeSPath path
,
27 SimpleResultPart resultPart
) {
28 resultUuid
= ttr
.getUuid();
29 this.resultPart
= resultPart
;
30 this.path
= (path
!= null ? path
: ttr
.getCurrentPath());
31 relatedElements
= ttr
.getRelatedElements(this.path
);
32 if (ttr
.getCurrentTestRun() != null)
33 testRunDescriptor
= new TestRunDescriptor(ttr
.getCurrentTestRun());
34 attributes
= ttr
.getAttributes();
37 public ResultPartRequest(TreeTestResult ttr
) {
38 resultUuid
= ttr
.getUuid();
39 this.path
= ttr
.getCurrentPath();
41 PartSubList lst
= ttr
.getResultParts().get(path
);
42 if (lst
.getParts().size() < 1) {
43 throw new SlcException("Cannot find part for path " + path
44 + " in result " + resultUuid
);
47 this.resultPart
= (SimpleResultPart
) lst
.getParts().get(
48 lst
.getParts().size() - 1);
49 relatedElements
= ttr
.getRelatedElements(path
);
50 if (ttr
.getCurrentTestRun() != null)
51 testRunDescriptor
= new TestRunDescriptor(ttr
.getCurrentTestRun());
54 public String
getResultUuid() {
58 public void setResultUuid(String resultUuid
) {
59 this.resultUuid
= resultUuid
;
62 public SimpleResultPart
getResultPart() {
66 public void setResultPart(SimpleResultPart resultPart
) {
67 this.resultPart
= resultPart
;
70 public TreeSPath
getPath() {
74 public void setPath(TreeSPath path
) {
78 public TestRunDescriptor
getTestRunDescriptor() {
79 return testRunDescriptor
;
82 public void setTestRunDescriptor(TestRunDescriptor testRunDescriptor
) {
83 this.testRunDescriptor
= testRunDescriptor
;
86 public Map
<TreeSPath
, StructureElement
> getRelatedElements() {
87 return relatedElements
;
90 public void setRelatedElements(
91 Map
<TreeSPath
, StructureElement
> relatedElements
) {
92 this.relatedElements
= relatedElements
;
95 public Map
<String
, String
> getAttributes() {
99 public void setAttributes(SortedMap
<String
, String
> attributes
) {
100 this.attributes
= attributes
;
104 public String
toString() {
105 return getClass().getSimpleName() + "#" + resultUuid
+ " " + path
;