| <!--/******************************************************************************* |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
| * which accompanies this distribution. |
| * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| * and the Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Ant naming conventions: |
| * - regardless of the actual OS platform,'/' is the directory separator |
| * (Ant will convert as appropriate). |
| * - multi-word properties use periods '.' |
| * - properties ending in .jar define jarfile names only (no path) |
| * - properties ending in .lib are fully qualified jars (path and filename) |
| * - properties ending in .dir are directory paths |
| * - properties ending in .path are path refid names (classpath fragments) |
| * - multi-word targets use hyphens '-' |
| * - targets beginning with test- are reserved for high level test targets, |
| * and are used in test results parsing |
| * - targets typically use the form <action>-<object>-<type> (ie. package-bundle-zip) |
| * - multi-word macros use underscores '_' |
| * - multi-word macro attributes are concatenated |
| * e.g. 'runpathref' |
| * - multi-word tasks (taskdef) names are concatenated |
| * e.g. 'validateconnection' |
| * - OS environment variables are in ALLCAPS and have 'env' as a prefix |
| * e.g. ${env.XXX}. |
| * - Ant properties are lower case. |
| * |
| * Contributors: |
| * tware - initial API and implementation |
| * egwin - update to adopt calling standards |
| #******************************************************************************/--> |
| <!-- This ant project includes the following tasks: |
| - build (default) : cleans, compiles, and packages all tests |
| - clean : cleans up all generated files and dirs |
| - compile : compiles all tests |
| - package : packages test jar |
| - test : runs tests |
| - test-oracle: Runs Core Oracle-specific tests |
| |
| It requires some configuration of the build.properties and test.properties to run. |
| --> |
| <project name="eclipselink.extension.oracle.test" default="build" basedir="."> |
| <available file="../${ant.project.name}" type="dir" property="oracle_test.is.local"/> |
| <fail message="Not running from '${ant.project.name}' directory" unless="oracle_test.is.local"/> |
| |
| <dirname property="oracle_test.build.location_temp" file="${ant.file.eclipselink.extension.oracle.test}"/> |
| <pathconvert targetos="unix" property="oracle_test.build.location"> |
| <path> |
| <pathelement location="${oracle_test.build.location_temp}"/> |
| </path> |
| </pathconvert> |
| <echo message="oracle_test.build.location = '${oracle_test.build.location}'"/> |
| <condition property="oracle_test.2.base.dir" value="../.." else=".."> |
| <contains string="${oracle_test.build.location}" substring="foundation"/> |
| </condition> |
| <echo message="oracle_test.2.base.dir = '${oracle_test.2.base.dir}'"/> |
| <property name="oracle_test.2.common.plugins.dir" value="${oracle_test.2.base.dir}/plugins"/> |
| <property name="oracle_test.2.core.dir" value="../org.eclipse.persistence.core"/> |
| <property name="oracle_test.2.core.test.dir" value="../eclipselink.core.test"/> |
| <property name="oracle_test.2.jpa.dir" value="${oracle_test.2.base.dir}/jpa/org.eclipse.persistence.jpa"/> |
| <property name="oracle_test.2.jpa.test.dir" value="${oracle_test.2.base.dir}/jpa/eclipselink.jpa.test"/> |
| <property name="oracle_test.plugins.dir" value="../plugins"/> |
| |
| <!-- Allows a user to overide certain user specific properties. --> |
| <property file="${user.home}/build.properties"/> |
| <property file="${user.home}/test.properties"/> |
| <property file="${oracle_test.build.location}/build.properties"/> |
| <property file="${oracle_test.build.location}/${test.properties}"/> |
| <property file="${oracle_test.build.location}/test.properties"/> |
| |
| <!-- Local path variables --> |
| <property name="oracle_test.src.dir" value="${oracle_test.build.location}/${src.dir}"/> |
| <property name="oracle_test.resource.dir" value="${oracle_test.build.location}/${resource.dir}"/> |
| <property name="oracle_test.classes.dir" value="${oracle_test.build.location}/${classes.dir}"/> |
| <property name="oracle_test.report.dir" value="${oracle_test.build.location}/${report.dir}"/> |
| <property name="oracle_test.run.dir" value="${oracle_test.build.location}/${run.dir}"/> |
| |
| <!-- Default ant target, compiles and translates resources, does not run tests. --> |
| <target name="build" depends="clean, compile, package" description="build Oracle extension tests"/> |
| |
| <!-- Clean all build generated content. --> |
| <target name="clean" description="Clean the build"> |
| <echo message="Cleaning..."/> |
| <echo message=" ${oracle_test.classes.dir}"/> |
| <echo message=" ${oracle_test.report.dir}"/> |
| <echo message=" ${oracle_test.run.dir}"/> |
| <echo message=" ${oracle_test.build.location}/${eclipselink.oracle.depend.test.jar}"/> |
| <echo message=" ${oracle_test.build.location}/eclipselink-struct-converter-model.jar"/> |
| <echo message=" ${oracle_test.build.location}/eclipselink-customfeatures-model.jar"/> |
| <echo message=" ${oracle_test.build.location}/eclipselink-jpa-oracle-tests.jar"/> |
| <delete includeEmptyDirs="true" failonerror="false"> |
| <fileset dir="${oracle_test.classes.dir}"/> |
| <fileset dir="${oracle_test.report.dir}"/> |
| <fileset dir="${oracle_test.run.dir}"/> |
| <fileset dir="${oracle_test.build.location}" includes="${eclipselink.oracle.depend.test.jar}"/> |
| <fileset dir="${oracle_test.build.location}" includes="eclipselink-struct-converter-model.jar"/> |
| <fileset dir="${oracle_test.build.location}" includes="eclipselink-customfeatures-model.jar"/> |
| <fileset dir="${oracle_test.build.location}" includes="eclipselink-jpa-oracle-tests.jar"/> |
| </delete> |
| </target> |
| |
| <target name="init"> |
| <!-- Give this a default value if not set in a user.home or test property file --> |
| <property name="oracle.extensions.depend.dir" value="../${oracle_test.2.base.dir}/extension.oracle.lib.external"/> |
| <property name="extensions.depend.dir" value="../${oracle_test.2.base.dir}/extension.lib.external"/> |
| <property name="junit.lib" value="${extensions.depend.dir}/junit.jar"/> |
| <echo message="oracle_test.src.dir ='${oracle_test.src.dir}'"/> |
| <echo message="oracle_test.resource.dir='${oracle_test.resource.dir}'"/> |
| <echo message="oracle_test.classes.dir ='${oracle_test.classes.dir}'"/> |
| <echo message="oracle_test.report.dir ='${oracle_test.report.dir}'"/> |
| <echo message="oracle_test.run.dir ='${oracle_test.run.dir}'"/> |
| <echo message="user.home ='${user.home}'"/> |
| <echo message="test.properties='${test.properties}'"/> |
| <echo message="extensions.depend.dir ='${extensions.depend.dir}'"/> |
| <echo message="junit.lib ='${junit.lib}'"/> |
| |
| <!-- versioning --> |
| <!-- These variables are set in autobuild.xml. A manual build gets defaults --> |
| <tstamp> |
| <format property="build.date" pattern="yyyyMMdd"/> |
| <format property="build.time" pattern="HHmm"/> |
| </tstamp> |
| <property name="build.type" value="SNAPSHOT"/> |
| <property name="svn.revision" value="NA"/> |
| <property name="version.qualifier" value="qualifier"/> |
| <property name="version.string" value="${release.version}.${version.qualifier}"/> |
| <property name="release.designation" value="EclipseLink ${release.version} Build"/> |
| |
| <!-- Determine appropriate settings for Oracle lib variables (overrides of .lib variables won't get reset) --> |
| <!-- Check first in oracle extensions dir --> |
| <condition property="oracle.xdb.lib" value="${oracle.extensions.depend.dir}/${oracle.xdb.jar}" |
| else="${extensions.depend.dir}/${oracle.xdb.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.xdb.jar}"/> |
| </condition> |
| <condition property="oracle.ojdbc.lib" value="${oracle.extensions.depend.dir}/${oracle.ojdbc.jar}" |
| else="${extensions.depend.dir}/${oracle.ojdbc.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.ojdbc.jar}"/> |
| </condition> |
| <condition property="oracle.aqapi.lib" value="${oracle.extensions.depend.dir}/${oracle.aqapi.jar}" |
| else="${extensions.depend.dir}/${oracle.aqapi.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.aqapi.jar}"/> |
| </condition> |
| <condition property="oracle.sdoapi.lib" value="${oracle.extensions.depend.dir}/${oracle.sdoapi.jar}" |
| else="${extensions.depend.dir}/${oracle.sdoapi.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.sdoapi.jar}"/> |
| </condition> |
| <condition property="oracle.xmlparser.lib" value="${oracle.extensions.depend.dir}/${oracle.xmlparser.jar}" |
| else="${extensions.depend.dir}/${oracle.xmlparser.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.xmlparser.jar}"/> |
| </condition> |
| <condition property="oracle.orai18n-mapping.lib" value="${oracle.extensions.depend.dir}/${oracle.orai18n-mapping.jar}" |
| else="${extensions.depend.dir}/${oracle.orai18n-mapping.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.orai18n-mapping.jar}"/> |
| </condition> |
| <condition property="oracle.ucp.lib" value="${oracle.extensions.depend.dir}/${oracle.ucp.jar}" |
| else="${extensions.depend.dir}/${oracle.ucp.jar}"> |
| <available file="${oracle.extensions.depend.dir}/${oracle.ucp.jar}"/> |
| </condition> |
| |
| <!-- Create needed directories |
| <mkdir dir="${oracle_test.classes.dir}"/> |
| <mkdir dir="${oracle_test.run.dir}"/> |
| <mkdir dir="${oracle_test.report.dir}"/ --> |
| |
| <!-- Determine availability of compile dependencies --> |
| <available file="${oracle_test.2.common.plugins.dir}/${antlr}_${version.string}.jar" property="antlr.bundle.exist"/> |
| <available file="${oracle_test.2.common.plugins.dir}/${asm}_${version.string}.jar" property="asm.bundle.exist"/> |
| <available file="${oracle_test.2.common.plugins.dir}/org.eclipse.persistence.jpa_${version.string}.jar" property="jpa.bundle.exist"/> |
| <available file="${oracle_test.2.common.plugins.dir}/org.eclipse.persistence.core_${version.string}.jar" property="core.bundle.exist"/> |
| <available file="${oracle_test.2.common.plugins.dir}/org.eclipse.persistence.oracle_${version.string}.jar" property="oracle.bundle.exist"/> |
| <available file="${oracle_test.2.base.dir}/${eclipselink.jar}" property="eclipselink.jar.exist"/> |
| <available file="${oracle_test.2.jpa.dir}/${classes.dir}" type="dir" property="jpa.classes.exist"/> |
| <available file="${oracle_test.2.core.dir}/${classes.dir}" type="dir" property="core.classes.exist"/> |
| <available file="${oracle_test.2.oracle.dir}/${classes.dir}" type="dir" property="oracle.classes.exist"/> |
| <available file="${junit.lib}" property="junit.lib.exist"/> |
| <available file="${oracle_test.2.common.plugins.dir}/${unsigned.persistence10.jar}" property="persistence.bundle.exist"/> |
| <available file="${oracle_test.2.core.test.dir}/${eclipselink.tests.jar}" property="test.framework.exist"/> |
| <available file="${oracle_test.2.jpa.test.dir}/${eclipselink.tests.jar}" property="jpatest.framework.exist"/> |
| <!-- Determine availability of runtime dependencies --> |
| <available file="${oracle_test.2.jpa.dir}/${resource.dir}" type="dir" property="jpa.resources.exist"/> |
| <available file="${oracle_test.2.core.dir}/${resource.dir}" type="dir" property="core.resources.exist"/> |
| <available file="${oracle_test.2.oracle.dir}/${resource.dir}" type="dir" property="oracle.resources.exist"/> |
| <available file="${jdbc.driver.jar}" property="jdbc.jar.exist"/> |
| <!-- Determine availability and location of Oracle dependencies --> |
| <available file="${oracle.extensions.depend.dir}" type="dir" property="oracle.depend.dir.exist"/> |
| <available file="${extensions.depend.dir}" type="dir" property="ext.depend.dir.exist"/> |
| <!-- Now retest using the regular extensions dir, if already found variables will not be reset --> |
| <available file="${oracle.xdb.lib}" property="oracle.xdb.lib.exist"/> |
| <available file="${oracle.ojdbc.lib}" property="oracle.ojdbc.lib.exist"/> |
| <available file="${oracle.aqapi.lib}" property="oracle.aqapi.lib.exist"/> |
| <available file="${oracle.sdoapi.lib}" property="oracle.sdoapi.lib.exist"/> |
| <available file="${oracle.xmlparser.lib}" property="oracle.xmlparser.lib.exist"/> |
| <available file="${oracle.ucp.lib}" property="oracle.ucp.lib.exist"/> |
| |
| <!-- Determine where to get product classes, based upon availability --> |
| <condition property="use.eclipselink"> |
| <isset property="eclipselink.jar.exist"/> |
| </condition> |
| <condition property="use.bundles"> |
| <and> |
| <isset property="antlr.bundle.exist"/> |
| <isset property="asm.bundle.exist"/> |
| <isset property="jpa.bundle.exist"/> |
| <isset property="core.bundle.exist"/> |
| <isset property="oracle.bundle.exist"/> |
| <not> <isset property="use.eclipselink"/> </not> |
| </and> |
| </condition> |
| <condition property="use.classes"> |
| <and> |
| <isset property="jpa.resources.exist"/> |
| <isset property="core.resources.exist"/> |
| <isset property="oracle.resources.exist"/> |
| <isset property="jpa.classes.exist"/> |
| <isset property="core.classes.exist"/> |
| <isset property="oracle.classes.exist"/> |
| <not> <isset property="use.eclipselink"/> </not> |
| <not> <isset property="use.bundles"/> </not> |
| </and> |
| </condition> |
| <condition property="use.failed"> |
| <and> |
| <not> <isset property="use.eclipselink"/> </not> |
| <not> <isset property="use.bundles"/> </not> |
| <not> <isset property="use.classes"/> </not> |
| </and> |
| </condition> |
| <!-- Determine availability of other dependencies --> |
| <condition property="dependency.ok"> |
| <and> |
| <isset property="test.framework.exist"/> |
| <isset property="jpatest.framework.exist"/> |
| <isset property="junit.lib.exist"/> |
| <isset property="oracle.xdb.lib.exist"/> |
| <isset property="oracle.ojdbc.lib.exist"/> |
| <isset property="oracle.aqapi.lib.exist"/> |
| <isset property="oracle.sdoapi.lib.exist"/> |
| <isset property="oracle.xmlparser.lib.exist"/> |
| <isset property="oracle.ucp.lib.exist"/> |
| </and> |
| </condition> |
| <condition property="run.ok"> |
| <and> |
| <not> <isset property="use.failed"/> </not> |
| <isset property="jdbc.jar.exist"/> |
| </and> |
| </condition> |
| </target> |
| |
| <target name="init_eclipselink" if="use.eclipselink"> |
| <echo message="Using EclipseLink.jar as 'product' in compile dependency."/> |
| <path id="oracle_test.product.path"> |
| <pathelement path="${oracle_test.2.base.dir}/${eclipselink.jar}"/> |
| </path> |
| </target> |
| <target name="init_bundles" if="use.bundles"> |
| <echo message="Using EclipseLink OSGi bundles as 'product' in compile dependency."/> |
| <path id="oracle_test.product.path"> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/${antlr}_${version.string}.jar"/> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/${asm}_${version.string}.jar"/> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/org.eclipse.persistence.core_${version.string}.jar"/> |
| </path> |
| </target> |
| <target name="init_classes" if="use.classes"> |
| <echo message="Using EclipseLink classes directly as 'product' in compile dependency."/> |
| <path id="oracle_test.product.path"> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/${antlr}"/> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/${asm}"/> |
| <pathelement path="${oracle_test.2.jpa.dir}/${classes.dir}"/> |
| <pathelement path="${oracle_test.2.jpa.dir}/${resource.dir}"/> |
| <pathelement path="${oracle_test.2.core.dir}/${classes.dir}"/> |
| <pathelement path="${oracle_test.2.core.dir}/${resource.dir}"/> |
| <pathelement path="${oracle_test.2.oracle.dir}/${classes.dir}"/> |
| <pathelement path="${oracle_test.2.oracle.dir}/${resource.dir}"/> |
| </path> |
| </target> |
| <target name="init_dependency" if="dependency.ok" depends="announce_missing_dependencies"> |
| <path id="oracle_test.oracle.dependency.path"> |
| <pathelement path="${oracle.xdb.lib}"/> |
| <pathelement path="${oracle.ojdbc.lib}"/> |
| <pathelement path="${oracle.aqapi.lib}"/> |
| <pathelement path="${oracle.sdoapi.lib}"/> |
| <pathelement path="${oracle.xmlparser.lib}"/> |
| <pathelement path="${oracle.orai18n-mapping.lib}"/> |
| <pathelement path="${oracle.ucp.lib}"/> |
| <pathelement path="${junit.lib}"/> |
| </path> |
| <path id="oracle_test.test.infrastructure.path"> |
| <pathelement path="${oracle_test.2.core.test.dir}/${eclipselink.tests.jar}"/> |
| <pathelement path="${oracle_test.2.jpa.test.dir}/${eclipselink.tests.jar}"/> |
| <pathelement path="${junit.lib}"/> |
| </path> |
| <path id="oracle_test.public.dependency.path"> |
| <pathelement path="${oracle_test.2.common.plugins.dir}/${unsigned.persistence10.jar}"/> |
| <fileset dir="${oracle_test.2.common.plugins.dir}" includes="${eclipselink.core.depend}"/> |
| </path> |
| </target> |
| <target name="init_paths" depends="init, init_eclipselink, init_bundles, init_classes, init_dependency"> |
| <fail message="Product classes do not exist anywhere! Compile product or populate jars." if="use.failed"/> |
| <!-- Define 'Helper' path refids --> |
| <path id="oracle_test.runtime.only.path"> |
| <pathelement path="${oracle_test.build.location}/${eclipselink.oracle.depend.test.jar}"/> |
| <pathelement path="${oracle_test.run.dir}"/> |
| <pathelement path="${jdbc.driver.jar}"/> |
| <pathelement path="${oracle_test.2.core.test.dir}/resource"/> |
| </path> |
| <!-- Classpath used for compiling tests. --> |
| <path id="oracle_test.compile.path"> |
| <path refid="oracle_test.product.path"/> |
| <path refid="oracle_test.public.dependency.path"/> |
| <path refid="oracle_test.oracle.dependency.path"/> |
| <path refid="oracle_test.test.infrastructure.path"/> |
| </path> |
| <!-- Classpath used for running tests. --> |
| <path id="oracle_test.run.path"> |
| <path refid="oracle_test.compile.path"/> |
| <path refid="oracle_test.runtime.only.path"/> |
| </path> |
| </target> |
| <target name="announce_missing_dependencies" unless="dependency.ok" description="publicize missing dependencies"> |
| <echo message="Following is a list of dependencies and their status ('found=' anything but 'true' means it wasn't found):"/> |
| <echo message=" Test infrastructure:"/> |
| <echo message=" '${junit.lib}' :: found='${junit.lib.exist}'"/> |
| <echo message=" '${oracle_test.2.jpa.test.dir}/${eclipselink.tests.jar}' :: found='${jpatest.framework.exist}'"/> |
| <echo message=" '${oracle_test.2.core.test.dir}/${eclipselink.tests.jar}' :: found='${test.framework.exist}'"/> |
| <echo message="The test framework is currently part of the core.test and jpa.test projects. Be sure they are built."/> |
| <echo message=" oracle dependency location: '${oracle.extensions.depend.dir}' :: found='${oracle.depend.dir.exist}'"/> |
| <echo message=" dependency location: '${extensions.depend.dir}' :: found='${ext.depend.dir.exist}'"/> |
| <echo message=" '${oracle.xdb.lib}' :: found='${oracle.xdb.lib.exist}'"/> |
| <echo message=" '${oracle.ojdbc.lib}' :: found='${oracle.ojdbc.lib.exist}'"/> |
| <echo message=" '${oracle.aqapi.lib}' :: found='${oracle.aqapi.lib.exist}'"/> |
| <echo message=" '${oracle.sdoapi.lib}' :: found='${oracle.sdoapi.lib.exist}'"/> |
| <echo message=" '${oracle.xmlparser.lib}' :: found='${oracle.xmlparser.lib.exist}'"/> |
| <echo message=" '${oracle.ucp.lib}' :: found='${oracle.ucp.lib.exist}'"/> |
| <echo message="Please put your Oracle dependencies in one of the two 'dependency' locations (default or custom defined)."/> |
| <fail message="Missing dependencies!" unless="compile.ok"/> |
| </target> |
| |
| <!-- Compiles all tests. --> |
| <target name="compile" depends="init_paths" description="compile EclipseLink Oracle tests"> |
| <echo message="Using the following oracle dependencies:"/> |
| <echo message=" '${oracle.xdb.lib}'"/> |
| <echo message=" '${oracle.ojdbc.lib}'"/> |
| <echo message=" '${oracle.aqapi.lib}'"/> |
| <echo message=" '${oracle.sdoapi.lib}'"/> |
| <echo message=" '${oracle.xmlparser.lib}'"/> |
| <echo message=" '${oracle.orai18n-mapping.lib}'"/> |
| <echo message=" '${oracle.ucp.lib}'"/> |
| <mkdir dir="${oracle_test.classes.dir}"/> |
| <javac srcdir="${oracle_test.src.dir}" |
| destdir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/**, java/sql/**" |
| debug="${javac.debug}" |
| debuglevel="${javac.debuglevel}" |
| optimize="${javac.optimize}" |
| source="${javac.version}" |
| target="${javac.version}" |
| deprecation="${javac.deprecation}" |
| failonerror="true" |
| memoryMaximumSize="512m" |
| fork="true"> |
| <classpath> |
| <path refid="oracle_test.compile.path"/> |
| </classpath> |
| </javac> |
| </target> |
| |
| <target name="package"> |
| <!-- Package the structconverter JPA model jar. --> |
| <jar jarfile="eclipselink-struct-converter-model.jar"> |
| <zipfileset dir="resource/structconverter" includes="*.xml" prefix="META-INF"/> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/testing/models/jpa/**"/> |
| </jar> |
| <!-- Package the customfeatures JPA model jar. --> |
| <jar jarfile="eclipselink-customfeatures-model.jar"> |
| <zipfileset dir="resource/customfeatures" includes="*.xml" prefix="META-INF"/> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/testing/models/jpa/customfeatures/**"/> |
| </jar> |
| <!-- Package the proxyauthentication JPA model jar. --> |
| <jar jarfile="eclipselink-proxyauthentication-model.jar"> |
| <zipfileset dir="resource/proxyauthentication" includes="*.xml" prefix="META-INF"/> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/testing/models/jpa/proxyauthentication/**"/> |
| </jar> |
| <!-- Package the timestamptz JPA model jar. --> |
| <jar jarfile="eclipselink-timestamptz-model.jar"> |
| <zipfileset dir="resource/timestamptz" includes="*.xml" prefix="META-INF"/> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/testing/models/jpa/timestamptz/**"/> |
| </jar> |
| <!-- Package the JPA oracle specific tests jar. --> |
| <jar jarfile="eclipselink-jpa-oracle-tests.jar"> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/testing/tests/jpa/**"/> |
| </jar> |
| <!-- Build tests jar. --> |
| <jar jarfile="${eclipselink.oracle.depend.test.jar}"> |
| <fileset dir="${oracle_test.classes.dir}" |
| includes="org/eclipse/persistence/**/*.class" |
| excludes="org/eclipse/persistence/testing/models/jpa/**, |
| org/eclipse/persistence/testing/tests/jpa/**"/> |
| </jar> |
| </target> |
| |
| <target name="init_run" depends="init_paths"> |
| <mkdir dir="${oracle_test.run.dir}"/> |
| <mkdir dir="${oracle_test.report.dir}"/> |
| <copy file="${oracle_test.2.core.test.dir}/${resource.dir}/java.policy.allpermissions" todir="${oracle_test.run.dir}" overwrite="true"/> |
| </target> |
| |
| <!-- Default test target, runs test.class from test.properties (default is OracleTestModel). --> |
| <target name="test" depends="init_run"> |
| <run_test testclass="${test.class}" dburl="${db.url}"/> |
| <generate.report/> |
| </target> |
| |
| <!-- Runs Core Oracle-specific tests. --> |
| <target name="test-oracle" depends="init_run"> |
| <echo message="Creating MY_GEOMETRY datatype for spatial tests: ${db.url}..."/> |
| <sql driver="${db.driver}" |
| url="${db.url}" |
| userid="${db.user}" |
| password="${db.pwd}" |
| onerror="continue" |
| > |
| <classpath> |
| <pathelement location="${jdbc.driver.jar}"/> |
| </classpath> |
| CREATE OR REPLACE TYPE MY_GEOMETRY AS OBJECT (id NUMBER, geom MDSYS.SDO_GEOMETRY); |
| </sql> |
| <run_test testclass="org.eclipse.persistence.testing.tests.OracleTestModel" dburl="${db.url}"/> |
| <run_test testclass="org.eclipse.persistence.testing.tests.xdb.XDBTestModel" dburl="${db.oci.url}"/> |
| <run_test testclass="org.eclipse.persistence.testing.tests.xdb.XDBTestModelMWIntegration" dburl="${db.oci.url}"/> |
| <run_test testclass="org.eclipse.persistence.testing.tests.unwrappedconnection.UnwrapConnectionXDBTestModel" dburl="${db.oci.url}"/> |
| <generate_report/> |
| </target> |
| |
| <!-- Prompt runner test target, runs test.class from test.properties (default is OracleTestModel). --> |
| <target name="test-prompt" depends="init_run"> |
| <run_test_prompt testclass="${test.class}" dburl="${db.url}"/> |
| </target> |
| |
| <!-- Launches the testing browser --> |
| <target name="test-browser"> |
| <echo>Running test browser</echo> |
| <mkdir dir="${oracle_test.run.dir}"/> |
| <mkdir dir="${oracle_test.report.dir}"/> |
| <copy file="${oracle_test.2.core.test.dir}/${resource.dir}/java.policy.allpermissions" todir="${oracle_test.run.dir}" overwrite="true"/> |
| <java classname="org.eclipse.persistence.testing.framework.ui.TestingBrowserFrame" |
| fork="true" |
| maxmemory="512m" |
| failonerror="false" |
| dir="${run.dir}"> |
| <jvmarg value="-Declipselink.logging.level=${logging.level}"/> |
| <jvmarg value="-Ddb.driver=${db.driver}"/> |
| <jvmarg value="-Ddb.url=${db.url}"/> |
| <jvmarg value="-Ddb.user=${db.user}"/> |
| <jvmarg value="-Ddb.pwd=${db.pwd}"/> |
| <jvmarg value="-Ddb.platform=${db.platform}"/> |
| <jvmarg value="-Djava.security.manager"/> |
| <jvmarg value="-Djava.security.policy=../java.policy.allpermissions"/> |
| <classpath> |
| <path refid="oracle_test.run.path"/> |
| </classpath> |
| </java> |
| </target> |
| |
| <!-- Generic target for running tests. --> |
| <macrodef name="run_test"> |
| <attribute name="testclass"/> |
| <attribute name="dburl"/> |
| <sequential> |
| <echo>Running test on @{dburl}</echo> |
| <junit printsummary="yes" failureproperty="junit.failed" fork="yes" forkmode="once" showoutput="true" maxmemory="512m" dir="${run.dir}"> |
| <jvmarg value="-Declipselink.logging.level=${logging.level}"/> |
| <jvmarg value="-Ddb.driver=${db.driver}"/> |
| <jvmarg value="-Ddb.url=@{dburl}"/> |
| <jvmarg value="-Ddb.user=${db.user}"/> |
| <jvmarg value="-Ddb.pwd=${db.pwd}"/> |
| <jvmarg value="-Ddb.platform=${db.platform}"/> |
| <jvmarg value="-Djava.security.manager"/> |
| <jvmarg value="-Djava.security.policy=./java.policy.allpermissions"/> |
| <classpath> |
| <path refid="oracle_test.run.path"/> |
| </classpath> |
| <formatter type="xml"/> |
| <test name="@{testclass}" haltonfailure="no" outfile="${report.dir}/@{testclass}-test-results"> |
| </test> |
| </junit> |
| </sequential> |
| </macrodef> |
| |
| <macrodef name="generate_report"> |
| <sequential> |
| <junitreport todir="${report.dir}"> |
| <fileset dir="${report.dir}"> |
| <include name="*test-results.xml"/> |
| </fileset> |
| <report format="noframes" todir="${report.dir}"/> |
| </junitreport> |
| </sequential> |
| </macrodef> |
| |
| <!-- Runs the test using the PromptTestRunner --> |
| <macrodef name="run_test_prompt"> |
| <attribute name="testclass"/> |
| <attribute name="dburl"/> |
| <sequential> |
| <echo>Running test on @{dburl}</echo> |
| <java classname="org.eclipse.persistence.testing.framework.PromptTestRunner" |
| fork="true" |
| maxmemory="512m" |
| failonerror="false" |
| dir="${oracle_test.run.dir}"> |
| <jvmarg value="-Declipselink.logging.level=${logging.level}"/> |
| <jvmarg value="-Ddb.driver=${db.driver}"/> |
| <jvmarg value="-Ddb.url=@{dburl}"/> |
| <jvmarg value="-Ddb.user=${db.user}"/> |
| <jvmarg value="-Ddb.pwd=${db.pwd}"/> |
| <jvmarg value="-Ddb.platform=${db.platform}"/> |
| <jvmarg value="${test.security-manager}"/> |
| <jvmarg value="${test.security-manager.policy}"/> |
| <arg value="pfile=../test.properties" /> |
| <arg value="testmodel=@{testclass}" /> |
| <arg value="regressionlog=${report.dir}/@{testclass}-test.log" /> |
| <arg value="saveresults=true" /> |
| <classpath> |
| <path refid="oracle_test.run.path"/> |
| </classpath> |
| </java> |
| </sequential> |
| </macrodef> |
| </project> |