Skip to content

Commit efa82a6

Browse files
committed
Workaround for Arquillian creating an illegal application.xml
1 parent e9210a3 commit efa82a6

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

jpa/datasourcedefinition-applicationxml-pu/src/main/resources/application-web.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd"
44
version="7">
55

6-
<application-name>OrderApp</application-name>
7-
<description>Application description</description>
8-
<display-name>OrderApp</display-name>
9-
106
<module>
117
<web>
128
<web-uri>test.war</web-uri>
@@ -20,5 +16,4 @@
2016
<url>jdbc:h2:mem:test</url>
2117
</data-source>
2218

23-
2419
</application>

jpa/datasourcedefinition-applicationxml-pu/src/test/java/org/javaee7/jpa/datasourcedefinition_applicationxml_pu/DataSourceDefinitionApplicationXMLPuEJBTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.jboss.shrinkwrap.api.Archive;
1515
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
1616
import org.jboss.shrinkwrap.api.spec.JavaArchive;
17+
import org.jboss.shrinkwrap.api.spec.WebArchive;
1718
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
1819
import org.junit.Test;
1920
import org.junit.runner.RunWith;
@@ -58,8 +59,17 @@ public static Archive<?> deploy() {
5859
.addAsResource("META-INF/persistence.xml")
5960

6061
// Service class that uses persistence unit
61-
.addPackages(true, DataSourceDefinitionApplicationXMLPuEJBTest.class.getPackage())
62-
);
62+
.addClasses(TestEntity.class, TestService.class)
63+
)
64+
65+
// Web module
66+
// This is needed to prevent Arquillian generating an illegal application.xml
67+
.addAsModule(
68+
create(WebArchive.class, "test.war")
69+
// This class containing the test
70+
.addClass(DataSourceDefinitionApplicationXMLPuEJBTest.class)
71+
72+
);
6373
}
6474

6575
@Test

jpa/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<module>datasourcedefinition</module>
2020
<module>datasourcedefinition-webxml-pu</module>
2121
<module>datasourcedefinition-annotation-pu</module>
22+
<module>datasourcedefinition-applicationxml-pu</module>
2223
<module>dynamic-named-query</module>
2324
<module>entitygraph</module>
2425
<module>listeners</module>

0 commit comments

Comments
 (0)