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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 2017.2.0
    • None
    • 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
      

      Attachments

        Issue Links

          Activity

            People

              kfinniga@redhat.com Ken Finnigan
              lthon@redhat.com Ladislav Thon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: