[arquillian-issues] [JBoss JIRA] Resolved: (ARQ-372) The @EJB annotation does not work in a TestCase that extends abstract class

Aslak Knutsen (JIRA) jira-events at lists.jboss.org
Wed Mar 16 15:47:46 EDT 2011


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

Aslak Knutsen resolved ARQ-372.
-------------------------------

         Assignee: David Allen
    Fix Version/s: 1.0.0.Alpha5
       Resolution: Done


pushed upstream master

> The @EJB annotation does not work in a TestCase that extends abstract class
> ---------------------------------------------------------------------------
>
>                 Key: ARQ-372
>                 URL: https://issues.jboss.org/browse/ARQ-372
>             Project: Arquillian
>          Issue Type: Bug
>          Components: Runtime Enricher SPI
>    Affects Versions: 1.0.0.Alpha4
>         Environment: Arquillian Version 1.0.0 Alpha4
> openejb 3.1
> junit 4.8.2
>            Reporter: Leopold Odenthal
>            Assignee: David Allen
>             Fix For: 1.0.0.Alpha5
>
>
> The Problem is within a abstract class that contains @EJB annotation.
> When a testcase extens that abstract class the Beans will not be injected.
> Here is a example code:
>  
> @RunWith(Arquillian.class)
> public abstract class AbstractTestContext
> {
>      @EJB
>      protected BeanOne beanOne;
>     
>      @EJB
>      protected BeanTwo beanTwo;
>  
>      @Deployment
>      public static JavaArchive getContextDeployment()
>      {
>           return ShrinkWrap.create(JavaArchive.class, "test.jar")
>                .addPackages(true, RootClass.class.getPackage())
>                .addManifestResource("persistence.xml");
>      }
> }
>  
> public class MyTest extends AbstractTestContext
> {
>      @Test
>      public void testBeanOne()
>      {
>           Assert.assertNotNull(beanOne);
>      }
>     
>      @Test
>      public void testBeanOne()
>      {
>           Assert.assertNotNull(beanOne);
>      }
> }
>  
> After searching the Arquillian code i found the code for my problem in the TestEnricher API.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the arquillian-issues mailing list