In the following example,
1. <target name="tests.unit">
2. <junit>
3. <batchtest>
4. <fileset dir="tsrc">
5. <include name="**/Test*.java"/>
6. <exclude name="**/tests/*.java"/>
7. </fileset>
8. </batchtest>
9. </junit>
10. </target>
11. <target name="tests.integration">
12. <junit>
13. <batchtest>
14. <fileset dir="tsrc">
15. <include name="**/tests/Test*.java"/>
16. </fileset>
17. </batchtest>
18. </junit>
19. </target>
If i have several TestSuites in in the **/tests/ folder. How will it know which test suite to run first if i run the tests.integration target? If i have TestSuite1.java, TestSuite2.java and TestSuite3.java i would like the test suites to run in the order as specified in teh filename.
Yes i am trying to create a test suite for a functional test not unit tests. Im trying to use junit to build the functional tests package. I am using selenium which is based on Junit.
Lets say i have a website where you cant do anything without logging on. In this case i have a test case that tests the logging on functionality and then i would have another test case that would test something else. The order they will be executed will matter because i cant test anything before logging on which means the order should be
in the above test cases, i cant read any product before it is created and that i have logged and i cant create a product before i have logged on. I have seen a lot of comments about using the setUp() and tearDown() methods but surely that would mean a lot of duplication.
If for example i have to make TestReadProduct test case independent, i would have to put the TestLogin and TestCreateproduct functionality in the setUp() method for the TestCreateProduct test case. Surely this is a maintenance nightmare. Imagine having to maintain 5000 of testcases. I would have to make a lot of changes in a lot of places if the TestLogin functionality changes.
I am thinking of using the “depends” option in ANT.
Something like this
isnt there a better way of doing this?