\r
import org.apache.tools.ant.BuildException;\r
\r
+import org.argeo.slc.ant.SlcAntConfig;\r
import org.argeo.slc.ant.spring.AbstractSpringArg;\r
import org.argeo.slc.ant.structure.SAwareTask;\r
-import org.argeo.slc.core.deploy.DeployedSystem;\r
+import org.argeo.slc.core.structure.StructureAware;\r
+import org.argeo.slc.core.test.SimpleTestRun;\r
import org.argeo.slc.core.test.TestData;\r
import org.argeo.slc.core.test.TestDefinition;\r
import org.argeo.slc.core.test.TestResult;\r
-import org.argeo.slc.core.test.TestRun;\r
\r
/** Ant task wrapping a test run. */\r
-public class SlcTestTask extends SAwareTask implements TestRun {\r
+public class SlcTestTask extends SAwareTask {\r
\r
private TestDefinitionArg testDefinitionArg;\r
private TestDataArg testDataArg;\r
\r
@Override\r
public void executeActions(String mode) throws BuildException {\r
- TestDefinition testDefinition = testDefinitionArg.getTestDefinition();\r
- testDefinition.execute(this);\r
+ SimpleTestRun simpleTestRun = (SimpleTestRun) getContext().getBean(\r
+ getProject().getUserProperty(\r
+ SlcAntConfig.DEFAULT_TEST_RUN_PROPERTY));\r
+ \r
+ if (testDataArg != null)\r
+ simpleTestRun.setTestData(testDataArg.getTestData());\r
+ if (testDefinitionArg != null)\r
+ simpleTestRun.setTestDefinition(testDefinitionArg\r
+ .getTestDefinition());\r
+\r
+ TestResult result = simpleTestRun.getTestResult();\r
+ if(result!=null && result instanceof StructureAware){\r
+ ((StructureAware)result).notifyCurrentPath(getRegistry(), getPath());\r
+ }\r
+ \r
+ simpleTestRun.execute();\r
}\r
\r
public TestDefinitionArg createTestDefinition() {\r
return testDataArg;\r
}\r
\r
- public DeployedSystem getDeployedSystem() {\r
- throw new RuntimeException("Not yet implemented.");\r
- }\r
-\r
- public TestDefinition getTestDefinition() {\r
- return testDefinitionArg.getTestDefinition();\r
- }\r
-\r
- public TestData getTestData() {\r
- return testDataArg.getTestData();\r
- }\r
-\r
- public TestResult getTestResult() {\r
- throw new RuntimeException("Not yet implemented.");\r
- }\r
-\r
}\r
\r
class TestDefinitionArg extends AbstractSpringArg {\r