You can use the EJB business logic test pattern to test the actual business logic of your Enterprise JavaBeans™ (EJBs). Because business logic is usually implemented in session beans, you usually test business logic by testing session beans. To test EJB business methods, you create a test scenario, similar to what you do when you create a scenario to test Java™ components.
When testing business methods, be sure to test the business logic itself, that is, the algorithms that process data in parameters. Also, be sure to use the test data table to do data-driven testing on a wide range of input data.
To test the business logic of an Enterprise JavaBean:
This starts the Create Test for EJB wizard.
At this point, a static analysis is performed on the EJBs associated with the test project. These files were selected during the creation of the test project and serve to define the scope of the test. (The list of files in the project can be updated by modifying the test project's Test Scope properties.)
When the analysis is complete, you will see a list of components in a table format and sorted according to the computed metrics. You can use the guidance that these metrics provide to help you decide which EJB components are most important for you to test. Components with highlighted values or high numerical values are considered high-priority test candidates.
After you create the test, be sure to populate the test data table with test data. To display a test data table, do one of the following:
Related concepts
Test patterns for Enterprise JavaBeans
Static metrics
Related tasks
Creating new component test projects