Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

J2EE Smoke Test (WTP 2.0)

J2EE 1.4

Setup

  • Install a J2EE 1.4-compatible server, such as JOnAS, JBoss or WebSphere
  • Add the server in Window -> Preferences... -> Server -> Installed Runtimes
  • Install the XDoclet support (1.2.1, 1.2.2 or 1.2.3)
  • Add the XDoclet support in Window -> Preferences... -> XDoclet
  • Expand the XDoclet node and configure the ejbdoclet and webdoclet support for your installed server(s).

Create resources

Create a Web 2.4 project

  • Target it at the installed J2EE server
  • Choose "Dynamic Web Project with XDoclet" from Configurations
  • Create a servlet inside the project
    • enter "test" for Java package
    • specify a name
    • select the "Generate an annotated servlet class file" checkbox
    • give "test" for servlet's name (second page)
    • leave only the "doGet" checkbox checked (third page)
    • add the following code in the doGet() method of the servlet class
response.getOutputStream().println("This is a test servlet. ");
  • Create a JSP inside the project
    • file name: index.jsp
    • add the following text into the body
<body>This is the Smoke Test.</body>
  • Ensure the project builds and is targeted to a server correctly

Create an EAR 1.4 project

  • Target it at the installed J2EE server
  • Select the Web 2.4 project as J2EE module (third page)

Create an EJB 2.1 project

  • Target it at the installed J2EE server
  • Choose "EJB Project with XDoclet" from Configurations
  • Choose "Add project to an EAR" and choose the previously created EAR project
  • Create a new XDoclet Enterprise JavaBean
    • choose Session Bean as a type
    • enter "test" for Java package

Verify Project Explorer content

Verify the Web project

  • verify there is a node for the deployment descriptor
  • the deployment descriptor node should specify version 2.4
  • verify that the servlet class is listed under the "Servlets" node
  • verify that the "/test ->" url mapping is listed under the "Servlet Mappings" node

Verify the EJB project

  • verify there is a node for the deployment descriptor
  • the deployment descriptor node should specify version 2.4
  • verify that the there is a node for the bean under the "Session Beans" node
    • verify that under this node all bean classes and interfaces are listed

Verify the EAR project

  • verify there is a node for the deployment descriptor
  • the deployment descriptor node should specify version 1.4
  • expand the deployment descriptor node
    • verify there are "Modules" and "Utility JARs" nodes
  • expand the Modules node
    • verify there are references to the Web and EJB modules

Export the projects

Export the Web project

  • verify that the deployment descriptor XML, the Servlet class, and libraries are included in the WAR

Export the EJB project

  • verify that all of the classes and the deployment descriptor XML are included in the EJB JAR

Export the EAR project

  • verify that deployment descriptor XML and the WARs and EJB JARs of the referenced J2EE modules are included

Deploy and Run the application

  • Run the test servlet
    • Right click on the servlet node in the deployment descriptor tree and choose Run As -> Run on Server
    • Select the targeted J2EE server
    • The internal browser should request the test servlet and show the result page
  • Run the index.jsp
    • Right click on the index.jsp and choose Run As -> Run on Server
    • Select the targeted J2EE server
    • The internal browser should request the index.jsp and show the result page

Java EE 5

See also

Click here to view smoke test scenarios for WTP 1.5.
Click here to view smoke test scenarios for WTP 2.0.
Click here to view smoke test scenarios for WTP 3.0.
Click here to view WTP smoke test results.
Back to Web Tools Wiki Home

Back to the top