Added property to permit passing in debugging settings during Maven test run.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@618791 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Ezzio 2008-02-05 21:52:59 +00:00
parent b74fc31881
commit c767561f9d

View File

@ -1,347 +1,351 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
distributed with this work for additional information distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.apache.openjpa</groupId> <groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-persistence-jdbc</artifactId> <artifactId>openjpa-persistence-jdbc</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>OpenJPA JPA JDBC</name> <name>OpenJPA JPA JDBC</name>
<description>OpenJPA JPA JDBC</description> <description>OpenJPA JPA JDBC</description>
<url>http://openjpa.apache.org</url> <url>http://openjpa.apache.org</url>
<parent> <parent>
<groupId>org.apache.openjpa</groupId> <groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-parent</artifactId> <artifactId>openjpa-parent</artifactId>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
</parent> </parent>
<properties> <properties>
<openjpa.loglevel>INFO</openjpa.loglevel> <openjpa.loglevel>INFO</openjpa.loglevel>
</properties> <!-- to set debug arguments, you might set the following at the command line:
<profiles> -Dtest.jvm.arguments="-Xmx500m -agentlib:jdwp=transport=dt_socket,server=y,address=8000"
-->
<!-- Profile for testing with Apache Derby --> <test.jvm.arguments>-Xmx500m</test.jvm.arguments>
<profile> </properties>
<id>test-derby</id> <profiles>
<activation>
<activeByDefault>true</activeByDefault> <!-- Profile for testing with Apache Derby -->
<property><name>test-derby</name></property> <profile>
</activation> <id>test-derby</id>
<dependencies> <activation>
<dependency> <activeByDefault>true</activeByDefault>
<groupId>org.apache.derby</groupId> <property><name>test-derby</name></property>
<artifactId>derby</artifactId> </activation>
<scope>test</scope> <dependencies>
</dependency> <dependency>
</dependencies> <groupId>org.apache.derby</groupId>
<properties> <artifactId>derby</artifactId>
<connection.driver.name>org.apache.derby.jdbc.EmbeddedDriver</connection.driver.name> <scope>test</scope>
<connection.url>jdbc:derby:target/database/openjpa-derby-database;create=true</connection.url> </dependency>
<connection.username></connection.username> </dependencies>
<connection.password></connection.password> <properties>
</properties> <connection.driver.name>org.apache.derby.jdbc.EmbeddedDriver</connection.driver.name>
</profile> <connection.url>jdbc:derby:target/database/openjpa-derby-database;create=true</connection.url>
<connection.username></connection.username>
<!-- Profile for testing with HSQL DB --> <connection.password></connection.password>
<profile> </properties>
<id>test-hsqldb</id> </profile>
<activation><property><name>test-hsqldb</name></property></activation>
<dependencies> <!-- Profile for testing with HSQL DB -->
<dependency> <profile>
<groupId>hsqldb</groupId> <id>test-hsqldb</id>
<artifactId>hsqldb</artifactId> <activation><property><name>test-hsqldb</name></property></activation>
<version>1.8.0.7</version> <dependencies>
<scope>test</scope> <dependency>
</dependency> <groupId>hsqldb</groupId>
</dependencies> <artifactId>hsqldb</artifactId>
<properties> <version>1.8.0.7</version>
<connection.driver.name>org.hsqldb.jdbcDriver</connection.driver.name> <scope>test</scope>
<connection.url>jdbc:hsqldb:target/database/openjpa-hsqldb-database;create=true</connection.url> </dependency>
<connection.username>sa</connection.username> </dependencies>
<connection.password></connection.password> <properties>
</properties> <connection.driver.name>org.hsqldb.jdbcDriver</connection.driver.name>
</profile> <connection.url>jdbc:hsqldb:target/database/openjpa-hsqldb-database;create=true</connection.url>
<connection.username>sa</connection.username>
<!-- Profile for testing with MySQL DB --> <connection.password></connection.password>
<profile> </properties>
<id>test-mysql</id> </profile>
<activation><property><name>test-mysql</name></property></activation>
<dependencies> <!-- Profile for testing with MySQL DB -->
<dependency> <profile>
<groupId>mysql</groupId> <id>test-mysql</id>
<artifactId>mysql-connector-java</artifactId> <activation><property><name>test-mysql</name></property></activation>
<version>5.1.5</version> <dependencies>
</dependency> <dependency>
</dependencies> <groupId>mysql</groupId>
<properties> <artifactId>mysql-connector-java</artifactId>
<connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name> <version>5.1.5</version>
<connection.url>${openjpa.mysql.url}</connection.url> </dependency>
<connection.username>${openjpa.mysql.username}</connection.username> </dependencies>
<connection.password>${openjpa.mysql.password}</connection.password> <properties>
</properties> <connection.driver.name>com.mysql.jdbc.Driver</connection.driver.name>
</profile> <connection.url>${openjpa.mysql.url}</connection.url>
<connection.username>${openjpa.mysql.username}</connection.username>
<!-- Profile for testing with PostgreSQL DB --> <connection.password>${openjpa.mysql.password}</connection.password>
<profile> </properties>
<id>test-postgresql</id> </profile>
<activation><property><name>test-postgresql</name></property></activation>
<dependencies> <!-- Profile for testing with PostgreSQL DB -->
<dependency> <profile>
<groupId>postgresql</groupId> <id>test-postgresql</id>
<artifactId>postgresql</artifactId> <activation><property><name>test-postgresql</name></property></activation>
<version>8.1-407.jdbc3</version> <dependencies>
<scope>test</scope> <dependency>
</dependency> <groupId>postgresql</groupId>
</dependencies> <artifactId>postgresql</artifactId>
<properties> <version>8.1-407.jdbc3</version>
<connection.driver.name>org.postgresql.Driver</connection.driver.name> <scope>test</scope>
<connection.url>${openjpa.postgresql.url}</connection.url> </dependency>
<connection.username>${openjpa.postgresql.username}</connection.username> </dependencies>
<connection.password>${openjpa.postgresql.password}</connection.password> <properties>
</properties> <connection.driver.name>org.postgresql.Driver</connection.driver.name>
</profile> <connection.url>${openjpa.postgresql.url}</connection.url>
<connection.username>${openjpa.postgresql.username}</connection.username>
<!-- Profile for testing with SQLServer DB using the jTDS driver --> <connection.password>${openjpa.postgresql.password}</connection.password>
<profile> </properties>
<id>test-sqlserver</id> </profile>
<activation><property><name>test-sqlserver</name></property></activation>
<dependencies> <!-- Profile for testing with SQLServer DB using the jTDS driver -->
<dependency> <profile>
<groupId>net.sourceforge.jtds</groupId> <id>test-sqlserver</id>
<artifactId>jtds</artifactId> <activation><property><name>test-sqlserver</name></property></activation>
<version>1.2</version> <dependencies>
<scope>test</scope> <dependency>
</dependency> <groupId>net.sourceforge.jtds</groupId>
</dependencies> <artifactId>jtds</artifactId>
<properties> <version>1.2</version>
<connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name> <scope>test</scope>
<connection.url>${openjpa.sqlserver.url}</connection.url> </dependency>
<connection.username>${openjpa.sqlserver.username}</connection.username> </dependencies>
<connection.password>${openjpa.sqlserver.password}</connection.password> <properties>
</properties> <connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name>
</profile> <connection.url>${openjpa.sqlserver.url}</connection.url>
<connection.username>${openjpa.sqlserver.username}</connection.username>
<!-- Profile for testing with Sybase DB using the jTDS driver --> <connection.password>${openjpa.sqlserver.password}</connection.password>
<profile> </properties>
<id>test-sybase</id> </profile>
<activation><property><name>test-sybase</name></property></activation>
<dependencies> <!-- Profile for testing with Sybase DB using the jTDS driver -->
<dependency> <profile>
<groupId>net.sourceforge.jtds</groupId> <id>test-sybase</id>
<artifactId>jtds</artifactId> <activation><property><name>test-sybase</name></property></activation>
<version>1.2</version> <dependencies>
<scope>test</scope> <dependency>
</dependency> <groupId>net.sourceforge.jtds</groupId>
</dependencies> <artifactId>jtds</artifactId>
<properties> <version>1.2</version>
<connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name> <scope>test</scope>
<connection.url>${openjpa.sybase.url}</connection.url> </dependency>
<connection.username>${openjpa.sybase.username}</connection.username> </dependencies>
<connection.password>${openjpa.sybase.password}</connection.password> <properties>
</properties> <connection.driver.name>net.sourceforge.jtds.jdbc.Driver</connection.driver.name>
</profile> <connection.url>${openjpa.sybase.url}</connection.url>
<connection.username>${openjpa.sybase.username}</connection.username>
<!-- Profile for testing with a custom DB using a system jar --> <connection.password>${openjpa.sybase.password}</connection.password>
<!-- </properties>
For example, to test with Oracle, you might run: </profile>
mvn test -Dtest=TestPersistence -Ptest-custom \
-Dopenjpa.custom.driverjar=$(pwd)/drivers/jdbc-oracle-10_2_0_1_0.jar \ <!-- Profile for testing with a custom DB using a system jar -->
-Dopenjpa.custom.driverclass=oracle.jdbc.driver.OracleDriver \ <!--
-Dopenjpa.custom.url=jdbc:oracle:thin:@HOST:PORT:DBNAME \ For example, to test with Oracle, you might run:
-Dopenjpa.custom.username=USERNAME \ mvn test -Dtest=TestPersistence -Ptest-custom \
-Dopenjpa.custom.password=PASSWORD -Dopenjpa.custom.driverjar=$(pwd)/drivers/jdbc-oracle-10_2_0_1_0.jar \
--> -Dopenjpa.custom.driverclass=oracle.jdbc.driver.OracleDriver \
<profile> -Dopenjpa.custom.url=jdbc:oracle:thin:@HOST:PORT:DBNAME \
<id>test-custom</id> -Dopenjpa.custom.username=USERNAME \
<activation><property><name>test-custom</name></property></activation> -Dopenjpa.custom.password=PASSWORD
<dependencies> -->
<dependency> <profile>
<groupId>openjpa.customdriver</groupId> <id>test-custom</id>
<artifactId>openjpa.customdriver</artifactId> <activation><property><name>test-custom</name></property></activation>
<version>1.0</version> <dependencies>
<scope>system</scope> <dependency>
<systemPath>${openjpa.custom.driverjar}</systemPath> <groupId>openjpa.customdriver</groupId>
</dependency> <artifactId>openjpa.customdriver</artifactId>
</dependencies> <version>1.0</version>
<properties> <scope>system</scope>
<connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name> <systemPath>${openjpa.custom.driverjar}</systemPath>
<connection.url>${openjpa.custom.url}</connection.url> </dependency>
<connection.username>${openjpa.custom.username}</connection.username> </dependencies>
<connection.password>${openjpa.custom.password}</connection.password> <properties>
</properties> <connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name>
</profile> <connection.url>${openjpa.custom.url}</connection.url>
<connection.username>${openjpa.custom.username}</connection.username>
<connection.password>${openjpa.custom.password}</connection.password>
<!-- Profile for testing with a custom DB using two system jars. </properties>
Some databases (DB2) use more than one jar for their JDBC provider. </profile>
Functionally this is identical to the previous profile, with a
second system dependency added.
--> <!-- Profile for testing with a custom DB using two system jars.
<!-- Some databases (DB2) use more than one jar for their JDBC provider.
For example, to test with DB2, you might run: Functionally this is identical to the previous profile, with a
mvn test -Dtest=TestPersistence -Ptest-custom2 \ second system dependency added.
-Dopenjpa.custom.driverjar1=$(pwd)/drivers/db2jcc.jar \ -->
-Dopenjpa.custom.driverjar2=$(pwd)/drviers/db2jcc_license_cu.jar \ <!--
-Dopenjpa.custom.driverclass=com.ibm.db2.jcc.DB2Driver \ For example, to test with DB2, you might run:
-Dopenjpa.custom.url=jdbc:db2://HOST:PORT/DBNAME \ mvn test -Dtest=TestPersistence -Ptest-custom2 \
-Dopenjpa.custom.username=USERNAME \ -Dopenjpa.custom.driverjar1=$(pwd)/drivers/db2jcc.jar \
-Dopenjpa.custom.password=PASSWORD -Dopenjpa.custom.driverjar2=$(pwd)/drviers/db2jcc_license_cu.jar \
--> -Dopenjpa.custom.driverclass=com.ibm.db2.jcc.DB2Driver \
<profile> -Dopenjpa.custom.url=jdbc:db2://HOST:PORT/DBNAME \
<id>test-custom2</id> -Dopenjpa.custom.username=USERNAME \
<activation><property><name>test-custom2</name></property></activation> -Dopenjpa.custom.password=PASSWORD
<dependencies> -->
<dependency> <profile>
<groupId>openjpa.customdriver1</groupId> <id>test-custom2</id>
<artifactId>openjpa.customdriver1</artifactId> <activation><property><name>test-custom2</name></property></activation>
<version>1.0</version> <dependencies>
<scope>system</scope> <dependency>
<systemPath>${openjpa.custom.driverjar1}</systemPath> <groupId>openjpa.customdriver1</groupId>
</dependency> <artifactId>openjpa.customdriver1</artifactId>
<dependency> <version>1.0</version>
<groupId>openjpa.customdriver2</groupId> <scope>system</scope>
<artifactId>openjpa.customdriver2</artifactId> <systemPath>${openjpa.custom.driverjar1}</systemPath>
<version>1.0</version> </dependency>
<scope>system</scope> <dependency>
<systemPath>${openjpa.custom.driverjar2}</systemPath> <groupId>openjpa.customdriver2</groupId>
</dependency> <artifactId>openjpa.customdriver2</artifactId>
</dependencies> <version>1.0</version>
<properties> <scope>system</scope>
<connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name> <systemPath>${openjpa.custom.driverjar2}</systemPath>
<connection.url>${openjpa.custom.url}</connection.url> </dependency>
<connection.username>${openjpa.custom.username}</connection.username> </dependencies>
<connection.password>${openjpa.custom.password}</connection.password> <properties>
</properties> <connection.driver.name>${openjpa.custom.driverclass}</connection.driver.name>
</profile> <connection.url>${openjpa.custom.url}</connection.url>
</profiles> <connection.username>${openjpa.custom.username}</connection.username>
<connection.password>${openjpa.custom.password}</connection.password>
<dependencies> </properties>
<dependency> </profile>
<groupId>org.apache.openjpa</groupId> </profiles>
<artifactId>openjpa-jdbc-5</artifactId>
<version>${pom.version}</version> <dependencies>
<scope>compile</scope> <dependency>
</dependency> <groupId>org.apache.openjpa</groupId>
<dependency> <artifactId>openjpa-jdbc-5</artifactId>
<groupId>org.apache.openjpa</groupId> <version>${pom.version}</version>
<artifactId>openjpa-persistence</artifactId> <scope>compile</scope>
<version>${pom.version}</version> </dependency>
<scope>compile</scope> <dependency>
</dependency> <groupId>org.apache.openjpa</groupId>
<dependency> <artifactId>openjpa-persistence</artifactId>
<groupId>commons-dbcp</groupId> <version>${pom.version}</version>
<artifactId>commons-dbcp</artifactId> <scope>compile</scope>
<version>1.2.1</version> </dependency>
<scope>test</scope> <dependency>
</dependency> <groupId>commons-dbcp</groupId>
<dependency> <artifactId>commons-dbcp</artifactId>
<groupId>commons-collections</groupId> <version>1.2.1</version>
<artifactId>commons-collections</artifactId> <scope>test</scope>
<version>3.2</version> </dependency>
<scope>test</scope> <dependency>
</dependency> <groupId>commons-collections</groupId>
</dependencies> <artifactId>commons-collections</artifactId>
<build> <version>3.2</version>
<plugins> <scope>test</scope>
<plugin> </dependency>
<artifactId>maven-compiler-plugin</artifactId> </dependencies>
<configuration> <build>
<source>1.5</source> <plugins>
<target>1.5</target> <plugin>
</configuration> <artifactId>maven-compiler-plugin</artifactId>
</plugin> <configuration>
<plugin> <source>1.5</source>
<artifactId>maven-antrun-plugin</artifactId> <target>1.5</target>
<executions> </configuration>
<execution> </plugin>
<phase>test-compile</phase> <plugin>
<configuration> <artifactId>maven-antrun-plugin</artifactId>
<tasks> <executions>
<path id="cp"> <execution>
<path refid="maven.test.classpath"/> <phase>test-compile</phase>
<path refid="maven.compile.classpath"/> <configuration>
<path refid="maven.dependency.classpath"/> <tasks>
</path> <path id="cp">
<taskdef name="openjpac" classname= <path refid="maven.test.classpath"/>
"org.apache.openjpa.ant.PCEnhancerTask"> <path refid="maven.compile.classpath"/>
<classpath refid="cp"/> <path refid="maven.dependency.classpath"/>
</taskdef> </path>
<fileset id="enhance.path.ref" <taskdef name="openjpac" classname=
dir="${project.build.testOutputDirectory}"> "org.apache.openjpa.ant.PCEnhancerTask">
<include name="**/*.class"/> <classpath refid="cp"/>
<exclude name="**/Test*.class"/> </taskdef>
<exclude name="**/inheritance/serializable/*.class"/> <fileset id="enhance.path.ref"
<exclude name="**/xml/*.class"/> dir="${project.build.testOutputDirectory}">
<exclude name="**/Unenhanced*.class"/> <include name="**/*.class"/>
<exclude name="**/AbstractUnenhanced*.class"/> <exclude name="**/Test*.class"/>
</fileset> <exclude name="**/inheritance/serializable/*.class"/>
<openjpac> <exclude name="**/xml/*.class"/>
<classpath refid="cp"/> <exclude name="**/Unenhanced*.class"/>
<fileset refid="enhance.path.ref"/> <exclude name="**/AbstractUnenhanced*.class"/>
<config log="DefaultLevel=${openjpa.loglevel}"/> </fileset>
</openjpac> <openjpac>
<!-- Set detach state for serialization tests --> <classpath refid="cp"/>
<openjpac> <fileset refid="enhance.path.ref"/>
<config detachState="fgs(DetachedStateField=true)"/> <config log="DefaultLevel=${openjpa.loglevel}"/>
<classpath refid="cp"/> </openjpac>
<fileset dir="${project.build.testOutputDirectory}"> <!-- Set detach state for serialization tests -->
<include name="**/inheritance/serializable/*.class"/> <openjpac>
<!-- include files from orm.xml --> <config detachState="fgs(DetachedStateField=true)"/>
<include name="**/xml/*.class"/> <classpath refid="cp"/>
<exclude name="**/Test*.class"/> <fileset dir="${project.build.testOutputDirectory}">
</fileset> <include name="**/inheritance/serializable/*.class"/>
<config log="DefaultLevel=${openjpa.loglevel}"/> <!-- include files from orm.xml -->
</openjpac> <include name="**/xml/*.class"/>
</tasks> <exclude name="**/Test*.class"/>
</configuration> </fileset>
<goals> <config log="DefaultLevel=${openjpa.loglevel}"/>
<goal>run</goal> </openjpac>
</goals> </tasks>
</execution> </configuration>
</executions> <goals>
</plugin> <goal>run</goal>
<plugin> </goals>
<groupId>org.apache.maven.plugins</groupId> </execution>
<artifactId>maven-surefire-plugin</artifactId> </executions>
<configuration> </plugin>
<argLine>-Xmx500m</argLine> <plugin>
<systemProperties> <groupId>org.apache.maven.plugins</groupId>
<property> <artifactId>maven-surefire-plugin</artifactId>
<name>openjpa.Log</name> <configuration>
<value>DefaultLevel=${openjpa.loglevel}</value> <argLine>${test.jvm.arguments}</argLine>
</property> <systemProperties>
<property> <property>
<name>openjpa.ConnectionDriverName</name> <name>openjpa.Log</name>
<value>org.apache.commons.dbcp.BasicDataSource</value> <value>DefaultLevel=${openjpa.loglevel}</value>
</property> </property>
<property> <property>
<name>derby.stream.error.file</name> <name>openjpa.ConnectionDriverName</name>
<value>target/derby.log</value> <value>org.apache.commons.dbcp.BasicDataSource</value>
</property> </property>
<property> <property>
<name>openjpa.ConnectionProperties</name> <name>derby.stream.error.file</name>
<value>DriverClassName=${connection.driver.name},Url=${connection.url},MaxActive=100,MaxIdle=0,MaxWait=10000,TestOnBorrow=true,Username=${connection.username},Password=${connection.password}</value> <value>target/derby.log</value>
</property> </property>
</systemProperties> <property>
</configuration> <name>openjpa.ConnectionProperties</name>
</plugin> <value>DriverClassName=${connection.driver.name},Url=${connection.url},MaxActive=100,MaxIdle=0,MaxWait=10000,TestOnBorrow=true,Username=${connection.username},Password=${connection.password}</value>
</plugins> </property>
</build> </systemProperties>
</project> </configuration>
</plugin>
</plugins>
</build>
</project>