There are many documents relevant to testing that should be evaluated for veracity, usefulness and relevance:
Junit Testing of Project Wonder in Ant Builds
I have checked in changes to the ant build files. The result of these is:
- 1) If you do a build as you used to do a build, there should be no change.
- 2) There are two targets at the top-level:
- test-all - does a clean and then build of frameworks,applications, and examples with -Dinclude.tests=true.
- test-run - calls a junit test on selected proje
- 3) If the "test-all" target is invoked, then, in addition to any test sources being built in the other projects, the Wonder/Tests/ERXTest project is built. Is anyone involved in that project? If not, no harm, no foul.
- 4) I added a little stub of a test to ERExtensions. It does nothing right now.
- 5) I added a top-level target for "build" in Wonder/build.xml, just because it should be there.
Various things are needed to enable testing in a project:
- 1) There must be a "Tests" directory in the top level of the project. So chill has spoken and thus it shall be done. Put junit test java sources under that.
- There must be a parameter which defines the main test class. This could be a TestSuite, which would then invoke all the tests in the project. For example, the "ERChronic.all" target in the Build/build/build.xml file now includes the line:
- <param name="test.className" value="er.chronic.ChronicTestSuite" />
If there is no Tests directory in a project or if there are no sources in the Tests directory, then a build for testing does nothing more than a normal build. If there is no test.className property set in a project's target, then a build for testing does nothing more than a normal build. If there is no test.className property or there are no test classes in the jar files in the build root, then no tests from that project will be run. An example of a "test-run" appears below.