Running Unit TestsPage edited by Andrus AdamchikCayenne provides a comprehensive suite of unit tests. To execute unit tests you must first get Cayenne from SVN, install JDK 1.5 and obtain the latest Maven. PrerequisitesOn some systems (e.g. Ubuntu 8.x) the following line needs to be placed in "~/.mavenrc" or otherwise there will be test failures in the unit tests relying on JGroups. This is a workaround of a known JVM bug: MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"
The rest of the database properties can be specified either on the command line or via a configuration file. First let's look at the command line options, extending the above example: $ mvn test -DcayenneTestConnection=mysql \ -DcayenneAdapter=org.apache.cayenne.dba.mysql.MySQLAdapter \ -DcayenneJdbcUsername=myuser \ -DcayenneJdbcPassword=mypassword \ -DcayenneJdbcUrl=jdbc:mysql://localhost/cayenne \ -DcayenneJdbcDriver=com.mysql.jdbc.Driver Another way to store this information permanently for each profile is to create a directory $HOME/.cayenne/ and place a file called connection.properties in this directory. File contents should be similar to this example: mysql.cayenne.adapter = org.apache.cayenne.dba.mysql.MySQLAdapter mysql.jdbc.username = someuser mysql.jdbc.password = somepasswd mysql.jdbc.url = "" mysql.jdbc.driver = com.xyz.MyDriverClass oracle.cayenne.adapter = org.apache.cayenne.dba.oracle.OracleAdapter oracle.jdbc.username = someuser oracle.jdbc.password = somepasswd oracle.jdbc.url = "" oracle.jdbc.driver = com.xyz.MyDriverClass Each property starts with the Maven profile name ("mysql" and "oracle" in the example above). Look at test resultsTo look for failed tests, grep the output files. $ grep FAIL framework/cayenne-jdk1.5-unpublished/target/surefire-reports/*.txt
Change Notification Preferences
View Online
|
View Change
|
- [CONF] Apache Cayenne Website > Running Unit Tests confluence
