You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2010/02/24 08:10:45 UTC
svn commit: r915704 -
/db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml
Author: tfischer
Date: Wed Feb 24 07:10:45 2010
New Revision: 915704
URL: http://svn.apache.org/viewvc?rev=915704&view=rev
Log:
update test project info
Modified:
db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml
Modified: db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml?rev=915704&r1=915703&r2=915704&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml (original)
+++ db/torque/torque4/trunk/torque-site/src/site/xdoc/developer-info/test-project.xml Wed Feb 24 07:10:45 2010
@@ -21,7 +21,6 @@
<document>
<properties>
<title>Test project</title>
- <author email="fischer@seitenbau.de">Thomas Fischer</author>
</properties>
<body>
@@ -33,119 +32,64 @@
a normal Torque project, with the following differences:
<ul>
<li>
- It contains additional maven goals to run the tests
+ Instead of directly using the schema files from the
+ <i>src/main/schema</i> directory, the schema files are copied
+ to the directory <i>target/torque/test/schema</i>,
+ and some tokens are replaced during copying.
+ For the tests, the schema files from
+ <i>target/torque/test/schema</i> with the replaced tokens are used.
+ </li>
+ </ul>
+ </p>
+ </section>
+ <section name="Running the test project">
+ <p>
+ In order to run the test project using maven 2, use the following
+ procedure:
+ <ul>
+ <li>
+ Check out the trunk containing the Torque modules
+ from the svn repository.
</li>
<li>
- Instead of directly using the schema files from the
- <i>src/schema</i> directory, the schema files are copied to the
- directory <i>target/schema</i>, and some tokens are replaced during
- copying.
- For the tests, the schema files from <i>target/schema</i> with the
- replaced tokens are used.
+ Change into the each of the directories <i>torque-runtime</i>,
+ <i>torque-generator</i>, <i>torque-templates</i>
+ and <i>torque-generator-maven2-plugin</i>
+ and run the command <code>mvn install</code>
+ in each of the directories (in the order above).
+ </li>
+ <li>
+ Change into the directory <i>torque-test</i>,
+ and change one of the profiles in the file <i>profiles.xml</i>
+ to match the database which you want to test against.
</li>
<li>
- The test project POM extends the POM of one of the test profiles
- (which in turn extend the POM of the Torque runtime in order to
- include all dependencies of the runtime). To choose the parent POM
- out of the many profiles, the maven parameter
- <code>torque.test.profile</code> must be set to the name of the
- directory containing the chosen profile (see below for instructions
- and an example).
+ In the directory <i>torque-test</i>,
+ run the command <code>mvn -P${profile} test</code>
+ to run the test, replacing the variable
+ <code>${profile}</code> with the name of your chosen profile.
+ For example, if you want to test against mysql, run
+ <code>mvn -Pmysql test</code>
</li>
</ul>
</p>
-
- <subsection name="Running the test project using Maven 1">
- <p>
- In order to run the test project, the following procedure is
- recommended:
- <ul>
- <li>
- Check out the trunks module from the svn repository
- </li>
- <li>
- Change into the directory <i>trunks/test/profile</i>, and change
- one of the profiles to match the database which you want to test
- against. The file <i>project.xml</i> contains the location of
- the jdbc driver (you might need to install the driver manually
- to the local maven repository, see the Tutorial on how to do
- this). The file <i>project.properties</i> contains the
- settings for the maven plugin (and thus the generator),
- and the file <i>Torque.properties</i> contains the settings for
- the runtime.
- </li>
- <li>
- Change into the directory <i>trunks/test/test-project</i>,
- and run the command
- <code>maven -Dtorque.test.profile=${profile}</code>
- to run the test, replacing the variable
- <code>${profile}</code> with the name of your chosen profile
- directory. For example, if you want to test against mysql, run
- <code>maven -Dtorque.test.profile=mysql</code>
- <br />
- If you want to build all Torque modules from source, install them
- in your local maven repository, and run the test using the newly
- installed Torque components all in one rush, use the command
- <code>maven -Dtorque.test.profile=${profile} torque-test:install-run</code>
- </li>
- </ul>
- </p>
- </subsection>
-
- <subsection name="Common pitfalls when using Maven 1">
- <p>
- If maven complains about not being able to load its parent POM,
- this is probably due to one of the following:
- <ul>
- <li>
- The maven parameter <code>torque.test.profile</code>
- is either not set or set to the wrong value. Set it to a valid
- value, for example by using the command line parameter
- <code>-Dtorque.test.profile=mysql</code> when running maven.
- </li>
- <li>
- You have not checked out the whole trunks module. The test project
- indirectly extends the runtime POM (via the profile POMs) to
- include the libary the runtime depends on. Either check out the
- whole trunks directory, or get the runtime POM from somewhere else
- and refer to it in the <extend> part of the
- profile.
- </li>
- </ul>
- </p>
- </subsection>
-
- <subsection name="Running the test project using Maven 2">
- <p>
- In order to run the test project with maven 2, use the following
- procedure:
- <ul>
- <li>
- Check out the trunks module from the svn repository.
- </li>
- <li>
- Change into the each of the directories <i>runtime</i>,
- <i>templates</i>, <i>generator</i> and <i>maven2-plugin</i>
- and run the command <code>mvn install</code>
- in each of the directories (in the order above).
- </li>
- <li>
- Change into the directory <i>trunks/test/test-project</i>,
- and change one of the profiles in the file <i>profiles.xml</i>
- to match the database which you want to test against.
- </li>
- <li>
- In the directory <i>trunks/test/test-project</i>,
- run the command <code>mvn -P${profile} test</code>
- to run the test, replacing the variable
- <code>${profile}</code> with the name of your chosen profile.
- For example, if you want to test against mysql, run
- <code>mvn -Pmysql test</code>
- </li>
- </ul>
- </p>
- </subsection>
-
+ </section>
+ <section name="Running mvn eclipse:eclipse on the test project">
+ <p>
+ Because dependency information is pulled from the profiles,
+ you need to enable a profile from the profiles.xml for
+ generating the eclipse files. Running <code>mvn eclipse:eclipse</code>
+ without a profile will result in the following error:
+ <br/>
+ <code>org.apache.maven.reactor.MavenExecutionException:
+ Failed to validate POM for project org.apache.torque:torque-test</code>
+ </p>
+ <p>
+ The profile you choose will also pull the database driver from the
+ profile into your eclipse project. E.G. if you want to use the
+ mysql driver dependency in your eclipse project, run
+ <code>mvn -Pmysql eclipse:eclipse</code>
+ </p>
</section>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org