import org.apache.commons.logging.LogFactory;\r
\r
import org.argeo.slc.core.SlcException;\r
+import org.argeo.slc.core.process.SlcExecution;\r
+import org.argeo.slc.core.process.SlcExecutionAware;\r
+import org.argeo.slc.core.process.SlcExecutionStep;\r
import org.argeo.slc.core.structure.StructureAware;\r
-import org.argeo.slc.core.structure.StructurePath;\r
import org.argeo.slc.core.structure.StructureRegistry;\r
import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.NumericTRId;\r
* Complex implementation of a test result compatible with a tree based\r
* structure.\r
*/\r
-public class TreeTestResult implements TestResult, StructureAware {\r
+public class TreeTestResult implements TestResult, StructureAware<TreeSPath>, SlcExecutionAware {\r
private Log log = LogFactory.getLog(TreeTestResult.class);\r
/** For ORM */\r
private Long tid;\r
private List<TestResultListener> listeners = new Vector<TestResultListener>();\r
\r
private TreeSPath currentPath;\r
+ private String currentSlcExecutionUuid;\r
+ private String currentSlcExecutionStepUuid;\r
\r
private Date closeDate;\r
\r
private boolean isClosed = false;\r
\r
private SortedMap<TreeSPath, PartSubList> resultParts = new TreeMap<TreeSPath, PartSubList>();\r
+ private SortedMap<TreeSPath, String> pathNames = new TreeMap<TreeSPath, String>();\r
\r
- private StructureRegistry registry;\r
+ private StructureRegistry<TreeSPath> registry;\r
\r
public TestResultId getTestResultId() {\r
return testResultId;\r
PartSubList subList = resultParts.get(currentPath);\r
if (subList == null) {\r
subList = new PartSubList();\r
+ subList.setSlcExecutionUuid(currentSlcExecutionUuid);\r
+ subList.setSlcExecutionStepUuid(currentSlcExecutionStepUuid);\r
resultParts.put(currentPath, subList);\r
}\r
subList.getParts().add(part);\r
}\r
}\r
\r
- public void notifyCurrentPath(StructureRegistry registry, StructurePath path) {\r
+ public void notifyCurrentPath(StructureRegistry<TreeSPath> registry, TreeSPath path) {\r
currentPath = (TreeSPath) path;\r
this.registry = registry;\r
}\r
}\r
\r
/** Gets the related registry (can be null). */\r
- public StructureRegistry getRegistry() {\r
+ public StructureRegistry<TreeSPath> getRegistry() {\r
return registry;\r
}\r
\r
/** Sets the related registry. */\r
- public void setRegistry(StructureRegistry registry) {\r
- this.registry = registry;\r
- }\r
+// public void setRegistry(StructureRegistry<TreeSPath> registry) {\r
+// this.registry = registry;\r
+// }\r
\r
public Date getCloseDate() {\r
return closeDate;\r
this.closeDate = closeDate;\r
}\r
\r
+ public void notifySlcExecution(SlcExecution slcExecution) {\r
+ currentSlcExecutionUuid = slcExecution.getUuid();\r
+ SlcExecutionStep step = slcExecution.currentStep();\r
+ if(step!=null){\r
+ currentSlcExecutionStepUuid = step.getUuid();\r
+ }\r
+ }\r
+\r
}\r