Enterprise Resources Test Specification
Author: Martin Schovanek
Version: 1.2
Last update: 2006/03/21
Introduction:
Comment:
Table of Contents
|
Purpose: This suite tests actions from Enterprise Resource menu.
Setup:
- create/open a J2EE 1.4 EAR Project with a Session Bean and a Message Driven Bean
- create a TestServlet class
Note: you can use preprepared EAR14Test project.
| # | Test case | Description |
| 1 | Call Enterprise Bean |
-
Chose
Enterprise Resources > Call Enterprise Bean from the servlet's contextual menu.
- Chose a Enterprise Bean and generate call (look up) method.
- Use the call method in the TestServlet.
- Deploy the Enterprise Application and call the TestServlet.
|
|
| RESULT: | The TestServlet result is valid. |
|
| 2 | Use Database |
-
Chose
Enterprise Resources > Use Database from the servlet's contextual menu.
-
Chose a Database Connection and let NetBeans to generate Data Source lookup method.
- Use the method in the TestServlet.
- Deploy the Enterprise Application and call the TestServlet.
|
|
| RESULT: | The TestServlet result is valid. |
|
| 3 | Send E-Mail |
-
Chose
Enterprise Resources > Send E-mail from the servlet's contextual menu.
-
Enter a existing Mail Resource JNDI Name and let NetBeans to generate sendEmail() method.
- Use the method in the TestServlet.
- Deploy the Enterprise Application and call the TestServlet.
|
|
| RESULT: | The TestServlet sends valid email. |
|
| 4 | Send JMS Message |
-
Chose
Enterprise Resources > Send JMS Message from the servlet's contextual menu.
- Chose a Message Driven Bean and generate sendJMSMessage...() method.
- Implement createJMSMessage...() method
- Use the sendJMSMessage...() method in the TestServlet.
- Deploy the Enterprise Application and call the TestServlet.
|
|
| RESULT: | JMS Message is sent. |
|
|
|
Purpose:
This suite tests actions from Enterprise Resource menu in Java EE 5 project.
Setup:
- unzip and open EAR5Test project
- open
EAR5Test-war > Source Packages > war > TestServlet.java
| # | Test case | Description |
| 1 | Call EE5 Enterprise Bean |
-
Chose
Enterprise Resources > Call Enterprise Bean from the servlet's contextual menu.
- Chose a Enterprise Bean and generate call (look up) method.
-
Generate local calls for
TestSessionBean and CustomerFacade beans.
|
|
| RESULT: | IDE generates @EJB annotated fields. |
|
| 2 | Use EE5 Database |
-
Chose
Enterprise Resources > Use Database from the servlet's contextual menu.
- Chose
jdbc/EE5Sample data source and generate Inline Lookup Code.
|
|
| RESULT: | IDE generates @Resource annotated DataSource field. |
|
| 3 | Send EE5 E-Mail |
Setup:
Prepare mail/TestSession Java Mail Session resource on your App Server.
|
-
Chose
Enterprise Resources > Send E-mail from the servlet's contextual menu.
-
Enter
mail/TestSession mail resource JNDI Name and generate Inline Lookup Code.
|
|
| RESULT: |
IDE generates @Resource annotated javax.mail.Session field and sendEmail(...) method.
|
|
| 4 | Send EE5 JMS Message |
-
Chose
Enterprise Resources > Send JMS Message from the servlet's contextual menu.
- Chose the TestEE5MessageDestination destination and generate Inline Lookup Code.
- Implement createJMSMessage...() method
|
|
| RESULT: |
IDE generates @Resource annotated javax.jms.Destination field, createJMSMessageForTestEE5MessageDestination(...) and sendJMSMessageToTestEE5MessageDestination(...) methods.
|
|
| 5 | Verify the EE5 TestServlet |
- Deploy the EAREE5Test application.
-
Set
Run > Relative URL EAREE5Test application property to TestServlet?mail_to=x.y@my_email.com.
- Run the EAREE5Test application.
|
|
| RESULT: |
The TestServlet displays page like:
Servlet TestServlet at /EAR5Test-war
hello='Hello Martin'
custName='Livermore Enterprises'
custCity='Miami'
email='....'
|
|
|
Generated: 2006 05 15 04:47