Testing-JUnit and TestNG

Version 8.1 by Greg.Brown on 2009/09/26 11:59
Warning
For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Testing with JUnit and the similar TestNG

Minor configuration in eclipse

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 :
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 :

Unknown macro: noformat. Click on this message for details.

For an application it should be (using the handy wolipsdirloc variable)

Unknown macro: noformat. Click on this message for details.

RunConfig1.jpg

Then, in the classpath tab, select the "User Entries" entry and use the "Advanced..." button and select the "Add Folders" button.
RunConfig2.jpg

Select the "Java" folder of your build product.
Use the "Up/Down" buttons to move this folder at the first position of your classpath.
RunConfig3.jpg

Warning

Be Careful

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.