[arquillian-issues] [JBoss JIRA] (ARQ-2006) ISE when manual deployment is used
Matous Jobanek (JIRA)
issues at jboss.org
Tue Jan 12 09:33:00 EST 2016
Matous Jobanek created ARQ-2006:
-----------------------------------
Summary: ISE when manual deployment is used
Key: ARQ-2006
URL: https://issues.jboss.org/browse/ARQ-2006
Project: Arquillian
Issue Type: Bug
Components: Extension - Drone
Affects Versions: drone_2.0.0.Alpha5
Reporter: Matous Jobanek
Assignee: Matous Jobanek
Fix For: drone_2.0.0.Beta1
Consider these scenarios:
1)
{code:java}
@Deployment(name = "first", managed = false)
public static Archive deployFirst() {
return ShrinkWrap.create(WebArchive.class);
}
@Deployment(name = "second")
public static WebArchive deploySecond() {
return ShrinkWrap.create(WebArchive.class);
}
@ArquillianResource
private Deployer deployer;
@Drone
@OperateOnDeployment("first")
private WebDriver firstBrowser;
@Drone
@OperateOnDeployment("second")
private WebDriver secondBrowser;
@Test
@InSequence(1)
public void runFirstTest() throws InterruptedException {
deployer.deploy("first");
firstBrowser.get("http://google.com");
deployer.undeploy("first");
}
@Test
@InSequence(2)
public void runSecondTest() throws InterruptedException {
secondBrowser.get("http://google.com");
}
{code}
2)
{code:java}
@Deployment(name = "deployment", managed = false)
public static Archive deployFirst() {
return ShrinkWrap.create(WebArchive.class);
}
@ArquillianResource
private Deployer deployer;
@Drone
@OperateOnDeployment("deployment")
private WebDriver browser;
@Test
@InSequence(1)
public void runFirstTest() throws InterruptedException {
deployer.deploy("deployment");
browser.get("http://google.com");
deployer.undeploy("deployment");
}
@Test
@InSequence(2)
public void runSecondTest() throws InterruptedException {
deployer.deploy("deployment");
browser.get("http://google.com");
deployer.undeploy("deployment");
}
{code}
both of them lead to the IllegalStateException:
{noformat}
java.lang.IllegalStateException: Injection point DronePointImpl{droneClass=interface org.openqa.selenium.WebDriver, annotations=[@org.jboss.arquillian.drone.api.annotation.Drone(), @org.jboss.arquillian.container.test.api.OperateOnDeployment(value=deployment)], lifecycle=DEPLOYMENT} has deployment lifecycle and has to be prepared in @BeforeClass.
at org.jboss.arquillian.drone.impl.DroneTestEnrichHelper.ensureInjectionPointPrepared(DroneTestEnrichHelper.java:104)
at org.jboss.arquillian.drone.impl.DroneTestEnrichHelper.enrichTestClass(DroneTestEnrichHelper.java:72)
at org.jboss.arquillian.drone.impl.DroneTestEnricher.enrich(DroneTestEnricher.java:54)
...
{noformat}
The cause: the deployment-scoped drone point is destroyed before undeploy, but created only in BeforeClass. In the first test method the drone point is destroyed, however before the second test method is launched the test class is enriched including the drone point that is already destroyed.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the arquillian-issues
mailing list