\r
import java.util.Map;\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
-import org.argeo.slc.core.test.TestResultPart;\r
import org.argeo.slc.core.test.TestRunDescriptor;\r
+import org.argeo.slc.core.test.tree.PartSubList;\r
import org.argeo.slc.core.test.tree.TreeTestResult;\r
\r
public class ResultPartRequest {\r
private String resultUuid;\r
- private TestResultPart resultPart;\r
+ private SimpleResultPart resultPart;\r
private TreeSPath path;\r
private Map<TreeSPath, StructureElement> relatedElements;\r
private TestRunDescriptor testRunDescriptor;\r
}\r
\r
public ResultPartRequest(TreeTestResult ttr, TreeSPath path,\r
- TestResultPart resultPart) {\r
+ SimpleResultPart resultPart) {\r
resultUuid = ttr.getUuid();\r
this.resultPart = resultPart;\r
this.path = path;\r
testRunDescriptor = new TestRunDescriptor(ttr.getCurrentTestRun());\r
}\r
\r
+ public ResultPartRequest(TreeTestResult ttr) {\r
+ resultUuid = ttr.getUuid();\r
+ this.path = ttr.getCurrentPath();\r
+\r
+ PartSubList lst = ttr.getResultParts().get(path);\r
+ if (lst.getParts().size() < 1) {\r
+ throw new SlcException("Cannot find part for path " + path\r
+ + " in result " + resultUuid);\r
+ }\r
+\r
+ this.resultPart = (SimpleResultPart) lst.getParts().get(\r
+ lst.getParts().size() - 1);\r
+ relatedElements = ttr.getRelatedElements(path);\r
+ if (ttr.getCurrentTestRun() != null)\r
+ testRunDescriptor = new TestRunDescriptor(ttr.getCurrentTestRun());\r
+ }\r
+\r
public String getResultUuid() {\r
return resultUuid;\r
}\r
this.resultUuid = resultUuid;\r
}\r
\r
- public TestResultPart getResultPart() {\r
+ public SimpleResultPart getResultPart() {\r
return resultPart;\r
}\r
\r
- public void setResultPart(TestResultPart resultPart) {\r
+ public void setResultPart(SimpleResultPart resultPart) {\r
this.resultPart = resultPart;\r
}\r
\r