Enterprise Resources Test Specification

Author: Martin Schovanek
Version: 1.2
Last update: 2006/03/21
Introduction:
Comment:

Table of Contents

Test suite 1: Enterprise Resources Suite

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 caseDescription
1Call Enterprise Bean
  1. Chose Enterprise Resources > Call Enterprise Bean from the servlet's contextual menu.
  2. Chose a Enterprise Bean and generate call (look up) method.
  3. Use the call method in the TestServlet.
  4. Deploy the Enterprise Application and call the TestServlet.
RESULT:The TestServlet result is valid.
2Use Database
  1. Chose Enterprise Resources > Use Database from the servlet's contextual menu.
  2. Chose a Database Connection and let NetBeans to generate Data Source lookup method.
  3. Use the method in the TestServlet.
  4. Deploy the Enterprise Application and call the TestServlet.
RESULT:The TestServlet result is valid.
3Send E-Mail
  1. Chose Enterprise Resources > Send E-mail from the servlet's contextual menu.
  2. Enter a existing Mail Resource JNDI Name and let NetBeans to generate sendEmail() method.
  3. Use the method in the TestServlet.
  4. Deploy the Enterprise Application and call the TestServlet.
RESULT:The TestServlet sends valid email.
4Send JMS Message
  1. Chose Enterprise Resources > Send JMS Message from the servlet's contextual menu.
  2. Chose a Message Driven Bean and generate sendJMSMessage...() method.
  3. Implement createJMSMessage...() method
  4. Use the sendJMSMessage...() method in the TestServlet.
  5. Deploy the Enterprise Application and call the TestServlet.
RESULT:JMS Message is sent.

Test suite 2: Enterprise Resources Suite for Java EE 5 project type

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 caseDescription
1Call EE5 Enterprise Bean
  1. Chose Enterprise Resources > Call Enterprise Bean from the servlet's contextual menu.
  2. Chose a Enterprise Bean and generate call (look up) method.
  3. Generate local calls for TestSessionBean and CustomerFacade beans.
RESULT:IDE generates @EJB annotated fields.
2Use EE5 Database
  1. Chose Enterprise Resources > Use Database from the servlet's contextual menu.
  2. Chose jdbc/EE5Sample data source and generate Inline Lookup Code.
RESULT:IDE generates @Resource annotated DataSource field.
3Send EE5 E-Mail
Setup: Prepare mail/TestSession Java Mail Session resource on your App Server.
  1. Chose Enterprise Resources > Send E-mail from the servlet's contextual menu.
  2. Enter mail/TestSession mail resource JNDI Name and generate Inline Lookup Code.
RESULT: IDE generates @Resource annotated javax.mail.Session field and sendEmail(...) method.
4Send EE5 JMS Message
  1. Chose Enterprise Resources > Send JMS Message from the servlet's contextual menu.
  2. Chose the TestEE5MessageDestination destination and generate Inline Lookup Code.
  3. Implement createJMSMessage...() method
RESULT: IDE generates @Resource annotated javax.jms.Destination field, createJMSMessageForTestEE5MessageDestination(...) and sendJMSMessageToTestEE5MessageDestination(...) methods.
5Verify the EE5 TestServlet
  1. Deploy the EAREE5Test application.
  2. Set Run > Relative URL EAREE5Test application property to TestServlet?mail_to=x.y@my_email.com.
  3. 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