\r
import org.apache.commons.logging.Log;\r
import org.apache.commons.logging.LogFactory;\r
-\r
import org.argeo.slc.core.structure.SimpleSElement;\r
import org.argeo.slc.core.structure.StructureAware;\r
import org.argeo.slc.core.structure.StructureElement;\r
-import org.argeo.slc.core.structure.StructurePath;\r
+import org.argeo.slc.core.structure.StructureElementProvider;\r
import org.argeo.slc.core.structure.StructureRegistry;\r
import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.TestDefinition;\r
* children.\r
*/\r
public class CompositeTreeTestDefinition implements TestDefinition,\r
- StructureAware {\r
+ StructureAware<TreeSPath> {\r
private Log log = LogFactory.getLog(CompositeTreeTestDefinition.class);\r
\r
private List<TestDefinition> tasks = null;\r
private List<TreeSPath> taskPaths = null;\r
private TreeSPath path;\r
- private StructureRegistry registry;\r
+ private StructureRegistry<TreeSPath> registry;\r
\r
public void execute(TestRun testRun) {\r
- log.info("Execute sequence of test definitions...");\r
+ if (log.isTraceEnabled())\r
+ log.trace("Execute sequence of test definitions...");\r
\r
int i = 0;\r
for (TestDefinition task : tasks) {\r
}\r
}\r
\r
- public void notifyCurrentPath(StructureRegistry registry, StructurePath path) {\r
- this.path = (TreeSPath) path;\r
+ public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,\r
+ TreeSPath path) {\r
+ this.path = path;\r
this.registry = registry;\r
- \r
+\r
// clear task paths\r
taskPaths.clear();\r
\r
Integer count = 0;\r
for (TestDefinition task : tasks) {\r
final StructureElement element;\r
- if (task instanceof StructureElement) {\r
- element = (StructureElement) task;\r
+ if (task instanceof StructureElementProvider) {\r
+ element = ((StructureElementProvider) task)\r
+ .createStructureElement();\r
} else {\r
element = new SimpleSElement("[no desc]");\r
}\r
registry.register(taskPath, element);\r
taskPaths.add(taskPath);\r
if (task instanceof StructureAware) {\r
- ((StructureAware) task).notifyCurrentPath(registry, taskPath);\r
+ ((StructureAware<TreeSPath>) task).notifyCurrentPath(registry,\r
+ taskPath);\r
}\r
count++;\r
}\r