DELTASPIKE-497 Fixed data module tests to work on build-managed Glassfish
Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/e56e5467 Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/e56e5467 Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/e56e5467 Branch: refs/heads/master Commit: e56e5467e931b2967bd4496e68cc80ec617b3184 Parents: 1550c88 Author: Christian Kaltepoth <[email protected]> Authored: Wed Jan 15 06:49:08 2014 +0100 Committer: Christian Kaltepoth <[email protected]> Committed: Wed Jan 15 06:49:08 2014 +0100 ---------------------------------------------------------------------- deltaspike/modules/data/impl/pom.xml | 26 ++++++++++++++++++++ .../data/test/util/TestDeployments.java | 13 ++++++++++ deltaspike/parent/code/pom.xml | 24 ++++++++++++++++-- 3 files changed, 61 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e56e5467/deltaspike/modules/data/impl/pom.xml ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/pom.xml b/deltaspike/modules/data/impl/pom.xml index ca4b150..7b262fb 100755 --- a/deltaspike/modules/data/impl/pom.xml +++ b/deltaspike/modules/data/impl/pom.xml @@ -217,6 +217,32 @@ </build> </profile> <profile> + <id>glassfish-build-managed-3</id> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + </testResource> + <testResource> + <directory>src/test/resources-glassfish</directory> + </testResource> + </testResources> + </build> + </profile> + <profile> + <id>glassfish-build-managed-4</id> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + </testResource> + <testResource> + <directory>src/test/resources-glassfish</directory> + </testResource> + </testResources> + </build> + </profile> + <profile> <id>tomee-build-managed</id> <build> <testResources> http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e56e5467/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java ---------------------------------------------------------------------- diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java index 64042f4..d002913 100755 --- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java +++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/test/util/TestDeployments.java @@ -152,6 +152,19 @@ public abstract class TestDeployments } } + /* + * We need to add Javassist in case of Glassfish for the partial beans to work correctly. But as Javassist is + * not on the test classpath like for the OWB and TomEE profiles, it is added using the Shrinkwrap Maven + * resolver. + */ + if (CdiContainerUnderTest.is("glassfish-.*")) + { + webArchive.addAsLibraries(Maven.resolver() + .resolve("javassist:javassist:3.12.0.GA") + .withTransitivity() + .asFile()); + } + return webArchive; } http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e56e5467/deltaspike/parent/code/pom.xml ---------------------------------------------------------------------- diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml index 25953fc..278e88c 100644 --- a/deltaspike/parent/code/pom.xml +++ b/deltaspike/parent/code/pom.xml @@ -1007,7 +1007,7 @@ <id>glassfish-build-managed-3</id> <properties> - <cdicontainer.version>weld-1.1.8</cdicontainer.version> + <cdicontainer.version>glassfish-${glassfish3.version}</cdicontainer.version> </properties> <dependencies> @@ -1111,6 +1111,16 @@ <replace file="${container.unpack.directory}/glassfish3/glassfish/domains/domain1/config/domain.xml" token="port="7676"" value="port="37676"" /> + + <!-- Replace the default datasource with an in-memory one --> + <replace + file="${container.unpack.directory}/glassfish3/glassfish/domains/domain1/config/domain.xml" + token="datasource-classname="org.apache.derby.jdbc.ClientDataSource"" + value="datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource"" /> + <replace + file="${container.unpack.directory}/glassfish3/glassfish/domains/domain1/config/domain.xml" + token="value="sun-appserv-samples"" value="value="memory:deltaspike"" /> + </target> </configuration> </execution> @@ -1131,7 +1141,7 @@ <id>glassfish-build-managed-4</id> <properties> - <cdicontainer.version>weld-2.0.0.SP1</cdicontainer.version> + <cdicontainer.version>glassfish-${glassfish4.version}</cdicontainer.version> </properties> <dependencies> @@ -1236,6 +1246,16 @@ <replace file="${container.unpack.directory}/glassfish4/glassfish/domains/domain1/config/domain.xml" token="value="7676"" value="value="27676"" /> + + <!-- Replace the default datasource with an in-memory one --> + <replace + file="${container.unpack.directory}/glassfish4/glassfish/domains/domain1/config/domain.xml" + token="datasource-classname="org.apache.derby.jdbc.ClientDataSource"" + value="datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource"" /> + <replace + file="${container.unpack.directory}/glassfish4/glassfish/domains/domain1/config/domain.xml" + token="value="sun-appserv-samples"" value="value="memory:deltaspike"" /> + </target> </configuration> </execution>
