Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-954

Update the XTS unit tests to use Arquillian

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 4.17.0
    • None
    • Testing, XTS
    • None

    Description

      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:

      1. Deploy the tests to the AS
      2. Run XTS/localjunit/run-tests.xml which in turn invokes com.arjuna.qa.junit.LocalJUnitRunner for each group of tests.
      3. com.arjuna.qa.junit.LocalJUnitRunner invokes the com.arjuna.qa.junit.TestRunnerXMLServlet Servlet.
      4. TestRunnerXMLServlet then invokes a testsuite, for example: com.arjuna.wst11.tests.junit.TestSuite for the ws-t11 tests
      5. 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
      6. 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:

      1. 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.
        1. Each servlet is configured to run a test suite. Each test suite lists a number of test classes.
        2. Report back to this issue stating which tests are ran. Can you produce a table for each servlet?
      2. 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.
        1. This test should be runnable from your IDE using the regular ant runner
        2. Report back to this issue when you are this far to review the pattern.
      3. 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.
        1. This suite should be runnable from your IDE using the regular ant runner
        2. Report back to this issue when you are this far to review the pattern.
      4. Providing the pattern looks good, the next step is to convert the remaining (used) TestSuites to use Arquillian.

      Attachments

        Issue Links

          Activity

            People

              paul.robinson@redhat.com Paul Robinson
              paul.robinson@redhat.com Paul Robinson
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: