Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-980

Java EE 7 samples: CDI injection fails in some Arquillian in-container tests

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Some of the Java EE 7 Samples tests exhibit weird CDI injection issues.

      Specifically:

      • jpa/jpa-converter
      • jta/transactional
      • cdi/nobeans-xml

      These are all in-container Arquillian tests that construct a JAR archive without beans.xml. The tests fail during CDI injection point validation, because there's no bean suitable for injection.

      One other test:

      • cdi/bean-discovery-none

      Is quite similar: this in-container Arquillian test constructs a JAR with beans.xml which specifies bean-discovery-mode="none". Then, it tries to inject a BeanManager and check that the BeanManager indeed doesn't have any suitable bean for some class. However, the BeanManager itself isn't injected at all, so the test fails with a NPE.

      All these tests pass just fine with WildFly.

      Steps to reproduce:

      # install Swarm with Arquillian fraction autodetection support
      git clone -b javaee7-samples-testing https://github.com/Ladicek/wildfly-swarm.git
      cd wildfly-swarm
      mvn clean install -DskipTests
      
      # set up the Java EE 7 Samples project
      cd ..
      git clone -b wildfly-swarm https://github.com/Ladicek/javaee7-samples.git
      cd javaee7-samples
      mvn clean install -DskipTests
      
      # run the test
      cd $MODULE # one of jpa/jpa-converter, jta/transactional, cdi/nobeans-xml, cdi/bean-discovery-none
      mvn clean test -fae -Pwildfly-managed-arquillian   # with WildFly
      mvn clean test -fae -Pwildfly-swarm-arquillian     # with Swarm
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kenfinni Ken Finnigan
                  Reporter:
                  lthon Ladislav Thon
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: