New JUnit module test
To perform a module test, you need to create a new module test.
-
Select the Bean for which you want to create a module test → right-click → select the 'New JUnit module test' wizard.
-
Enter the package, type name, and logical name of the new module test. The default type name is generated based on the selected Bean.
-
To create a module test for a Bean method, select Select type, and to create an empty module test, select Not selected.
If you started the New JUnit Module Test wizard by selecting a Bean, Select Type is selected by default.
(1) Enter the conditions in the Dialog and click the Browse button.
(2) In the search results, select the Bean method to test.
(3) Click the OK button. -
If you started the New JUnit module test wizard without selecting a Bean, Not selected is selected.
To select a Bean, click the Browse button.
-
In the method list, check the methods you want to test. Test code is generated for the checked methods.
-
You can select all or deselect all methods.
-
Select the Endpoint URL to be tested.
-
Enter the system header to use. The value specified in the admin configuration is used as the default.
-
Click the Finish button to close the Dialog. To specify code generation options, click the Next button to move to the next page.
1. Source code generation options
You can specify code generation options for JUnit tests.
Methods for the checked options are generated together, and you can implement the method bodies according to your development environment.
-
beforeTest(): Method called immediately before the test
-
afterTest(): Method called immediately after the test
-
catchMalformedEndpointURLError(): Method called when a URL with an invalid format is used
-
catchInvalidEndpointURLError(): Method called when a wrong URL is used or data cannot be read from the remote host
-
catchPlatformError(): Method called when a platform error occurs
-
catchServiceError(): Method called when a service error occurs
-
catchUnknownError(): Method called when an unknown error occurs
-
Generates commented-out code that calls the setter methods for each field of the input object.
|
For how to run tests, refer to the JUnit Module Test page. |



