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

Test that SRA annotations work with two participants

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 5.12.7.Final
    • 5.12.6.Final
    • REST
    • None

      The testing of REST-AT annotations (SRA) only registers a single participant which means the prepare phase of the SRA termination protocol is skipped. This issue is to add some extra tests that enlist multiple participants within a transaction so that the prepare phase gets tested as well.

      The existing SRA tests creates a JAX-RS service called `SRAParticipant` which gets registered automatically during rest calls to the endpoints annotated with `@SRA`. You will need to create a second JAX-RS resource. Make a call to the first one with the `end` attribute of the @SRA annotation set to false. This will enlist the participant in an SRA. Use the returned SRA id to invoke an @SRA annotated method on the second participant which will enlist it with the same SRA (you need a second class because the SRA participant termination endpoints must be unique). Since the SRA now contains two participants, calling commit on the SRA will cause the prepare and commit endpoints to be invoked when the SRA is committed.

      Note that the REST-AT specification is fully tested in the test SpecTest.java class so use that to see how things are done using REST calls to the coordinator (as opposed to via annotations).

              rh-ee-msappegr Marco Sappe Griot
              rhn-engineering-mmusgrov Michael Musgrove
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: