Wiki source code of Testing-JUnit
Version 2.1 by fjecker on 2009/05/19 06:44
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
2.1 | 1 | = Testing with JUnit = |
| 2 | |||
| 3 | == Minor configuration in eclipse == | ||
| 4 | |||
| 5 | To be able to test your business objects layer in JUnit test cases, you should set the following parameters in your test case/test suite launch configuration : | ||
| 6 | First in the //"Arguments"// tab, set your working directory to the build product of your project. For example, for a framework project the working directory should be : | ||
| 7 | |||
| 8 | {{noformat}} | ||
| 9 | |||
| 10 | ${workspace_loc:MyEclipseProject/build/MyEclipseProject.framework} | ||
| 11 | |||
| 12 | {{/noformat}} | ||
| 13 | |||
| 14 | For an application it should be (using the handy wolips//dir//loc variable) | ||
| 15 | |||
| 16 | {{noformat}} | ||
| 17 | |||
| 18 | ${working_dir_loc_WOLips:MyEcliseProject} | ||
| 19 | |||
| 20 | {{/noformat}} | ||
| 21 | |||
| 22 | [[image:RunConfig1.jpg]] | ||
| 23 | |||
| 24 | Then, in the classpath tab, select the //"User Entries"// entry and use the //"Advanced..."// button and select the //"Add Folders"// button. | ||
| 25 | [[image:RunConfig2.jpg]] | ||
| 26 | |||
| 27 | Select the //"Java"// folder of your build product. | ||
| 28 | Use the //"Up/Down"// buttons to move this folder at the first position of your classpath. | ||
| 29 | [[image:RunConfig3.jpg]] | ||
| 30 | |||
| 31 | {{note title="Be Careful"}} | ||
| 32 | |||
| 33 | If during your tests execution you see error messages such as *cannot cast EOGenericRecord to <your object>* please check that the _"Java"_ folder is at first position in your classpath entries. | ||
| 34 | |||
| 35 | {{/note}} |