Child pages
  • Testing-JUnit and TestNG

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: differentiation between normal and bundle-less builds

...

To be able to test your business objects layer in JUnit or TestNG test cases, you should set the following parameters in your test case/test suite launch configuration :
depending on if you are using normal or bundle-less builds.

Normal builds

A normal build means that you have checked the build option Generate bundles within the WOLips preferences.

Image Added

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:

...

Select the "Java" folder of your build product.

Note

If you are using bundle-less builds you don't have a build folder. You need to check the Generate bundles option in the preferences WOLips->Build and clean your project to get it generated.

Use the "Up/Down" buttons to move this folder at the first position of your classpath.

Note
titleBe 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.

The last step is to add the parameter -DNSProjectBundleEnabled=true to your VM parameters.
Image Added

Bundle-less builds

A bundle-less build means that you have unchecked the build option Generate bundles within the WOLips preferences.

Image Added

That means that there will be no build folder in your project. In that case you must set the working directoy to the default:

No Format

${workspace_loc:MyEclipseProject}

On the classpath tab you don't need to add the "Java" folder of your build product so only the default classpath should be listed for the "User Entries". Be sure to add the parameter -DNSProjectBundleEnabled=true to your VM parameters as for normal builds.