[weld-issues] [JBoss JIRA] (WELD-1086) NPE while using Weld EE to test EJB

Anthony O. (JIRA) jira-events at lists.jboss.org
Tue Mar 13 12:45:47 EDT 2012


     [ https://issues.jboss.org/browse/WELD-1086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anthony O. updated WELD-1086:
-----------------------------

    Attachment: EJBTest.java


The test case.
                
> NPE while using Weld EE to test EJB
> -----------------------------------
>
>                 Key: WELD-1086
>                 URL: https://issues.jboss.org/browse/WELD-1086
>             Project: Weld
>          Issue Type: Bug
>          Components: Testing Infrastructure (Mocks and Harness Integration)
>    Affects Versions: 1.1.2.Final
>            Reporter: Anthony O.
>         Attachments: EJBTest.java
>
>
> As seen in [this post on the Arquillian forum|https://community.jboss.org/message/723563], 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|https://community.jboss.org/people/aslak] said.
> {code}
> @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());
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list