TS 72 GlassFish

GlassFish NetBeans Support Test Specification

Author: Radim Roska, Jiri Skrivanek
Version: NetBeans 7.2
Estimated time: 4 hours
Default IZ component(s): serverplugins/GlassFish
Last update: 13-th June 2012
Introduction: This test specification is focused on testing NetBeans support for GlassFish application server.
Comments:

Contents


Test suite: Register GlassFish

Purpose: To verify a GlassFish server instance can be easily added/removed and used within the IDE.
Setup: Optionally install GlassFish server to your computer either bundled version from NetBeans installer or separately from https://glassfish.dev.java.net/.

  1. Download GlassFish
    1. If GlassFish is already in Services view under Servers node, remove it by right click -> Remove
    2. In services view perform "Add Server..." action on Servers node
    3. Select "GlassFish Server 3+", fill "GlassFish Default" name and click Next
    4. Clear "Installation Location" text field and check an error message appears
    5. Specify path to non existing folder and message "C:\gf does not exist but server can be downloaded and installed there." should appear
    6. Click "I have read and accept the license agreement...(click)" link and check that browser with GlassFish license is shown
    7. Check the license check box
    8. Click now enabled "Download Now..." button
    9. Choose "GlassFish Server 3.1" in opened Select dialog and click OK
    10. Wait until GlassFish is installed and click Next
    11. Keep default values ("Register Local Domain", domain1, "Use default ports") and click Finish
    12. Check a new node appeared under Servers node in Services view
  2. Register Installed GlassFish
    1. In services view perform "Add Server..." action on Servers node
    2. Select "GlassFish Server 3+", fill "GlassFish Non Default" name and click Next
    3. Specify path to previously downloaded or installed GlassFish server and click Next
    4. Type domain2 in Domain field, uncheck "Use default ports" and click Finish
    5. Check a new node appeared under Servers node in Services view
    6. In the question dialog with "Domain creation successful. View the results?" message click Yes.
    7. You should see output from domain creation
    8. Add another instance named "GlassFish Remote" and in page "Domain Location" select "Register Remote Domain" and type localhost in "Host Name:" field
    9. Click Finish.
    • EXPECTED RESULT: All operations are successful.
  3. Server manager
    1. Right-click "GlassFish Default" node and choose Properties
    2. Servers Manager is opened
    3. Check settings of application servers
    4. Try to add server and remove it then.
    • EXPECTED RESULT: Works correctly. Settings are correct - domains folder, domain name, port, ...


Test suite: Deployment

