[JBoss JIRA] (ARQ-1939) Arquillian fails with NPE when @UsingDataSet seeding fails
by Steven Dodd (JIRA)
[ https://issues.jboss.org/browse/ARQ-1939?page=com.atlassian.jira.plugin.s... ]
Steven Dodd updated ARQ-1939:
-----------------------------
Steps to Reproduce:
1. Create an Arquillian test using @UsingDataSet(\{ "test.yml" \}).
2. Add data to test.yml that violates a unique constraint in your database.
3. Run the test.
was:
1. Create an Arquillian test using @UsingDataSet({ "test.yml" }).
2. Add data to test.yml that violates a unique constraint in your database.
3. Run the test.
> Arquillian fails with NPE when @UsingDataSet seeding fails
> ----------------------------------------------------------
>
> Key: ARQ-1939
> URL: https://issues.jboss.org/browse/ARQ-1939
> Project: Arquillian
> Issue Type: Bug
> Affects Versions: 1.1.5.Final
> Environment: Postgres, JBoss, Hibernate
> Reporter: Steven Dodd
>
> Arquillian fails with an NPE when @UsingDataSet seeding fails, for example, due to seed data violating a unique constraint.
> The NPE call-stack is unrelated to database seeding.
> The NPE gives no indication that the source of the problem is a bad database seed.
> As a result, many hours can easily be wasted trying to figure out the source of the problem.
> Arquillian should clearly report when database seeding fails.
> Note: we only use .yml files for seeding, not sure if the same problem exists for other file types.
> Here's an example of the callstack:
> {code}
> java.lang.NullPointerException
> at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.testRequiresRollbackDueToFailure(TransactionHandler.java:150)
> at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.rollbackRequired(TransactionHandler.java:140)
> at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.endTransactionAfterTest(TransactionHandler.java:108)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.testenricher.cdi.CreationalContextDestroyer.destory(CreationalContextDestroyer.java:44)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
> at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.after(EventTestRunnerAdaptor.java:103)
> at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:277)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
> at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
> at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
> at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:159)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:125)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:89)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
> at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
> at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
> at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
> at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
> at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
> at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
> at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
> at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
> at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
> at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
> at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
> at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
> at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
> at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
> at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
> at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
> at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
> at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
> at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
> at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
> at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
> at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1939) Arquillian fails with NPE when @UsingDataSet seeding fails
by Steven Dodd (JIRA)
Steven Dodd created ARQ-1939:
--------------------------------
Summary: Arquillian fails with NPE when @UsingDataSet seeding fails
Key: ARQ-1939
URL: https://issues.jboss.org/browse/ARQ-1939
Project: Arquillian
Issue Type: Bug
Affects Versions: 1.1.5.Final
Environment: Postgres, JBoss, Hibernate
Reporter: Steven Dodd
Arquillian fails with an NPE when @UsingDataSet seeding fails, for example, due to seed data violating a unique constraint.
The NPE call-stack is unrelated to database seeding.
The NPE gives no indication that the source of the problem is a bad database seed.
As a result, many hours can easily be wasted trying to figure out the source of the problem.
Arquillian should clearly report when database seeding fails.
Note: we only use .yml files for seeding, not sure if the same problem exists for other file types.
Here's an example of the callstack:
{code}
java.lang.NullPointerException
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.testRequiresRollbackDueToFailure(TransactionHandler.java:150)
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.rollbackRequired(TransactionHandler.java:140)
at org.jboss.arquillian.transaction.impl.lifecycle.TransactionHandler.endTransactionAfterTest(TransactionHandler.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.testenricher.cdi.CreationalContextDestroyer.destory(CreationalContextDestroyer.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.after(EventTestRunnerAdaptor.java:103)
at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:277)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:159)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:125)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1645) persistence doesn't support multiple datasources
by Peter Probst (JIRA)
[ https://issues.jboss.org/browse/ARQ-1645?page=com.atlassian.jira.plugin.s... ]
Peter Probst edited comment on ARQ-1645 at 3/25/15 3:10 PM:
------------------------------------------------------------
Also it would be perfect if i can bind a @UsingDataset to a @Datasource. So on one method i can have more than one @UsingDataset which have a parameter for the @Datasource to use.
Sample: a test method is working on data in multiple schemas, so the data inject would be very easy.
Also it would be really great if i can set (optional) a default schema name on @Datasource -> and this schema will be propagated to dbunit. In our case working with postgres it is only possible to use a static schema configuration in arquillian.xml. But this is only valid for one schema. So we now use qualified table names, but then we have to use also schema name in flat xml files -> so these files are not reusable for same schema with different name. The schema name on the @UsingDatasource would solve this problem elegantly.
was (Author: peter.probst):
Also it would be perfect if i can bind a @Dataset to a @Datasource. So on one method i can have more than one @Dataset which have a parameter for the @Datasource to use.
Sample: a test method is working on data in multiple schemas, so the data inject would be very easy.
Also it would be really great if i can set (optional) a default schema name on @Datasource -> and this schema will be propagated to dbunit. In our case working with postgres it is only possible to use a static schema configuration in arquillian.xml. But this is only valid for one schema. So we now use qualified table names, but then we have to use also schema name in flat xml files -> so these files are not reusable for same schema with different name. The schema name on the @Datasource would solve this problem elegantly.
> persistence doesn't support multiple datasources
> ------------------------------------------------
>
> Key: ARQ-1645
> URL: https://issues.jboss.org/browse/ARQ-1645
> Project: Arquillian
> Issue Type: Feature Request
> Components: Extension - Persistence
> Affects Versions: persistence_1.0.0.Alpha6
> Reporter: Romain Manni-Bucau
> Assignee: Bartosz Majsak
> Fix For: persistence_1.0.0.next
>
>
> It is common to use multiple datsources (in fact all apps I'm working with does it) and ATM dbunit extension doesn't support multiple datsource init/asserts (UsingDataSet and ExpectedDataSet).
> Would be great to get a plural version of @DataSource and @XDataSet
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1645) persistence doesn't support multiple datasources
by Peter Probst (JIRA)
[ https://issues.jboss.org/browse/ARQ-1645?page=com.atlassian.jira.plugin.s... ]
Peter Probst commented on ARQ-1645:
-----------------------------------
Also it would be perfect if i can bind a @Dataset to a @Datasource. So on one method i can have more than one @Dataset which have a parameter for the @Datasource to use.
Sample: a test method is working on data in multiple schemas, so the data inject would be very easy.
Also it would be really great if i can set (optional) a default schema name on @Datasource -> and this schema will be propagated to dbunit. In our case working with postgres it is only possible to use a static schema configuration in arquillian.xml. But this is only valid for one schema. So we now use qualified table names, but then we have to use also schema name in flat xml files -> so these files are not reusable for same schema with different name. The schema name on the @Datasource would solve this problem elegantly.
> persistence doesn't support multiple datasources
> ------------------------------------------------
>
> Key: ARQ-1645
> URL: https://issues.jboss.org/browse/ARQ-1645
> Project: Arquillian
> Issue Type: Feature Request
> Components: Extension - Persistence
> Affects Versions: persistence_1.0.0.Alpha6
> Reporter: Romain Manni-Bucau
> Assignee: Bartosz Majsak
> Fix For: persistence_1.0.0.next
>
>
> It is common to use multiple datsources (in fact all apps I'm working with does it) and ATM dbunit extension doesn't support multiple datsource init/asserts (UsingDataSet and ExpectedDataSet).
> Would be great to get a plural version of @DataSource and @XDataSet
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1938) wildfly container does not support serverConfig parameter
by Karl Pietrzak (JIRA)
Karl Pietrzak created ARQ-1938:
----------------------------------
Summary: wildfly container does not support serverConfig parameter
Key: ARQ-1938
URL: https://issues.jboss.org/browse/ARQ-1938
Project: Arquillian
Issue Type: Feature Request
Reporter: Karl Pietrzak
h3. arquillian.xml snippet
{code:xml}
<container qualifier="wildfly-embedded" default="true">
<configuration>
<property name="serverConfig">does_not_matter.xml</property>
<property name="jbossHome">target/wildfly-embedded/wildfly-8.2.0.Final/</property>
<property name="modulePath">target/wildfly-embedded/wildfly-8.2.0.Final/modules</property>
</configuration>
</container>
{code}
h3. Details
* It doesn't matter what I put for {{serverConfig}}, which leads me to believe it isn't used.
* the JBoss container supports this parameter, so it would be great if the Wildfly one did too.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1889) CDI Injection not working in WebSphere Containers (V8)
by Saurabh Agarwal (JIRA)
[ https://issues.jboss.org/browse/ARQ-1889?page=com.atlassian.jira.plugin.s... ]
Saurabh Agarwal updated ARQ-1889:
---------------------------------
Hi Poul,
Actually the issue is reproducible and caused by JAR loading hierarchy of WebSphere server.Upon adding the Arquillian JARS on extended path, the hierarchy was corrected and problem got resolved.
ThanksSaurabh
Date: Sat, 21 Mar 2015 16:03:19 -0400
From: issues(a)jboss.org
To: saurabh_ksa(a)hotmail.com
Subject: [JBoss JIRA] (ARQ-1889) CDI Injection not working in WebSphere Containers (V8)
Message Title
Gerhard Poul closed an issue as Cannot Reproduce Bug
Arquillian / ARQ-1889
CDI Injection not working in WebSphere Containers (V8)
Change By:
Gerhard Poul
Status:
Open Closed
Assignee:
Gerhard Poul
Resolution:
Cannot Reproduce Bug
Add Comment
This message was sent by Atlassian JIRA (v6.3.11#6341-sha1:83c4d29)
> CDI Injection not working in WebSphere Containers (V8)
> ------------------------------------------------------
>
> Key: ARQ-1889
> URL: https://issues.jboss.org/browse/ARQ-1889
> Project: Arquillian
> Issue Type: Bug
> Components: WebSphere Containers
> Affects Versions: was_1.0.0.Beta1
> Environment: Windows 7, IBM WebSphere Application Server (8.0.0.9), IBM RSA 8
> Reporter: Saurabh Agarwal
> Assignee: Gerhard Poul
> Priority: Blocker
> Attachments: ArquillianInjectionTest.java, StackTrace.txt
>
>
> Hi,
> I have gone through ARQ-1488 and it depicts the same problem what I am facing.
> In my IBM WebSphere Application Server (8.0.0.9), CDI is not working and it is giving me the NP exception.
> Please note I am not using MAVEN build but have all required JARS file in my web-inf/lib directory
> JARS List I am having
> ------------------------------
> arquillian-config-api.jar
> arquillian-config-impl-base.jar
> arquillian-config-spi.jar
> arquillian-container-impl-base.jar
> arquillian-container-spi.jar
> arquillian-container-test-api.jar
> arquillian-container-test-impl-base.jar
> arquillian-container-test-spi.jar
> arquillian-core-api.jar
> arquillian-core-impl-base-1.1.5.Final.jar
> arquillian-core-spi-1.1.5.Final.jar
> arquillian-junit-container.jar
> arquillian-junit-core.jar
> arquillian-protocol-jmx-1.1.5.Final.jar
> arquillian-protocol-servlet.jar
> arquillian-protocol.jar
> arquillian-test-api.jar
> arquillian-test-impl-base.jar
> arquillian-test-spi.jar
> arquillian-testenricher-cdi.jar
> arquillian-testenricher-ejb.jar
> arquillian-testenricher-initialcontext.jar
> arquillian-testenricher-resource.jar
> arquillian-was-remote.jar
> commons-fileupload-1.2.1.jar
> commons-io-1.4.jar
> deltaspike-core-api-1.0.0.jar
> deltaspike-core-impl-1.0.0.jar
> deltaspike-jsf-module-api-1.0.0.jar
> deltaspike-jsf-module-impl-1.0.0.jar
> deltaspike-security-module-api-1.0.0.jar
> deltaspike-security-module-impl-1.0.0.jar
> itext-1.3.jar
> jsfcore.jar
> junit.jar
> org.hamcrest.core_1.3.0.v201303031735.jar
> poi-3.8-20120326.jar
> primefaces-4.0.6.jar
> shrinkwrap-api.jar
> shrinkwrap-descriptors-api-base.jar
> shrinkwrap-descriptors-api-javaee.jar
> shrinkwrap-descriptors-impl-base.jar
> shrinkwrap-descriptors-impl-javaee.jar
> shrinkwrap-descriptors-spi.jar
> shrinkwrap-impl-base.jar
> shrinkwrap-spi.jar
> Code snippet
> ------------------
> import javax.inject.Inject;
> import org.jboss.arquillian.container.test.api.Deployment;
> import org.jboss.arquillian.junit.Arquillian;
> import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
> import org.junit.Assert;
> import org.junit.Test;
> import org.junit.runner.RunWith;
> import com.ford.jcoe.jab.inbound.booking.ui.bean.ListBookingBean;
> import com.ford.jcoe.jab.inbound.booking.ui.bean.TestArquillianBean;
> /**
> * TODO - Place class description here
> */
> @RunWith(Arquillian.class)
> public class ArquillianInjectionTest extends BaseArquillianPersistenceTest {
> @Inject
> ListBookingBean b;
> /**
> * TODO - Place method description here
> *
> * @return
> */
> @Deployment
> public static EnterpriseArchive createTestArchive() {
> java.net.Authenticator.setDefault(basicAuthAuthenticator);
> return BaseArquillianPersistenceTest.createTestArchive("JabEAR");
> }
> /**
> * Unit Test Method
> */
> @Test
> public void testInjection() {
> String stringRepresentation = null;
> try {
> System.out.println("Not Working Step 1");
> stringRepresentation = this.b.toString();
> System.out.println("Not Working Step 2");
> } catch (final NullPointerException npe) {
> Assert.fail("Injection failed.");
> }
> Assert.assertNotNull(stringRepresentation);
> }
> }
> Exception I am getting
> -----------------------------
> Null Pointer exception in stringRepresentation = this.b.toString(); as b is null.
> Complete stack trace
> --------------------------
> java.lang.AssertionError: Injection failed.
> at org.junit.Assert.fail(Assert.java:88)
> at ArquillianInjectionTest.testInjection(ArquillianInjectionTest.java:50)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:301)
> at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
> at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
> at org.jboss.arquillian.container.test.impl.client.protocol.local.LocalContainerMethodExecutor.invoke(LocalContainerMethodExecutor.java:50)
> at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:109)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
> at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
> at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)
> at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:129)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:102)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
> at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
> at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:294)
> at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:269)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:193)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
> at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
> at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
> at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:66)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:159)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:125)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:89)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
> at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
> at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
> at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
> at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:79)
> at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960)
> at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064)
> at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
> at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
> at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
> at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
> at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
> at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
> at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
> at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)
> Most Important Thing
> ------------------------------
> I have commented out the code in WebSphereRemoteContainer.java (for WAS 8 - https://github.com/arquillian/arquillian-container-was) which is responsible for deploying and un-deploying the code.
> For our requirements, the code is already deployed and all we need to run the test on PRE DEPLOYED code only.
> Methods which I have modified
> 1. public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException
> 2. public void undeploy(final Archive<?> archive) throws DeploymentException
> I have just commented out the code which install / uninstall the application.
> Can someone help me in getting this issue resolved.
> Please let me know if I need to provide more information for debugging purpose.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1937:
-------------------------------
Component/s: Deployable Containers SPI
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Fix For: 1.1.8.Final
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months
[JBoss JIRA] (ARQ-1937) Class loading issue with injected deployer
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/ARQ-1937?page=com.atlassian.jira.plugin.s... ]
Aslak Knutsen updated ARQ-1937:
-------------------------------
Fix Version/s: 1.1.8.Final
> Class loading issue with injected deployer
> -------------------------------------------
>
> Key: ARQ-1937
> URL: https://issues.jboss.org/browse/ARQ-1937
> Project: Arquillian
> Issue Type: Bug
> Components: Deployable Containers SPI
> Affects Versions: 1.1.1.Final
> Reporter: Martin Gencur
> Fix For: 1.1.8.Final
>
>
> Steps to reproduce:
> 1) inject a Deployer via @ArquillianResource
> 2) declare a deployment as managed=false, use the deployer to deploy artifacts to a managed container
> 3) run a test method that operates on the deployment
> 4) check that classes inside the test method have the same classloader as the test class itself (see the code below where I call cache.getClass().getClassLoader())
> 5) this does not happen when the deployment is managed=true and deployer API is NOT used. In this case, the classes have a different class loader
> In the test below, I tried to load different versions of Infinispan in two deployments and test backward compatibility. However, due to this class loading issue the Infinispan classes are of the latest version regardless of libraries bundled in the WAR. This is probably due to the fact that the Maven test module has the latest Infinispan libraries defined in <dependencies> while the older version is downloaded separately via Maven dependency plugin.
> {code}
> package com.jboss.datagrid.test.backwardcompatibility;
> @RunWith(Arquillian.class)
> public class SingleFileStoreBackwardCompatibilityIT {
> private DefaultCacheManager dfc;
> private String cacheName = "testCache";
> private static final String OLD_ISPN = "dep1_with_old_ispn";
> private static final String NEW_ISPN = "dep2_with_new_ispn";
> private static Map<String, String> storedMap;
> @ArquillianResource
> Deployer deployer;
> @Deployment(name = OLD_ISPN, testable = true, managed = true, order=1)
> @TargetsContainer("container1")
> public static WebArchive createDeploymentOld() {
> WebArchive jar = DeploymentBuilder.createTestArchiveWithPreviousJDG("test1.war", "previous");
> System.out.println("ClassLoader: " + SingleFileStoreBackwardCompatibilityIT.class.getClassLoader());
> return jar;
> }
> @Deployment(name = NEW_ISPN, testable = true, managed = true, order=2)
> @TargetsContainer("container2")
> public static WebArchive createDeploymentNew() {
> WebArchive jar = DeploymentBuilder.createTestArchive("test2.war", "current");
> return jar;
> }
> private DefaultCacheManager configureCacheManager(boolean clearCacheStore) throws Exception {
> GlobalConfiguration glob = new GlobalConfigurationBuilder().nonClusteredDefault()
> .globalJmxStatistics().allowDuplicateDomains(true).
> build();
> ConfigurationBuilder c = new ConfigurationBuilder();
> c.clustering().cacheMode(CacheMode.LOCAL);
> File tmpStore = new File("/tmp/cache/" + cacheName + ".dat");
> if (clearCacheStore && tmpStore.exists()) {
> tmpStore.delete();
> }
> c.persistence().passivation(false).addSingleFileStore().purgeOnStartup(false).location("/tmp/cache/");
> Configuration cnf = c.build();
> DefaultCacheManager manager = new DefaultCacheManager(glob);
> manager.defineConfiguration(cacheName, cnf);
> return manager;
> }
> @Test
> @OperateOnDeployment(OLD_ISPN)
> @InSequence(1)
> public void testStoreWithOldJDG() throws Exception {
> deployer.deploy(OLD_ISPN);
> dfc = configureCacheManager(true);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("Version: " + cache.getVersion());
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> storedMap = new HashMap<String, String>();
> storedMap.put("k", "v");
> cache.put("mapKey", storedMap);
> dfc.stop();
> deployer.undeploy(OLD_ISPN);
> }
> @Test
> @OperateOnDeployment(NEW_ISPN)
> @InSequence(2)
> public void testReadWithNewJDG() throws Exception {
> deployer.deploy(NEW_ISPN);
> dfc = configureCacheManager(false);
> dfc.start();
> Cache<Object, Object> cache = dfc.getCache(cacheName);
> System.out.println("ClassLoader: " + cache.getClass().getClassLoader());
> System.out.println("Version: " + cache.getVersion());
> assertEquals(storedMap, cache.get("mapKey"));
> dfc.stop();
> deployer.undeploy(NEW_ISPN);
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 9 months