Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 7.0.0.Final
    • Fix Version/s: None
    • Component/s: Test Suite
    • Labels:
      None
    • Environment:
      7.1.0.Alpha1 Jenkins build 1402

      Description

      In JBoss 6 UserTransaction was exposed in JNDI named as java:comp/UserTransaction. Thus an Arquillian test method could be encapsulated in one single transaction:

      • lookup() the UserTransaction
      • begin() inside @Before
      • commit() inside @After
        Unfortunately, JBoss 7 doesn't have a JNDI entry for UserTransaction.

        Gliffy Diagrams

          Activity

          Hide
          jaikiran jaikiran pai added a comment -

          This appears more of a Arquillian question. The java:comp namespace is specific to components (like EJB, servlet etc...) and can only be used from within them. I don't know how Arquillian used to handle this in AS6.

          Assigning to Arquillian component.

          Show
          jaikiran jaikiran pai added a comment - This appears more of a Arquillian question. The java:comp namespace is specific to components (like EJB, servlet etc...) and can only be used from within them. I don't know how Arquillian used to handle this in AS6. Assigning to Arquillian component.
          Hide
          aslak Aslak Knutsen added a comment -

          This should work when using e.g. the Servlet Protocol where the test request in coming in via a Servlet and your associated with the War comp.

          Default in AS7 the test execution is going via a jmx-service, which is executed outside of your own comp. This service has access to the test deployments Module and AS7 Core, and should be able to associate the correct comp during execution some how..

          Show
          aslak Aslak Knutsen added a comment - This should work when using e.g. the Servlet Protocol where the test request in coming in via a Servlet and your associated with the War comp. Default in AS7 the test execution is going via a jmx-service, which is executed outside of your own comp. This service has access to the test deployments Module and AS7 Core, and should be able to associate the correct comp during execution some how..
          Show
          juergen.zimmermann Juergen Zimmermann added a comment - See http://community.jboss.org/thread/168952
          Hide
          aslak Aslak Knutsen added a comment -

          This works from within the TestCase itself.

          @RunWith(Arquillian.class)
          public class TransactionTestCase
          {
           
            @Resource(mappedName = "java:/module/UserTransaction")
            private UserTransaction trans;
            ...
          }
          

          Show
          aslak Aslak Knutsen added a comment - This works from within the TestCase itself. @RunWith(Arquillian.class) public class TransactionTestCase {   @Resource(mappedName = "java:/module/UserTransaction") private UserTransaction trans; ... }
          Hide
          bmajsak Bartosz Majsak added a comment -

          I came across similar problem recently while developing Arquillian extension and testing against managed AS 7.0.2.Final . If you use "java:jboss/UserTransaction" it works without any issues.

          Show
          bmajsak Bartosz Majsak added a comment - I came across similar problem recently while developing Arquillian extension and testing against managed AS 7.0.2.Final . If you use "java:jboss/UserTransaction" it works without any issues.
          Hide
          traviskds Travis De Silva added a comment -

          @Bartosz Majsak But adding "java:jboss/UserTransaction" makes it jboss dependent and not portable across JEE app servers right?

          Show
          traviskds Travis De Silva added a comment - @Bartosz Majsak But adding "java:jboss/UserTransaction" makes it jboss dependent and not portable across JEE app servers right?
          Hide
          bmajsak Bartosz Majsak added a comment -

          Sure it will make it not portable, but in my case (for Arquillian Persistence Extension) it wasn't really a problem. I just made it configurable

          Show
          bmajsak Bartosz Majsak added a comment - Sure it will make it not portable, but in my case (for Arquillian Persistence Extension) it wasn't really a problem. I just made it configurable
          Hide
          maschmid Marek Schmidt added a comment -

          @Travis, It would not be portable either way, the current JTA spec does not define the JNDI name for UserTransaction, AFAIK.

          Show
          maschmid Marek Schmidt added a comment - @Travis, It would not be portable either way, the current JTA spec does not define the JNDI name for UserTransaction, AFAIK.

            People

            • Assignee:
              alrubinger Andrew Rubinger
              Reporter:
              juergen.zimmermann Juergen Zimmermann
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development