Maven complicates things on the logging front, as it does a lot of redirection.
cd $GEOTOOLS_HOME/gt/module/main mvn test
By default:
- the logs from testing end up in target/test-reports or target/surefire-reports sub-directory of each module
- There should be XML and text files for the results of each test
Be sure to check both, as one of the wrinkles of maven makes it so the output isn't always exactly the same.
| Logging (Maven 1) To have maven display the logging as it tests instead of just writing to files, set the maven.junit.usefile property to false. To set a property, you can either:
|
- Another helpful testing hint
In order to run only one test (replace with the test case class you want to run):
// send output to file (as is normally done in a build) maven -Dtest=Rendering2DTest test
If you are having problems with logging output levels be sure to read the logging section.
| Setting a proxy server for running tests (Maven 1) If you are behind a firewall, you should have configured maven to use a proxy server. maven.junit.jvmargs=-Xmx512M -Dhttp.proxyHost=${maven.proxy.host} -Dhttp.proxyPort=${maven.proxy.port}
|
Online Testing
Many tests require an online resource to run such as a remote server. These tests are excluded from the default build as often these online resources are not available and as a result case tests to fail. The naming convention for these tests is to name them as OnlineTest. Examples:
- PostgisDataStoreAPIOnlineTest.java
- WMS1_0_0_OnlineTest.java
To execute online tests during a build, the online profiles is used:
mvn test -P online
Stress Testing
Stress tests can roughly be defined as tests that dont add much test coverage to a module, and take a extended amount of time to run. These tests are excluded from the default build as they are time consuming. The naming convention for these tests is to name them as StressTest. Examples:
- GMLParserStressTest.java
- WFSIonicStressTest.java
To execute stress tests during a build, the stress profiles is used:
mvn test -P stress