Purpose: To verify a Java Web project can be deployed to server using IDE.
Setup:

  1. Deploying Web Application
    1. Open "File|New Project" wizard
    2. Choose "Java Web|Web Application"
    3. Select "GlassFish Default" server as target server
    4. Run project (F6) and wait until server is started and browser with default JSP page is opened
    5. Change "Hello World!" in index.jsp and save the file
    6. Refresh your browser and check application was redeployed
    7. Right-click project node and choose Deploy
    8. Check application was redeployed
    9. Right-click project node and choose Debug
    10. Confirm "Port Selection Notice" dialog. It is there to inform user about possible non standard port on which debugger may run
    11. Check debugger is started, page displayed in browser and finish debugger
    12. Right-click project node and choose Profile
    13. Confirm "Select Java Platform for Profiling" dialog
    14. Select "Profile application" and push "Run"
    15. Error "Calibration data missing." should appear
    16. Push OK
    17. Invoke "Profile | Advanced Commands | Run Profiler Calibration"
    18. Confirm "Select Java Platform for Profiling" dialog
    19. Window "Information" about successful calibration should appear
    20. Push OK
    21. Right-click project node and choose Profile
    22. Confirm "Select Java Platform for Profiling" dialog
    23. Select "Profile application" and push "Run"
    24. Check profiler is started and default page opened in browser
    25. Stop the server.
    • EXPECTED RESULT: All operations run successfully.
  2. Application Node
    1. Run project (F6)
    2. Expand "Servers|GlassFish Default|Applications" node in Services View
    3. Check deployed application is present
    4. Right-click WebApplication1 node and choose Disable
    5. Try to refresh page in browser and check it is not available. Check also badge on the node
    6. Right-click WebApplication1 node and choose Enable
    7. Refresh page in browser and check it is available. Check also badge on the node disappears
    8. Right-click WebApplication1 node and choose Open in Browser
    9. Check browser is opened
    10. Right-click WebApplication1 node and choose Undeploy
    11. Check WebApplication1 node disappears and application is not available in browser after refresh
  3. Remote Application Node
    1. Run project (F6) again and expand "Servers|GlassFish Remote|Applications" node
    2. An error message dialog should appear about possible security risks (bug 208376)
    3. Right-click "GlassFish Default" server node and choose "View Domain Admin Console"
    4. In browser click "Change Administrator Password"
    5. Type new password (e.g. admin) and click Save
    6. In left menu select "server (Admin Server)"
    7. Click "Secure Administration..." button
    8. Click "Enable Secure Admin" and confirm warning dialog
    9. Wait until server is restarted and return to IDE
    10. Refresh both "GlassFish Default" and "GlassFish Remote" server nodes
    11. Provide admin/admin username and password when requested for authentication
    12. Check that previously deployed application is visible in "GlassFish Remote" instance and repeat all steps from "Application Node" test case for this remote instance
    • EXPECTED RESULT: Everything works.
  4. Resources
    1. Open "File|New File" wizard
    2. Select "GlassFish|JDBC Connection Pool" and finish the wizard with default values
    3. Check glassfish-resources.xml file is created under "WebApplication1|Server Resources" node and it contains <jdbc-connection-pool> element
    4. The same way create "JDBC Resource", "JMS Service" and "JavaMail Session". Fill some dummy values where required.
    5. Deploy project, refresh server node and check all created resources are deployed under Resources server node
    6. Refresh and check also "GlassFish Remote" instance
    7. Create a new Session Bean
    8. Create a new Servlet
    9. Right-click in editor and choose "Insert Code...|Call Enterprise Bean...", navigate to previously created session bean and click OK
    10. Check @EJB annotation for NewSeesionBean was added
    11. Right-click in editor and choose "Insert Code...|Use Database..."
    12. In "Choose Database" dialog click Add
    13. In "Add Data Source Reference" dialog select "Server Data Sources" and choose sample source. Type myDataSource in "Reference Name" field and confirm all dialogs
    14. Check annotation "@Resource(name = "myDataSource")" is added to source code
    15. Right-click in editor and choose "Insert Code...|Send JMS Message...",
    16. In "Send JMS Message" dialog click OK and check following definitions are created (bug 121053):
    @Resource(mappedName = "jms/myQueue")
    private Queue myQueue;
    @Resource(mappedName = "jms/myQueueFactory")
    private ConnectionFactory myQueueFactory;

    private void sendJMSMessageToMyQueue(Object messageData) throws JMSException {
    1. Right-click in editor and choose "Insert Code...|Send E-mail...",
    2. In "Specify Mail Resource" dialog type JNDI name "mail/mySession", click OK and check following definitions are created:
    @Resource(name = "mail/mySession")
    private javax.mail.Session mailmySession;

    private void sendMail1(String email, String subject, String body) throws NamingException, MessagingException {
    1. Deploy this project to the glassfish.
    • EXPECTED RESULT: Everything works.


Test suite: Managing GlassFish

Purpose: To verify a GlassFish can be controlled from IDE.

  1. Managing GlassFish
    1. Perform Start action on "GlassFish Default" server node.
    2. Check output window, there should be server log displayed.
    3. Perform Refresh action on GlassFish.
    4. Perform Stop action and wait until server stops and sub nodes are gone.
    5. Perform Start in Debug Mode and check icon.
    6. Perform Restart action and check server is started again in debug mode.
    7. Perform Stop action and wait until server stops and sub nodes are gone.
    8. Perform Start in Profile Mode, confirm all information dialogs and check server is waiting for profiler to connect.
    9. Run application (F6) to restart server.
    10. Close output window. And perform View Server Log operation. (see #200372)
    11. Perform View Domain Admin Console action.
    12. Perform View Domain Update Center action. (prerequisite: logged in as user with administrative rights)
    13. Stop server.
    14. Go to Output tab "GlassFish Default" and repeat all possible actions (Start, Debug, Restart, Stop, Refresh) using icons in Output view
    15. Perform previous steps for all registered GlassFish instances
    16. For "GlassFish Remote" instance there should only be possible to Restart and Refresh server. Server state after refresh should follow state of "GlassFish Default" instance (bug 196214).
    • EXPECTED RESULT: Server responds to the operations correctly. Icon in services view is changing with server status. Server log is displayed when it should be. Performing "View Admin Console" actions runs browser with configuration tool. View Update Center opens GlassFish Update Center dialog. For every registered instance operation works fine.


Test suite: GlassFish Cluster

  1. Create Cluster and Standalone Instance (see clustering guide)
    1. Open command line console and find GlassFish installation directory
    2. Run the following commands to create cluster and standalone server instances. There should be empty password for admin account, so press the enter key if prompted.
      1. cd glassfish3/bin
      2. asadmin start-domain domain1
      3. asadmin create-cluster c1
      4. asadmin create-local-instance --cluster c1 li1c1
      5. asadmin create-local-instance --cluster c1 li2c1
      6. # create standalone local instance
      7. asadmin create-local-instance sli
      8. asadmin stop-domain domain1
  2. Register Cluster and Standalone Instance
    1. In services view perform "Add Server..." action on Servers node
    2. Select "GlassFish Server 3+", fill "GlassFish Cluster" name and click Next
    3. Specify path to previously installed GlassFish server and click Next
    4. Type c1 in the Target field and click Finish
    5. Check a new node appeared under Servers node in Services view
    6. Add another instance named "GlassFish Standalone" and in page "Domain Location" type sli in the Target field
    7. Click Finish.
  3. Test Cluster and Standalone Instance
    1. Repeat Deployment and Managing GlassFish test suites both with GlassFish Cluster and GlassFish Standalone instances
    2. It is not supported to debug and profile projects with these server instances
    3. Known bugs: 202418, 202416, 214207
    • EXPECTED RESULT: All operations are successful.


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo