I meant to say:
Each module's build.xml should expose a "funtional-tests" target. The testsuite/build.xml will then call this target via the [ant] task.
Yes. This is great by me. Will add the functional-tests target to the remoting build.xml next week, so can try it out.
The alternative is to have a tests or testsuite directory in each module that would have a build.xml that is picked up by a subant task and the testsuite/build.xml would have a funtional-tests which executed against all modules defined to have functional tasks.
Ok, Tom, what do you think about Scott's suggestion? I prefer this because it reduces coupling between the testsuite and other modules. You can access targets and properties from your main build.xml by using the [import] task.
Take a look at this:
I always hit the submit button too soon.
What are the standards for directory structure of the tests? Do tests go in module/src/test or module/tests/src?
Why is module/tests/src instead of module/src/test? Thought most people have module/src/test and module/src/main.
Because module/test will contain more than just source. It needs to contain the build.xml to drive the testsuite. There is no current standard for module local functional tests.
Ok. Good with me. Will make the change. If this is the new standard, think will be several other modules that will need to make the change (jmx, jms, etc.).
I am applying the guidelines from http://www.jboss.org/wiki/Wiki.jsp?page=FunctionalTests to JBoss Messaging (jboss-head/jms) and I have several questions so far:
1. Is there any recommended package structure to use under /module/tests/src? Should be org.jboss.test.messaging.... or the decision is left to the module developers?
I am currently using a package structure that mirrors the module's package structure, but I don't think this is such a good idea, should we ever want to bundle functional tests together with the rest of the module's artifacts, because it will lead to name collisions.
2. Is there a recommended way (build.xml targets and implementation examples) to run individual tests or all tests from specific packages? The old testsuite allows for
./build.sh -Dtest=org.jboss.test.mypackage.MyTest one-test and ./build.sh -Dtest=mypackage test
If there is an example, I will be happy to use it, otherwise I will try to recycle sections of the old testsuite build.xml.
3. I think it would be good idea to insert into http://www.jboss.org/wiki/Wiki.jsp?page=FunctionalTests a module/test/build.xml example. People could use it as a starting point and also it will showcase the latest policies concerning functional tests. If you also think it is a good idea, I could start by inserting the build.xml I am currently using.
1. You are correct, there needs to be an additional level here. I have added your recommended package structure to the wiki page.
2. We need the additional targets you describe. The testsuite is the best place to start for these.
3. I have added a place for you to put the build.xml when you are done. It is at the bottom of the wiki page.
As part of build system refactoring, we need to create a testsuite/imports/functional-tests-build.xml which can be imported by module's tests/build.xml to provide the common functionality for building & running these tests.
Also, the above wiki doc will need to be incorporated into the testsuite docbook.