By Andreas Fester-Oracle on Jul 27, 2015
Sometimes it is necessary to set specific java properties or to add specific virtual machine options when unit tests are executed with JDeveloper's JUnit test runner. However, there is no separate option to modify the runtime environment for the test runner - it simply takes the active run configuration which is selected in the "Run/Choose Active Run Configuration" menu (which is by the way the case for any "Run..." and "Debug..." actions executed from context menus, e.g. on a ViewController project).
Adding a test execution specific run configuration (e.g. to add properties to enable logging) is therefore not different from adding a new run configuration for an application:
Select "Run/Choose Active Run Configuration/Manage Run configurations" and press "New" to create a new run configuration:
JDeveloper allows to copy an existing run configuration (e.g. "Default") as the basis. Press "Ok" to save the new configuration, then, press "Edit" to open the Run Configuration Editor:
Add some java properties, like -D to define a property or -X to define memory settings. Then press "Ok". Also press "Ok" on the "Project properties" dialog to close it.
The new run configuration is now available in the "Run/Choose Active Run Configuration" menu. To run the JUnit tests with this configuration, simply set it as active and launch the JUnit test.
|Remember that this is now the active run configuration for all Run/Debug actions - you might want to reset it to "Default" or something else before launching your application the next time.|