[JBoss JIRA] (ARQ-1944) Linkage error with arquillian-junit.jar
by Chris Rankin (JIRA)
[ https://issues.jboss.org/browse/ARQ-1944?page=com.atlassian.jira.plugin.s... ]
Chris Rankin edited comment on ARQ-1944 at 2/2/16 3:36 PM:
-----------------------------------------------------------
Hmm, is your {{myorg/rest/model/OrderStatus}} class imported via a Maven {{<dependency>}} from your local repository? Because I've noticed {{maven-failsafe-plugin}} put things on the integration test classpath twice before inside the embedded Tomcat container. Whenever I've had this problem, I've needed to add something like this to the failsafe plugin's configuration:
{code:xml}<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>groupdId:artifactId</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>{code}
Although having said that, I've never had a linkage error because of this.
was (Author: chrisjr):
Hmm, is your {{myorg/rest/model/OrderStatus}} class imported via a Maven {{<dependency>}} from your local repository? Because I've noticed {{maven-failsafe-plugin}} put things on the integration test classpath twice before. Whenever I've had this problem, I've needed to add something like this to the failsafe plugin's configuration:
{code:xml}<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>groupdId:artifactId</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>{code}
Although having said that, I've never had a linkage error because of this.
> Linkage error with arquillian-junit.jar
> ---------------------------------------
>
> Key: ARQ-1944
> URL: https://issues.jboss.org/browse/ARQ-1944
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.7.Final, 1.1.8.Final, 1.1.9.Final, 1.1.10.Final, 1.1.11.Final
> Environment: JDK7, Windows 7 x64, Linux x64
> Reporter: Chris Rankin
> Attachments: arquillian-hamcrest-test.tar.xz
>
>
> Testing a WAR in embedded Tomcat >= 7.0.51 using Restassured, JUnit and Hamcrest matchers. (TestNG works fine).
> The test fails with this error message:
> {code}Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.404 sec <<< FAILURE! - in org.testing.web.TroubleIT
> testTrouble(org.testing.web.TroubleIT) Time elapsed: 0.774 sec <<< ERROR!
> java.lang.LinkageError: loader constraint violation: when resolving interface method "com.jayway.restassured.specification.ResponseSpecification.statusCode(Lorg/hamcrest/Matcher;)Lcom/jayway/restassured/specification/ResponseSpecification;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/testing/web/TroubleIT, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for resolved class, com/jayway/restassured/specification/ResponseSpecification, have different Class objects for the type cification.statusCode(Lorg/hamcrest/Matcher;)Lcom/jayway/restassured/specification/ResponseSpecification; used in the signature
> at org.testing.web.TroubleIT.testTrouble(TroubleIT.java:35)
> {code}
> This error can be resolved in four different ways:
> - Rewrite the test using TestNG
> - Rewrite the test without using any Hamcrest matchers.
> - Remove "org.hamcrest" from {{org.jboss.arquillian.junit.container.JUnitDeploymentAppender}}.
> - Set {{@Deployment(testable = false)}} to prevent Arquillian from packaging its artifacts into the deployment in the first place.
> See [Issue #78 for arquillian-core|https://github.com/arquillian/arquillian-core/issues/78]
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 11 months
[JBoss JIRA] (ARQ-2006) ISE for deployment-scoped drone point when manual deployment is used
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-2006?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek updated ARQ-2006:
--------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
Pushed upstream in:
https://github.com/arquillian/arquillian-extension-drone/commit/2ca9f31a1...
https://github.com/arquillian/arquillian-extension-drone/commit/75f0db0ac...
> ISE for deployment-scoped drone point 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=[(a)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)
8 years, 11 months