![JAR search and dependency download from the Maven repository](/logo.png)
org.jboss.arquillian.seam2.container.Seam2TestLifecycleHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arquillian-seam2 Show documentation
Show all versions of arquillian-seam2 Show documentation
Seam2 support for Arquillian:
- TestEnrichment for @In injection points from the Seam2 Context.
- Packaging support for adding the Seam2 framework
The newest version!
package org.jboss.arquillian.seam2.container;
import org.jboss.arquillian.core.api.annotation.Observes;
import org.jboss.arquillian.test.spi.event.suite.After;
import org.jboss.arquillian.test.spi.event.suite.Before;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Manager;
/**
* Hooks around test execution to start and destroy Seam Context.
*
* @author Bartosz Majsak
*
*/
public class Seam2TestLifecycleHandler
{
public void initializeContext(@Observes Before beforeTest)
{
if (Contexts.getApplicationContext() == null)
{
Lifecycle.beginCall();
}
Manager.instance().initializeTemporaryConversation();
}
public void destroyContext(@Observes After afterTest)
{
if (Contexts.getApplicationContext() != null)
{
Lifecycle.endCall();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy