Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-4686

CLONE - Problems in asynchronous invocation of bean with security domain definition after authenticated remote call to another bean

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.2.Final (EAP)
    • 7.1.1.Final
    • EJB, Security
    • None

    Description

      I have a security test which invokes bean asynchronously (https://github.com/ochaloup/jboss-as/blob/6cfe25f2bc05ca03592b465470b33e4f63d42de2/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/asynchronous/AsynchronousSecurityTestCase.java).
      The test is run (deployed) by arquillian on server.
      The test passes when I run it as single test.

      But when the test runs after a test which uses authentication on remote call (like org.jboss.as.test.integration.ejb.security.AnnSBTest, https://github.com/ochaloup/jboss-as/blob/6cfe25f2bc05ca03592b465470b33e4f63d42de2/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/AnnSBTest.java) then the asynchronous test fails.
      I was trying to debug the call and it seems to me that the security context seems not to be correctly passed to the bean.

      So I tried to rewrite the asynchronous test for not using asynchronous calls (I've removed them: https://github.com/ochaloup/jboss-as/blob/6fc6d199f1d9a9e8324a5c12dbaaf2fef635d2f6/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/security/asynchronous/AsynchronousSecurityTestCase.java) and after the change everything works fine. It works to be called as single test and as well as a subsequent test of an AnnSBTest.

      I've already discussed this issue with Daran via email and he asked me for check whether the preceding test are cleaning up after themselves. I'm filling this jira because after checking it I do not have any suspicion that some test does not clean resources. As well the test rewritten to not asynchronous calls works fine.

      You can try to run my "reproducer" - clone my my branch: JBQA-5483-test-migration-asynchronous (git clone git://github.com/ochaloup/jboss-as.git -b JBQA-5483-test-migration-asynchronous) and run
      ./build.sh clean install -e -DallTests -Dskip-download-sources -U -B -fae -Dmaven.test.skip.exec=true && ./integration-tests.sh clean install -Dts.noSmoke -Dts.basic

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            ochaloup@redhat.com Ondrej Chaloupka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: