blob: 7e9e58ba157afe244bf6b6914fc5bafb07a21a7a [file] [log] [blame]
<!--/*******************************************************************************
* 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-nosql: Runs Core nosql-specific tests
It requires some configuration of the build.properties and test.properties to run.
-->
<project name="eclipselink.extension.nosql.test" default="build" basedir=".">
<available file="../${ant.project.name}" type="dir" property="nosql_test.is.local"/>
<fail message="Not running from '${ant.project.name}' directory" unless="nosql_test.is.local"/>
<dirname property="nosql_test.build.location_temp" file="${ant.file.eclipselink.extension.nosql.test}"/>
<pathconvert targetos="unix" property="nosql_test.build.location">
<path>
<pathelement location="${nosql_test.build.location_temp}"/>
</path>
</pathconvert>
<echo message="nosql_test.build.location = '${nosql_test.build.location}'"/>
<condition property="nosql_test.2.base.dir" value="../.." else="..">
<contains string="${nosql_test.build.location}" substring="foundation"/>
</condition>
<echo message="nosql_test.2.base.dir = '${nosql_test.2.base.dir}'"/>
<property name="nosql_test.2.common.plugins.dir" value="${nosql_test.2.base.dir}/plugins"/>
<property name="nosql_test.2.core.dir" value="../org.eclipse.persistence.core"/>
<property name="nosql_test.2.core.test.dir" value="../eclipselink.core.test"/>
<property name="nosql_test.2.nosql.dir" value="../org.eclipse.persistence.nosql"/>
<property name="nosql_test.2.jpa.dir" value="${nosql_test.2.base.dir}/jpa/org.eclipse.persistence.jpa"/>
<property name="nosql_test.2.jpa.test.dir" value="${nosql_test.2.base.dir}/jpa/eclipselink.jpa.test"/>
<property name="nosql_test.2.jpa.plugins.dir" value="${nosql_test.2.base.dir}/jpa/plugins"/>
<property name="nosql_test.2.buildsys.dir" value="${nosql_test.2.base.dir}/buildsystem"/>
<property name="nosql_test.plugins.dir" value="../plugins"/>
<!-- Allows a user to overide certain user specific properties. -->
<condition property="custom.properties.message" value="Loading ${user.home}/build.properties..."
else="Custom properties file '${user.home}/build.properties' not found to load.">
<available file="${user.home}/build.properties"/>
</condition>
<echo message="${custom.properties.message}"/>
<property file="${user.home}/build.properties"/>
<property file="${user.home}/test.properties"/>
<property file="${nosql_test.build.location}/antbuild.properties"/>
<property file="${nosql_test.build.location}/${test.properties}"/>
<property file="${nosql_test.build.location}/test.properties"/>
<!-- Local path variables -->
<property name="nosql_test.src.dir" value="${nosql_test.build.location}/${src.dir}"/>
<property name="nosql_test.resource.dir" value="${nosql_test.build.location}/${resource.dir}"/>
<property name="nosql_test.classes.dir" value="${nosql_test.build.location}/${classes.dir}"/>
<property name="nosql_test.report.dir" value="${nosql_test.build.location}/${report.dir}"/>
<property name="nosql_test.run.dir" value="${nosql_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 nosql extension tests"/>
<!-- Clean all build generated content. -->
<target name="clean" description="Clean the build">
<echo message="Cleaning..."/>
<echo message=" ${nosql_test.classes.dir}"/>
<echo message=" ${nosql_test.report.dir}"/>
<echo message=" ${nosql_test.run.dir}"/>
<echo message=" ${nosql_test.build.location}/${nosql.jpa.test.jar}"/>
<echo message=" ${nosql_test.build.location}/${nosql.test.jar}"/>
<echo message=" ${nosql_test.build.location}/${mongo.model.jar}"/>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${nosql_test.classes.dir}"/>
<fileset dir="${nosql_test.report.dir}"/>
<fileset dir="${nosql_test.run.dir}"/>
<fileset dir="${nosql_test.build.location}" includes="${nosql.jpa.test.jar}"/>
<fileset dir="${nosql_test.build.location}" includes="${nosql.test.jar}"/>
<fileset dir="${nosql_test.build.location}" includes="${mongo.model.jar}"/>
</delete>
</target>
<target name="init">
<property name="custom.tasks.lib" value="${nosql_test.2.buildsys.dir}/ant_customizations.jar"/>
<property name="custom.echo.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.Say"/>
<property name="custom.selectbundle.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.SelectBundle"/>
<taskdef name="say" classname="${custom.echo.task.class}" classpath="${custom.tasks.lib}"/>
<taskdef name="selectbundle" classname="${custom.selectbundle.task.class}" classpath="${custom.tasks.lib}"/>
<!-- Give this a default value if not set in a user.home or test property file -->
<property name="extensions.depend.dir" value="../${nosql_test.2.base.dir}/extension.lib.external"/>
<property name="junit.lib" value="${extensions.depend.dir}/junit.jar"/>
<echo message="nosql_test.src.dir ='${nosql_test.src.dir}'"/>
<echo message="nosql_test.resource.dir='${nosql_test.resource.dir}'"/>
<echo message="nosql_test.classes.dir ='${nosql_test.classes.dir}'"/>
<echo message="nosql_test.report.dir ='${nosql_test.report.dir}'"/>
<echo message="nosql_test.run.dir ='${nosql_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 lib variables (overrides of .lib variables won't get reset) -->
<condition property="coretest.framework.lib" value="${nosql_test.2.core.test.dir}/${coretest.framework.jar}">
<available file="${nosql_test.2.core.test.dir}/${coretest.framework.jar}"/>
</condition>
<condition property="coretest.lib" value="${nosql_test.2.core.test.dir}/${coretest.jar}">
<available file="${nosql_test.2.core.test.dir}/${coretest.jar}"/>
</condition>
<condition property="jpatest.framework.lib" value="${nosql_test.2.jpa.test.dir}/${jpatest.framework.jar}">
<available file="${nosql_test.2.jpa.test.dir}/${jpatest.framework.jar}"/>
</condition>
<!-- Create needed directories
<mkdir dir="${nosql_test.classes.dir}"/>
<mkdir dir="${nosql_test.run.dir}"/>
<mkdir dir="${nosql_test.report.dir}"/ -->
<!-- Determine availability of compile dependencies -->
<selectbundle basename="org.eclipse.orbit.mongodb" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="mongo.lib" includepath="true"
/>
<selectbundle basename="javax.persistence" directory="${nosql_test.build.location}/${nosql_test.2.jpa.plugins.dir}" separator="_"
criterion="[2.0.0,3.0.0)" property="persistence.lib" includepath="true"
/>
<selectbundle basename="javax.resource" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[1.0.0,3.0.0)" property="resource.lib" includepath="true"
/>
<selectbundle basename="${antlr}" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="antlr.lib" includepath="true"
/>
<selectbundle basename="${asm}" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="asm.lib" includepath="true"
/>
<selectbundle basename="org.eclipse.persistence.jpa" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="oep.jpa.lib" includepath="true"
/>
<selectbundle basename="org.eclipse.persistence.core" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="oep.core.lib" includepath="true"
/>
<selectbundle basename="org.eclipse.persistence.nosql" directory="${nosql_test.build.location}/${nosql_test.2.common.plugins.dir}" separator="_"
criterion="[2.0.0,9.0.0)" property="oep.nosql.lib" includepath="true"
/>
<available file="${nosql_test.2.jpa.dir}/${classes.dir}" type="dir" property="jpa.classes.exist"/>
<available file="${nosql_test.2.core.dir}/${classes.dir}" type="dir" property="core.classes.exist"/>
<available file="${nosql_test.2.nosql.dir}/${classes.dir}" type="dir" property="nosql.classes.exist"/>
<available file="${nosql_test.2.base.dir}/${eclipselink.jar}" property="eclipselink.jar.exist"/>
<available file="${junit.lib}" property="junit.lib.exist"/>
<available file="${coretest.framework.lib}" property="test.framework.exist"/>
<available file="${coretest.lib}" property="core.test.exist"/>
<available file="${jpatest.framework.lib}" property="jpatest.framework.exist"/>
<!-- Determine availability of runtime dependencies -->
<available file="${nosql_test.2.jpa.dir}/${resource.dir}" type="dir" property="jpa.resources.exist"/>
<available file="${nosql_test.2.core.dir}/${resource.dir}" type="dir" property="core.resources.exist"/>
<available file="${nosql_test.2.nosql.dir}/${resource.dir}" type="dir" property="nosql.resources.exist"/>
<available file="${jdbc.driver.jar}" property="jdbc.jar.exist"/>
<say message="mongo.lib: '${mongo.lib}'" if="mongo.lib"/>
<say message="persistence.lib: '${persistence.lib}'" if="persistence.lib"/>
<say message="resource.lib: '${resource.lib}'" if="resource.lib"/>
<say message="antlr.lib: '${antlr.lib}'" if="antlr.lib"/>
<say message="asm.lib: '${asm.lib}'" if="asm.lib"/>
<say message="core.lib: '${oep.core.lib}'" if="oep.core.lib"/>
<say message="jpa.lib: '${oep.jpa.lib}'" if="oep.jpa.lib"/>
<say message="nosql.lib: '${oep.nosql.lib}'" if="oep.nosql.lib"/>
<say message="oracle.nosql.lib: '${oep.oracle.nosql.lib}'" if="oep.oracle.nosql.lib"/>
<!-- Determine where to get product classes, based upon availability -->
<condition property="use.eclipselink">
<and>
<isset property="eclipselink.jar.exist"/>
<isset property="oep.nosql.lib"/>
</and>
</condition>
<condition property="use.bundles">
<and>
<isset property="antlr.lib"/>
<isset property="asm.lib"/>
<isset property="oep.core.lib"/>
<isset property="oep.jpa.lib"/>
<isset property="oep.nosql.lib"/>
<not> <isset property="use.eclipselink"/> </not>
</and>
</condition>
<condition property="use.classes">
<and>
<isset property="core.resources.exist"/>
<isset property="jpa.resources.exist"/>
<isset property="nosql.resources.exist"/>
<isset property="core.classes.exist"/>
<isset property="jpa.classes.exist"/>
<isset property="nosql.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="mongo.lib"/>
<isset property="resource.lib"/>
</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="nosql_test.product.path">
<pathelement path="${nosql_test.2.base.dir}/${eclipselink.jar}"/>
<pathelement path="${oep.nosql.lib}"/>
</path>
</target>
<target name="init_bundles" if="use.bundles">
<echo message="Using EclipseLink OSGi bundles as 'product' in compile dependency."/>
<path id="nosql_test.product.path">
<pathelement path="${antlr.lib}"/>
<pathelement path="${asm.lib}"/>
<pathelement path="${oep.core.lib}"/>
<pathelement path="${oep.nosql.lib}"/>
</path>
</target>
<target name="init_classes" if="use.classes">
<echo message="Using EclipseLink classes directly as 'product' in compile dependency."/>
<path id="nosql_test.product.path">
<pathelement path="${nosql_test.2.common.plugins.dir}/${antlr}"/>
<pathelement path="${nosql_test.2.common.plugins.dir}/${asm}"/>
<pathelement path="${nosql_test.2.jpa.dir}/${classes.dir}"/>
<pathelement path="${nosql_test.2.jpa.dir}/${resource.dir}"/>
<pathelement path="${nosql_test.2.core.dir}/${classes.dir}"/>
<pathelement path="${nosql_test.2.core.dir}/${resource.dir}"/>
<pathelement path="${nosql_test.2.nosql.dir}/${classes.dir}"/>
<pathelement path="${nosql_test.2.nosql.dir}/${resource.dir}"/>
</path>
</target>
<target name="init_dependency" if="dependency.ok" depends="announce_missing_dependencies">
<path id="nosql_test.nosql.dependency.path">
<pathelement path="${mongo.lib}"/>
<pathelement path="${resource.lib}"/>
<pathelement path="${junit.lib}"/>
</path>
<path id="nosql_test.test.infrastructure.path">
<pathelement path="${coretest.framework.lib}"/>
<pathelement path="${coretest.lib}"/>
<pathelement path="${jpatest.framework.lib}"/>
<pathelement path="${junit.lib}"/>
</path>
<path id="nosql_test.public.dependency.path">
<pathelement path="${persistence.lib}"/>
<fileset dir="${nosql_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="nosql_test.runtime.only.path">
<pathelement path="${nosql_test.build.location}/${nosql.jpa.test.jar}"/>
<pathelement path="${nosql_test.build.location}/${mongo.model.jar}"/>
<pathelement path="${nosql_test.build.location}/${nosql.test.jar}"/>
<pathelement path="${nosql_test.run.dir}"/>
<pathelement path="${jdbc.driver.jar}"/>
<pathelement path="${nosql_test.2.core.test.dir}/resource"/>
</path>
<!-- Classpath used for compiling tests. -->
<path id="nosql_test.compile.path">
<path refid="nosql_test.product.path"/>
<path refid="nosql_test.public.dependency.path"/>
<path refid="nosql_test.nosql.dependency.path"/>
<path refid="nosql_test.test.infrastructure.path"/>
<pathelement path="${nosql_test.resource.dir}"/>
</path>
<!-- Classpath used for running tests. -->
<path id="nosql_test.run.path">
<path refid="nosql_test.compile.path"/>
<path refid="nosql_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:"/>
<echo message=" Test infrastructure:"/>
<say message=" found. :: '${junit.lib}'" if="junit.lib.exist"/>
<say message=" missing! :: '${junit.lib}'" unless="junit.lib.exist"/>
<say message=" found. :: '${nosql_test.2.jpa.test.dir}/${jpatest.framework.jar}'" if="jpatest.framework.exist"/>
<say message=" missing! :: '${nosql_test.2.jpa.test.dir}/${jpatest.framework.jar}'" unless="jpatest.framework.exist"/>
<say message=" found. :: '${nosql_test.2.core.test.dir}/${coretest.framework.jar}'" if="test.framework.exist"/>
<say message=" missing! :: '${nosql_test.2.core.test.dir}/${coretest.framework.jar}'" unless="test.framework.exist"/>
<say message=" found. :: '${nosql_test.2.core.test.dir}/${coretest.jar}'" if="core.test.exist"/>
<say message=" missing! :: '${nosql_test.2.core.test.dir}/${coretest.jar}'" unless="core.test.exist"/>
<echo message="The test framework jars are currently part of the core.test and jpa.test projects. Be sure they are built."/>
<echo message=" dependency location:"/>
<say message=" found. :: '${extensions.depend.dir}'" if="ext.depend.dir.exist"/>
<say message=" missing! :: '${extensions.depend.dir}'" unless="ext.depend.dir.exist"/>
<say message=" found. :: '${mongo.lib}'" if="mongo.lib"/>
<say message=" missing! :: '${extensions.depend.dir}/${mongo.jar}'" unless="mongo.lib"/>
<fail message="Missing dependencies!" unless="dependency.ok"/>
</target>
<!-- Compiles all tests. -->
<target name="compile" depends="init_paths" description="compile EclipseLink nosql tests">
<echo message="Using the following nosql dependencies:"/>
<echo message=" '${mongo.lib}'"/>
<mkdir dir="${nosql_test.classes.dir}"/>
<javac srcdir="${nosql_test.src.dir}"
destdir="${nosql_test.classes.dir}"
includes="org/eclipse/persistence/**, java/sql/**"
debug="${javac.debug}"
debuglevel="${javac.debuglevel}"
encoding="UTF-8"
optimize="${javac.optimize}"
source="${javac.version}"
target="${javac.version}"
deprecation="${javac.deprecation}"
failonerror="true"
memoryMaximumSize="512m"
fork="true">
<classpath>
<path refid="nosql_test.compile.path"/>
</classpath>
</javac>
</target>
<target name="package">
<!-- Package the Mongo JPA model jar. -->
<jar jarfile="${mongo.model.jar}">
<zipfileset dir="resource/mongo" includes="*.xml" prefix="META-INF"/>
<fileset dir="${nosql_test.classes.dir}"
includes="org/eclipse/persistence/testing/models/jpa/mongo/**"/>
</jar>
<!-- Package the JPA nosql specific tests jar. -->
<jar jarfile="${nosql.jpa.test.jar}">
<fileset dir="${nosql_test.classes.dir}"
includes="org/eclipse/persistence/testing/tests/jpa/**"/>
</jar>
<!-- Build tests jar. -->
<jar jarfile="${nosql.test.jar}">
<fileset dir="${nosql_test.classes.dir}"
includes="org/eclipse/persistence/**/*.class"
excludes="org/eclipse/persistence/testing/models/jpa/**,
org/eclipse/persistence/testing/tests/jpa/**"/>
<fileset dir="${nosql_test.resource.dir}"
includes="org/eclipse/persistence/**"/>
</jar>
</target>
<target name="init_run" depends="init_paths">
<mkdir dir="${nosql_test.run.dir}"/>
<mkdir dir="${nosql_test.report.dir}"/>
<copy file="${nosql_test.2.core.test.dir}/${resource.dir}/java.policy.allpermissions" todir="${nosql_test.run.dir}" overwrite="true"/>
</target>
<!-- Default test target, runs test.class from test.properties (default is nosqlJPATestModel). -->
<target name="test" depends="build, init_run">
<run_test testclass="${test.class}" dburl="${db.url}"/>
<generate_report/>
</target>
<target name="test-eis" depends="init_run">
<run_test testclass="org.eclipse.persistence.testing.tests.eis.xmlfile.XMLFileTestModel" dburl="${db.url}"/>
<run_test testclass="org.eclipse.persistence.testing.tests.eis.cobol.CobolTestModel" dburl="${db.url}"/>
<run_moxy_test testclass="org.eclipse.persistence.testing.oxm.mappings.onetoone.OneToOneMappingTestSuite" platform="DOM"/>
<run_moxy_test testclass="org.eclipse.persistence.testing.oxm.mappings.onetomany.OneToManyMappingTestSuite" platform="DOM"/>
<run_moxy_test testclass="org.eclipse.persistence.testing.oxm.mappings.onetoone.OneToOneMappingTestSuite" platform="SAX"/>
<run_moxy_test testclass="org.eclipse.persistence.testing.oxm.mappings.onetomany.OneToManyMappingTestSuite" platform="SAX"/>
<generate_report/>
</target>
<!-- Prompt runner test target, runs test.class from test.properties (default is nosqlJPATestModel). -->
<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="${nosql_test.run.dir}"/>
<mkdir dir="${nosql_test.report.dir}"/>
<copy file="${nosql_test.2.core.test.dir}/${resource.dir}/java.policy.allpermissions" todir="${nosql_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="nosql_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="nosql_test.run.path"/>
</classpath>
<formatter type="xml"/>
<test name="@{testclass}" haltonfailure="no" outfile="${report.dir}/@{testclass}-test-results">
</test>
</junit>
</sequential>
</macrodef>
<macrodef name="run_moxy_test">
<attribute name="testclass"/>
<attribute name="platform"/>
<sequential>
<junit printsummary="yes" failureproperty="junit.failed" fork="yes" forkmode="once" showoutput="true" maxmemory="512m" dir="${nosql_test.resource.dir}">
<sysproperty key="platformType" value="@{platform}"/>
<jvmarg value="-Declipselink.logging.level=${logging.level}"/>
<classpath>
<path refid="nosql_test.run.path"/>
</classpath>
<formatter type="xml"/>
<test name="@{testclass}" haltonfailure="no" outfile="${report.dir}/@{testclass}-@{platform}-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="${nosql_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="nosql_test.run.path"/>
</classpath>
</java>
</sequential>
</macrodef>
</project>