Page Edited :
CAY :
Legacy Ant Build
Legacy Ant Build has been edited by Andrus Adamchik (Dec 18, 2006). Content:General ProcedureThis procedure applies to versions 1.2 and 2.0 that are built with Ant. To build Cayenne with Ant, check out the appropriate source code branch from Subversion and perform the following command to see available targets: # cd cayenne/cayenne-ant # ant help Required ant version - 1.6.* or newer; required JDK version - 1.5.* or newer. Note that compiled binaries are JDK 1.4 compatible, still JDK 1.5 is needed to build a few extensions.
Running Against Embedded HSQLDBNo extra setup is required. Just run Ant: # cd cayenne/cayenne-ant # ant test Optionally you may run JDK 1.4 tests only (e.g. if you don't have JDK 1.5 on your machine): # cd cayenne/cayenne-ant # ant test-1_4 This will use an embedded HSQLDB. Running tests against your own database requires a few extra steps described below. Running Against a Specific DatabaseStep 1: Configure One or More Data SourcesCreate a directory $HOME/.cayenne/ and place a file called connection.properties in this directory. File contents should be similar to this example: example1.cayenne.adapter = org.apache.cayenne.dba.mysql.MySQLAdapter example1.jdbc.username = someuser example1.jdbc.password = somepasswd example1.jdbc.url = "" example1.jdbc.driver = com.xyz.MyDriverClass example2.cayenne.adapter = org.apache.cayenne.dba.oracle.OracleAdapter example2.jdbc.username = someuser example2.jdbc.password = somepasswd example2.jdbc.url = "" example2.jdbc.driver = com.xyz.MyDriverClass Each key starts with an identifier for a datasource. In the file above, "example1" and "example2" are such identifiers. They can be arbitrary strings without "." (dot) symbols. Step 2. Run Tests Against Configured Data Source# cd cayenne/cayenne-ant # ant test -Dcayenne.test.connection=example1 Substitute "example1" with a name of your data source configured in the previous step. In case of total success, one of the last messages Ant prints on console is BUILD SUCCESSFUL. If build fails, failure report is generated in HTML format under cayenne/cayenne-ant/build/tests-report-example1/index.html and can be viewed using a web browser (again, substitute "example1" in this path with the name of data source used). Filtering TestsTo run only a subset of test cases, Ant-style pattern matching can be used. A property called test.filter defines a set of class files to be run. For instance to run only tests from the "tools" package, the following startup parameters can be used: # cd cayenne/cayenne-ant # ant test -Dcayenne.test.connection=example1 -Dtest.filter="**/tools/*Tst.class" |
Unsubscribe or edit your notifications preferences