X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Ftest%2Ftree%2FTreeTestResult.java;fp=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Ftest%2Ftree%2FTreeTestResult.java;h=36233e9942a2d321cb73b39d5d86842638adb275;hb=02b464f4fceaee1d65c711c868259879b02001b5;hp=3ce0c99b5a6408d324a990c048c1df93f3366357;hpb=4be456f18c71bf293632d365d790a2ef32728157;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java index 3ce0c99b5..36233e994 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java @@ -14,6 +14,7 @@ import org.argeo.slc.core.process.SlcExecution; import org.argeo.slc.core.process.SlcExecutionAware; import org.argeo.slc.core.process.SlcExecutionStep; import org.argeo.slc.core.structure.StructureAware; +import org.argeo.slc.core.structure.StructureElement; import org.argeo.slc.core.structure.StructureRegistry; import org.argeo.slc.core.structure.tree.TreeSPath; import org.argeo.slc.core.test.NumericTRId; @@ -26,7 +27,8 @@ import org.argeo.slc.core.test.TestResultPart; * Complex implementation of a test result compatible with a tree based * structure. */ -public class TreeTestResult implements TestResult, StructureAware, SlcExecutionAware { +public class TreeTestResult implements TestResult, StructureAware, + SlcExecutionAware { private Log log = LogFactory.getLog(TreeTestResult.class); /** For ORM */ private Long tid; @@ -90,7 +92,19 @@ public class TreeTestResult implements TestResult, StructureAware, Sl } } - public void notifyCurrentPath(StructureRegistry registry, TreeSPath path) { + public void notifyCurrentPath(StructureRegistry registry, + TreeSPath path) { + if (registry != null) { + for (TreeSPath p : path.getHierarchyAsList()) { + if (!pathNames.containsKey(p)) { + StructureElement elem = registry.getElement(p); + if (elem != null) { + pathNames.put(p, elem.getLabel()); + } + } + } + } + currentPath = (TreeSPath) path; this.registry = registry; } @@ -142,10 +156,9 @@ public class TreeTestResult implements TestResult, StructureAware, Sl } /** Sets the related registry. */ -// public void setRegistry(StructureRegistry registry) { -// this.registry = registry; -// } - + // public void setRegistry(StructureRegistry registry) { + // this.registry = registry; + // } public Date getCloseDate() { return closeDate; } @@ -158,9 +171,17 @@ public class TreeTestResult implements TestResult, StructureAware, Sl public void notifySlcExecution(SlcExecution slcExecution) { currentSlcExecutionUuid = slcExecution.getUuid(); SlcExecutionStep step = slcExecution.currentStep(); - if(step!=null){ + if (step != null) { currentSlcExecutionStepUuid = step.getUuid(); } } + public SortedMap getPathNames() { + return pathNames; + } + + public void setPathNames(SortedMap pathNames) { + this.pathNames = pathNames; + } + }