Arquillian
  1. Arquillian
  2. ARQ-543

CDI injection into testcase does not work on GlassFish

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Blocker Blocker
    • Resolution: Done
    • Affects Version/s: glassfish_1.0.0.CR1
    • Fix Version/s: glassfish_1.0.0.CR2
    • Component/s: GlassFish Containers
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      arquillian-glassfish-remote-3.1 - 1.0.0.CR1, 1.0.0.Final-SNAPSHOT
      arquillian-core-impl-base - 1.0.0.CR1
      GlassFish 3.1.1
    • Affects:
      Release Notes
    • Similar Issues:
      Show 10 results 

      Description

      Having the following testcase:

      @RunWith(Arquillian.class)
      public class FooTest {
      
          @Inject
          private Foo foo;
      
          @Deployment
          public static JavaArchive deploy() {
              return ShrinkWrap.create(JavaArchive.class, "foo.jar").addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                      .addClasses(Foo.class, FooTest.class);
          }
      
          @Test
          public void test() {
              Assert.assertNotNull(foo);
          }
      }
      
      public class Foo {
      }
      

      the test always fails on Glassfish while it works fine on JBoss AS 7.

        Activity

        Hide
        Aslak Knutsen
        added a comment -

        Which GlassFish container type, remote or embedded ? Which GlassFish version?

        Using GlassFish Container 1.0.0.CR1-SNAPSHOT ?
        Using Arq Core 1.0.0.CR1 ?

        Show
        Aslak Knutsen
        added a comment - Which GlassFish container type, remote or embedded ? Which GlassFish version? Using GlassFish Container 1.0.0.CR1-SNAPSHOT ? Using Arq Core 1.0.0.CR1 ?
        Hide
        Jozef Hartinger
        added a comment -

        More info added.

        Show
        Jozef Hartinger
        added a comment - More info added.
        Hide
        Aslak Knutsen
        added a comment -

        The GlassFish container is missing the dep on arquillian-testenricher-initialcontext module which provides the InitialContext for the CDI Enricher to lookup BeanManager.

        Show
        Aslak Knutsen
        added a comment - The GlassFish container is missing the dep on arquillian-testenricher-initialcontext module which provides the InitialContext for the CDI Enricher to lookup BeanManager.
        Hide
        Aslak Knutsen
        added a comment -

        pushed upstream

        Show
        Aslak Knutsen
        added a comment - pushed upstream
        Hide
        Jozef Hartinger
        added a comment -

        Verified on upstream.

        Show
        Jozef Hartinger
        added a comment - Verified on upstream.

          People

          • Assignee:
            Aslak Knutsen
            Reporter:
            Jozef Hartinger
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: