Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-814

Should support injection of EJBs (as CDI Beans) in Weld Embedded

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Won't Do
    • weld_1.0.0.CR3
    • None
    • Weld Containers
    • None

    Description

      As seen in this post on the Arquillian forum, we cannot test that simple class as an NPE is thrown from org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.MockEjBServices which seems to be a copy of Weld code as Aslak Knutsen said.

      @RunWith(Arquillian.class)
      public class EJBTest {
          @Deployment
          public static JavaArchive createTestArchive() {
              return ShrinkWrap
                      .create(JavaArchive.class, "test.jar")
                      .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
          }
      
          @Stateless
          public static class SomeService {
              public String someMethod() {
                  return "test";
              }
          }
      
          @Inject
          SomeService someService;
      
          @Test
          public void testStatelessCall() {
              Assert.assertEquals("test", someService.someMethod());
          }
      }
      

      Attachments

        Activity

          People

            marko.luksa@gmail.com Marko Luksa (Inactive)
            aogier_jira Anthony O. (Inactive)
            Votes:
            18 Vote for this issue
            Watchers:
            16 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: