[arquillian-issues] [JBoss JIRA] Issue Comment Edited: (ARQ-271) TestEnricher should be called in @BeforeClass

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Fri Apr 29 09:07:18 EDT 2011


    [ https://issues.jboss.org/browse/ARQ-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599025#comment-12599025 ] 

Thomas Diesler edited comment on ARQ-271 at 4/29/11 9:05 AM:
-------------------------------------------------------------

BundleContext is still not injected at @BeforeClass

{code}
java.lang.AssertionError: BundleContext injected
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at org.junit.Assert.assertNotNull(Assert.java:524)
	at org.jboss.arquillian.container.osgi.arq271.ARQ271BeforeClassTestCase.beforeClass(ARQ271BeforeClassTestCase.java:76)
{code}

https://github.com/tdiesler/arquillian-container-osgi/tree/ARQ-271

Maybe the test instance that is loaded from the test bundle does not get treated in the same way as on the client side

      was (Author: thomas.diesler):
    BundleContext is still not injected at @BeforeClass

{code}
java.lang.AssertionError: BundleContext injected
	at org.junit.Assert.fail(Assert.java:91)
	at org.junit.Assert.assertTrue(Assert.java:43)
	at org.junit.Assert.assertNotNull(Assert.java:524)
	at org.jboss.arquillian.container.osgi.arq271.ARQ271BeforeClassTestCase.beforeClass(ARQ271BeforeClassTestCase.java:76)
{code}

https://github.com/tdiesler/arquillian-container-osgi/tree/ARQ-271
  
> TestEnricher should be called in @BeforeClass
> ---------------------------------------------
>
>                 Key: ARQ-271
>                 URL: https://issues.jboss.org/browse/ARQ-271
>             Project: Arquillian
>          Issue Type: Feature Request
>          Components: Runtime Enricher SPI, Test Harness Integration
>            Reporter: Thomas Diesler
>            Assignee: Aslak Knutsen
>
> The TestEnricher API could be extended such that static fields can be initialized.
>    @Inject
>    public static BundleContext context;
>    
>    @BeforeClass
>    public static void beforeClass()
>    {
>       System.out.println("BeforeClass: " + context);
>    }
> There would be two calls to TestEnricher. 
> #1 After test class load, but before a call to @BeforeClass. 
> #2 After instantiation of the test class, but before a call to @Before 
> (#2 is the current behaviour)

--
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