[arquillian-issues] [JBoss JIRA] (ARQ-1586) ClassContextImpl is not active during TestNG @BeforeMethod

Juraj Húska (JIRA) jira-events at lists.jboss.org
Thu Nov 28 11:22:06 EST 2013


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

Juraj Húska commented on ARQ-1586:
----------------------------------

IMHO the _ClassContext_ should be available.

This is the arquillian.debug output when running with testNG: (see the TestContextHandler.createClassContext)
{noformat:title=TESTNG debug}
(E) Before
	(I) TestContextHandler.createSuiteContext
	(I) TestContextHandler.createClassContext
	(E) TestClass
	(I) TestContextHandler.createTestContext
	(I) ContainerEventController.createBeforeContext
	(O) TestInstanceEnricher.enrich
	(E) BeforeEnrichment
		(O) ContextRootStoreInitializer.setupLocationForClass
		(E) ContextRootStore
	(E) DroneLifecycleEvent
		(O) DroneInstanceCreator.createDroneInstance
		(E) DroneLifecycleEvent
			(O) WindowResizer.resizeBrowserWindow
			(O) DroneEnhancer.enhanceDrone
			(E) DroneEnhancementEvent
			(E) DroneEnhancementEvent
				(O) WindowResizer.resizeBrowserWindow
	(E) AfterEnrichment
	(O) DroneConfigurator.configureDrone
	(O) ClientBeforeAfterLifecycleEventExecuter.on
{noformat}

These are the active contexts in {{Before}}: {{[org.jboss.arquillian.core.impl.context.ApplicationContextImpl at d4ec36]}}

This is the output when running with junit:

{noformat:title=JUNIT debug}
(E) Before
	(I) TestContextHandler.createSuiteContext
	(I) TestContextHandler.createClassContext
	(E) TestClass
	(I) TestContextHandler.createTestContext
	(I) ContainerEventController.createBeforeContext
	(O) DroneConfigurator.configureDrone
	(O) TestInstanceEnricher.enrich
	(E) BeforeEnrichment
		(O) ContextRootStoreInitializer.setupLocationForClass
		(E) ContextRootStore
	(E) DroneLifecycleEvent
		(O) DroneInstanceCreator.createDroneInstance
		(E) DroneLifecycleEvent
			(O) DroneEnhancer.enhanceDrone
			(E) DroneEnhancementEvent
			(E) DroneEnhancementEvent
				(O) WindowResizer.resizeBrowserWindow
			(O) WindowResizer.resizeBrowserWindow
	(E) AfterEnrichment
	(O) ClientBeforeAfterLifecycleEventExecuter.on
{noformat}

These are the active contexts: {{[org.jboss.arquillian.core.impl.context.ApplicationContextImpl at 62b3beda, org.jboss.arquillian.test.impl.context.ClassContextImpl at 6b70cd6, org.jboss.arquillian.container.impl.context.ContainerContextImpl at 5babb90b, org.jboss.arquillian.container.impl.context.DeploymentContextImpl at 6701b031, org.jboss.arquillian.test.impl.context.TestContextImpl at 1fd695cc, org.jboss.arquillian.test.impl.context.SuiteContextImpl at 41049468]}}

Other ideas:
* ClassContextImpl is available _(E) After_
* The JUnit part contains _(O) DroneConfigurator.configureDrone_, the testng not.
                
> ClassContextImpl is not active during TestNG @BeforeMethod
> ----------------------------------------------------------
>
>                 Key: ARQ-1586
>                 URL: https://issues.jboss.org/browse/ARQ-1586
>             Project: Arquillian
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Base Implementation
>    Affects Versions: 1.1.1.Final
>            Reporter: Juraj Húska
>
> When I call [this|https://github.com/arquillian/arquillian-graphene/blob/master/api/src/main/java/org/jboss/arquillian/graphene/Graphene.java#L263] Arquillian Graphene's method in method annotated with TestNG {{@BeforeMethod}}, then it is not possible to get Graphene's configuration.
> On this [line|https://github.com/arquillian/arquillian-graphene/blob/master/impl/src/main/java/org/jboss/arquillian/graphene/enricher/WebElementEnricher.java#L68], {{configuration.get()}} returns {{null}}.
> The configuration should be retrieved from {{Instance<GrapheneConfiguration>}}. However, it is not.
> When I compare this to JUnit {{@Before}}, I came to this:
> At {{ManagerImpl.java}} [here|https://github.com/arquillian/arquillian-core/blob/master/core/impl-base/src/main/java/org/jboss/arquillian/core/impl/ManagerImpl.java#L186], the configuration is retrieved from context {{ClassContextImpl}}.
> However, that context is not marked as active when executing from TestNG (among the others contexts).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the arquillian-issues mailing list