Changes for page Testing

Last modified by Pascal Robert on 2012/01/03 10:53

From version 31.1
edited by Ray Kiddy
on 2009/07/29 15:59
Change comment: There is no comment for this version
To version 21.1
edited by Ray Kiddy
on 2009/07/29 16:18
Change comment: re-format, adding example

Summary

Details

Page properties
Content
... ... @@ -1,29 +1,69 @@
1 +There are many documents relevant to testing that should be evaluated for veracity, usefulness and relevance:
2 +
3 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Project+WONDER-Frameworks-ERSelenium
4 +* http:~/~/wiki.objectstyle.org/confluence/display/WONDER/Selenium+Introduction
5 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Web+Services-Testing+Services+with+Terminal
6 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Web+Applications-Development-Testing+and+JUnit
7 +* http:~/~/wiki.objectstyle.org/confluence/display/WONDER/How+to+Develop+Selenium+Tests
8 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Testing-Load+Testing+WO+Apps+with+JMeter
9 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Testing-JUnit
10 +* http:~/~/wiki.objectstyle.org/confluence/display/WO/Testing-WOUnitTest
11 +
12 +== Junit Testing of Project Wonder in Ant Builds ==
13 +
1 1  I have checked in changes to the ant build files. The result of these is:
2 2  
3 -1) If you do a build as you used to do a build, there should be no change.
16 +1. 1) If you do a build as you used to do a build, there should be no change.
17 +1. 2) There are two targets at the top-level:
18 +1*. test-all - does a clean and then build of frameworks,applications, and examples with Dinclude.tests=true.
19 +1*. test-run - calls a junit test on selected proje
20 +1. 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.
21 +1. 4) I added a little stub of a test to ERExtensions. It does nothing right now.
22 +1. 5) I added a top-level target for "build" in Wonder/build.xml, just because it should be there.
4 4  
5 -2) There are two targets at the top-level:
24 +Various things are needed to enable testing in a project:
6 6  
7 -    test-all - does a clean and then build of frameworks,applications, and examples with Dinclude.tests=true.
26 +1. 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.
27 +1. 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:
28 +1*. <param name="test.className" value="er.chronic.ChronicTestSuite" />
8 8  
9 -&nbsp;&nbsp; &nbsp;test-run - calls a junit test on selected projects
30 +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.\\
10 10  
11 -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.
32 +{{code}}
12 12  
13 -4) I added a little stub of a test to ERExtensions. It does nothing right now.
34 +% cd Wonder
35 +% ant tests.run
36 +Buildfile: build.xml
14 14  
15 -5) I added a top-level target for "build" in Wonder/build.xml, just because it should be there.
38 +tests.run:
16 16  
17 -Various things are needed to enable testing in a project:
40 +tests.run:
18 18  
19 -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.
42 +ERExtensions.all:
20 20  
21 -2) 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:
44 +global.environment:
22 22  
23 -&nbsp;&nbsp; &nbsp;<param name="test.className" value="er.chronic.ChronicTestSuite" />
46 +global.properties:
24 24  
25 -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.
48 +global.framework.test:
49 +    [junit] Testsuite: er.extensions.statistics.ERXMetricsTest
50 +    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.002 sec
51 +    [junit]
26 26  
27 -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.
53 +ERChronic.all:
28 28  
29 -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.
55 +global.environment:
56 +
57 +global.properties:
58 +
59 +global.framework.test:
60 +    [junit] Testsuite: er.chronic.ChronicTestSuite
61 +    [junit] Tests run: 74, Failures: 0, Errors: 0, Time elapsed: 0.355 sec
62 +    [junit]
63 +
64 +BUILD SUCCESSFUL
65 +Total time: 0 seconds
66 +
67 +{{/code}}
68 +
69 +\\