Currently the XTS unit tests deploy a servlet that is invoked by an ant script. By using Arquillian we should be able to remove the ant script and servlet then have Arquillian deploy the services and run the tests directly in the container.
Currently these are the steps that are ran:
- Deploy the tests to the AS
- Run XTS/localjunit/run-tests.xml which in turn invokes com.arjuna.qa.junit.LocalJUnitRunner for each group of tests.
- com.arjuna.qa.junit.LocalJUnitRunner invokes the com.arjuna.qa.junit.TestRunnerXMLServlet Servlet.
- TestRunnerXMLServlet then invokes a testsuite, for example: com.arjuna.wst11.tests.junit.TestSuite for the ws-t11 tests
- for example, com.arjuna.wst11.tests.junit.TestSuite comprises a number of JUnit tests whose results are returned as an XML response to the TestRunnerXMLServlet
- LocalJUnitRunner writes the response of the TestRunnerXMLServlet to the file system and registers a test failure if any of the tests failed.
There is a lot of code to run the tests. This could all be replaced by using Arquillian. The motivation here is less code to maintain and the ability to run tests directly from any ant runner.
I think the process we should follow is as follows:
- Figure out which tests are currently ran, I suspect it's only the WS-TX v1.1 tests that are ran, as I think the WS-TX 1.0 support is no longer needed. This can be done by tracing through from XTS/localjunit/run-tests.xml to see which servlets are invoked.
- Each servlet is configured to run a test suite. Each test suite lists a number of test classes.
- Report back to this issue stating which tests are ran. Can you produce a table for each servlet?
- Take one test class and convert that to Arquillian. You should just need to define an @Deployment method on the class and set the @RunWith.
- This test should be runnable from your IDE using the regular ant runner
- Report back to this issue when you are this far to review the pattern.
- Providing the pattern looks good, the next step should be to extend support the remaining TestCases in the TestSuite. I think they will all share a common @Deployment method, maybe you can use a base class.
- This suite should be runnable from your IDE using the regular ant runner
- Report back to this issue when you are this far to review the pattern.
- Providing the pattern looks good, the next step is to convert the remaining (used) TestSuites to use Arquillian.
- is related to
-
JBTM-968 Review the project structure of XTS
- Closed