TOMEE-2295 add custom mapping back
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/152f5b2b Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/152f5b2b Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/152f5b2b Branch: refs/heads/tomee-7.1.x Commit: 152f5b2bde8740d1d7b5c30fab11f8f9b12b067b Parents: bffc856 Author: Jonathan Gallimore <[email protected]> Authored: Wed Dec 5 13:55:47 2018 +0000 Committer: Otavio Santana <[email protected]> Committed: Mon Dec 17 13:59:32 2018 -0200 ---------------------------------------------------------------------- .../arquillian-tomee-webprofile-tests/pom.xml | 50 +----------------- .../tests/cmp/sample/CustomOrmXmlTest.java | 2 + .../arquillian/tests/cmp/sample/custom-orm.xml | 54 ++++++++++++++++++++ .../arquillian/tests/cmp/sample/persistence.xml | 31 +++++++++++ 4 files changed, 88 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/152f5b2b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/pom.xml ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/pom.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/pom.xml index 49f6d57..5f7af23 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/pom.xml +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/pom.xml @@ -50,54 +50,6 @@ <build> <plugins> <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.21.0</version> - <executions> - <execution> - <id>default-test</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <skip>true</skip> - <parallel>none</parallel> - <threadCount>1</threadCount> - <reuseForks>true</reuseForks> - <trimStackTrace>false</trimStackTrace> - </configuration> - </execution> - <execution> - <id>test-tomee-embedded</id> - <phase>test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <skip>${maven.test.skip}</skip> - <!--<argLine>-javaagent:${settings.localRepository}/org/apache/tomee/openejb-javaagent/8.0.0-SNAPSHOT/openejb-javaagent-8.0.0-SNAPSHOT.jar -agentpath:/Users/jgallimore/tmp/libtracknpe.so</argLine>--> - <argLine>-javaagent:${settings.localRepository}/org/apache/tomee/openejb-javaagent/8.0.0-SNAPSHOT/openejb-javaagent-8.0.0-SNAPSHOT.jar</argLine> - <systemPropertyVariables> - <tomee.version>8.0.0-SNAPSHOT</tomee.version> - <arquillian.launch>tomee-embedded</arquillian.launch> - <openejb.arquillian.adapter>tomee-embedded</openejb.arquillian.adapter> - </systemPropertyVariables> - <parallel>none</parallel> - <threadCount>1</threadCount> - <reuseForks>true</reuseForks> - <trimStackTrace>false</trimStackTrace> - </configuration> - </execution> - </executions> - <configuration> - <skip>true</skip> - <parallel>none</parallel> - <threadCount>1</threadCount> - <reuseForks>true</reuseForks> - <trimStackTrace>false</trimStackTrace> - </configuration> - </plugin> - <plugin> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-maven-plugin</artifactId> <version>${openjpa.version}</version> @@ -142,4 +94,4 @@ </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/152f5b2b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/CustomOrmXmlTest.java ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/CustomOrmXmlTest.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/CustomOrmXmlTest.java index ce87196..f261015 100644 --- a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/CustomOrmXmlTest.java +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/cmp/sample/CustomOrmXmlTest.java @@ -45,6 +45,8 @@ public class CustomOrmXmlTest { LocalMovie.class, LocalMovieHome.class, MovieBean.class, MovieDetails.class, MoviesBusiness.class, MoviesBusinessBean.class, MoviesBusinessHome.class, MoviesServlet.class) + .addAsResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/cmp/sample/custom-orm.xml"), "META-INF/custom-orm.xml") + .addAsResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/cmp/sample/persistence.xml"), "META-INF/persistence.xml") .addAsWebInfResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/cmp/sample/openejb-jar.xml"), "openejb-jar.xml") .addAsWebInfResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/cmp/sample/ejb-jar.xml"), "ejb-jar.xml") .addAsWebInfResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/cmp/sample/web.xml"), "web.xml"); http://git-wip-us.apache.org/repos/asf/tomee/blob/152f5b2b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/custom-orm.xml ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/custom-orm.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/custom-orm.xml new file mode 100644 index 0000000..22dbae5 --- /dev/null +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/custom-orm.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0"> + <entity class="openejb.org.apache.openejb.arquillian.tests.cmp.sample.Movie" name="Movie"> + <description>CustomOrmXmlTest#MovieBean</description> + <table/> + <named-query name="Movie.findAll"> + <query>select object(m) from Movie m</query> + </named-query> + <attributes> + <id name="movieId"> + <generated-value strategy="IDENTITY"/> + </id> + <basic name="name"> + <column name="movie_name" length="250"/> + </basic> + <basic name="genre"/> + <many-to-many mapped-by="movies" name="actors"/> + </attributes> + </entity> + <entity class="openejb.org.apache.openejb.arquillian.tests.cmp.sample.Actor" name="Actor"> + <description>CustomOrmXmlTest#ActorBean</description> + <table/> + <named-query name="Actor.findAll"> + <query>select object(a) from Actor a</query> + </named-query> + <attributes> + <id name="actorId"> + <generated-value strategy="IDENTITY"/> + </id> + <basic name="name"> + <column name="actor_name" length="250"/> + </basic> + <many-to-many name="movies"/> + </attributes> + </entity> +</entity-mappings> + http://git-wip-us.apache.org/repos/asf/tomee/blob/152f5b2b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/persistence.xml ---------------------------------------------------------------------- diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/persistence.xml b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/persistence.xml new file mode 100644 index 0000000..d184dd9 --- /dev/null +++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/resources/org/apache/openejb/arquillian/tests/cmp/sample/persistence.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> + <persistence-unit name="cmp" transaction-type="JTA"> + <jta-data-source>Default JDBC Database</jta-data-source> + <non-jta-data-source>Default Unmanaged JDBC Database</non-jta-data-source> + <mapping-file>META-INF/custom-orm.xml</mapping-file> + <class>openejb.org.apache.openejb.arquillian.tests.cmp.sample.Movie</class> + <class>openejb.org.apache.openejb.arquillian.tests.cmp.sample.Actor</class> + <properties> + <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true, Indexes=false, IgnoreErrors=true)"/> + <property name="openjpa.Log" value="DefaultLevel=INFO"/> + </properties> + </persistence-unit> +</persistence>
