1 package org
.argeo
.slc
.ant
.test
;
3 import org
.apache
.tools
.ant
.BuildException
;
5 import org
.argeo
.slc
.ant
.structure
.SAwareArg
;
6 import org
.argeo
.slc
.ant
.structure
.SAwareTask
;
7 import org
.argeo
.slc
.core
.deploy
.DeployedSystem
;
8 import org
.argeo
.slc
.core
.test
.TestData
;
9 import org
.argeo
.slc
.core
.test
.TestDefinition
;
10 import org
.argeo
.slc
.core
.test
.TestResult
;
11 import org
.argeo
.slc
.core
.test
.TestRun
;
13 /** Ant task wrapping a test run. */
14 public class SlcTestTask
extends SAwareTask
implements TestRun
{
16 private TestDefinitionArg testDefinitionArg
;
17 private TestDataArg testDataArg
;
20 public void executeActions(String mode
) throws BuildException
{
21 TestDefinition testDefinition
= testDefinitionArg
.getTestDefinition();
22 testDefinition
.execute(this);
25 public TestDefinitionArg
createTestDefinition() {
26 testDefinitionArg
= new TestDefinitionArg();
27 sAwareArgs
.add(testDefinitionArg
);
28 return testDefinitionArg
;
31 public TestDataArg
createTestData() {
32 testDataArg
= new TestDataArg();
33 sAwareArgs
.add(testDataArg
);
37 public DeployedSystem
getDeployedSystem() {
38 throw new RuntimeException("Not yet implemented.");
41 public TestDefinition
getTestDefinition() {
42 return testDefinitionArg
.getTestDefinition();
45 public TestData
getTestData() {
46 return testDataArg
.getTestData();
49 public TestResult
getTestResult() {
50 throw new RuntimeException("Not yet implemented.");
55 class TestDefinitionArg
extends SAwareArg
{
56 private TestDefinition testDefinition
;
58 public TestDefinition
getTestDefinition() {
59 if (testDefinition
== null) {
60 // don't call Spring each time in order not to multi-instantiate
62 testDefinition
= (TestDefinition
) getBeanInstance();
64 return testDefinition
;
68 class TestDataArg
extends SAwareArg
{
69 private TestData testData
;
71 public TestData
getTestData() {
72 if (testData
== null) {
73 // don't call Spring each time in order not to multi-instantiate
75 testData
= (TestData
) getBeanInstance();