1 package org
.argeo
.slc
.msg
.test
.tree
;
5 import org
.argeo
.slc
.core
.SlcException
;
6 import org
.argeo
.slc
.core
.structure
.StructureElement
;
7 import org
.argeo
.slc
.core
.structure
.tree
.TreeSPath
;
8 import org
.argeo
.slc
.core
.test
.SimpleResultPart
;
9 import org
.argeo
.slc
.core
.test
.TestRunDescriptor
;
10 import org
.argeo
.slc
.core
.test
.tree
.PartSubList
;
11 import org
.argeo
.slc
.core
.test
.tree
.TreeTestResult
;
13 public class ResultPartRequest
{
14 private String resultUuid
;
15 private SimpleResultPart resultPart
;
16 private TreeSPath path
;
17 private Map
<TreeSPath
, StructureElement
> relatedElements
;
18 private TestRunDescriptor testRunDescriptor
;
20 public ResultPartRequest() {
24 public ResultPartRequest(TreeTestResult ttr
, TreeSPath path
,
25 SimpleResultPart resultPart
) {
26 resultUuid
= ttr
.getUuid();
27 this.resultPart
= resultPart
;
29 relatedElements
= ttr
.getRelatedElements(path
);
30 if (ttr
.getCurrentTestRun() != null)
31 testRunDescriptor
= new TestRunDescriptor(ttr
.getCurrentTestRun());
34 public ResultPartRequest(TreeTestResult ttr
) {
35 resultUuid
= ttr
.getUuid();
36 this.path
= ttr
.getCurrentPath();
38 PartSubList lst
= ttr
.getResultParts().get(path
);
39 if (lst
.getParts().size() < 1) {
40 throw new SlcException("Cannot find part for path " + path
41 + " in result " + resultUuid
);
44 this.resultPart
= (SimpleResultPart
) lst
.getParts().get(
45 lst
.getParts().size() - 1);
46 relatedElements
= ttr
.getRelatedElements(path
);
47 if (ttr
.getCurrentTestRun() != null)
48 testRunDescriptor
= new TestRunDescriptor(ttr
.getCurrentTestRun());
51 public String
getResultUuid() {
55 public void setResultUuid(String resultUuid
) {
56 this.resultUuid
= resultUuid
;
59 public SimpleResultPart
getResultPart() {
63 public void setResultPart(SimpleResultPart resultPart
) {
64 this.resultPart
= resultPart
;
67 public TreeSPath
getPath() {
71 public void setPath(TreeSPath path
) {
75 public TestRunDescriptor
getTestRunDescriptor() {
76 return testRunDescriptor
;
79 public void setTestRunDescriptor(TestRunDescriptor testRunDescriptor
) {
80 this.testRunDescriptor
= testRunDescriptor
;
83 public Map
<TreeSPath
, StructureElement
> getRelatedElements() {
84 return relatedElements
;
87 public void setRelatedElements(
88 Map
<TreeSPath
, StructureElement
> relatedElements
) {
89 this.relatedElements
= relatedElements
;