-
1. Re: is it possible to skip the arquillian lifecycle programatically?
kpiwko Mar 29, 2013 10:51 AM (in response to abendt)1 of 1 people found this helpfulWell, it is not possible out of the box. You have two possibilities I can think of from the top of my head:
You set deployment mode to manual, and you deploy manually:
@Deployment(name = "X", managed = false, testable = false)
public static WebArchive manualDeployment() {
return ShrinkWrap.create(WebArchive.class)....
}@ArquillianResource Deployer deployer;
@Test @InSequence(1)
public void shouldBeAbleToDeploy() {if(deploy is enabled by system property) {
deployer.deploy("X");}
}
@Test @InSequence(2) @OperateOnDeployment("X")
public void shouldNowBeInDeploymentX() {
// we're now inside X
}Note, you should also handle @ArquillianResource URL somehow.
Or, you write an extension that will modify Deployment Scenarios.
Karel
-
2. Re: is it possible to skip the arquillian lifecycle programatically?
abendt Mar 30, 2013 9:23 AM (in response to kpiwko)Hi Karel,
thanks a lot for your reply.
I did not try out setting the deployment mode to manual because i'm more interested in skipping the whole container lifecycle.
Here's what i did:
i wrote an extension of jboss-as-arquillian-container-managed that installs a NoOpContainer if a specific system property is set:
{code}
public class NoOpContainerExtension implements LoadableExtension {
@Override
public void register(ExtensionBuilder builder) {
boolean skipContainerLifecycle = Boolean.parseBoolean(System.getProperty("arquillian.skipContainerLifecycle", "false"));
if (skipContainerLifecycle) {
builder.service(DeployableContainer.class, NoOpContainer.class);
} else {
new ManagedContainerExtension().register(builder);
}
}
}
{code}
In my IDE i set this variable to true to skip the arquillian lifecycle. Running the tests with Maven starts the container as usual.
For reference you can find the code here: https://github.com/abendt/jboss-as-arquillian-container-noop
best Regards,
Alphonse Bendt