TS 70 GlassFish
GlassFish NetBeans Support Test Specification
Author: Radim Roska, Jiri Skrivanek
Version: NetBeans 7.0
Estimated time: 4 hours
Default IZ component(s): serverplugins/GlassFish
Last update: 1-st March 2011
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/.
- Download GlassFish
- If GlassFish is already in Services view under Servers node, remove it by right click -> remove
- In services view perform "Add Server..." action on Servers node
- Select "GlassFish Server 3.x", fill "GlassFish Default" name and click Next
- Clear "Installation Location" text field and check an error message appears
- Specify path to non existing folder and message "C:\gf does not exist but server can be downloaded and installed there." should appear
- Click "I have read and accept the license agreement...(click)" link and check that browser with GlassFish license is shown
- Check the license check box
- Click now enabled "Download Now..." button
- Choose "GlassFish Server 3.1" in opened Select dialog and click OK
- Wait until GlassFish is installed and click Next
- Keep default values ("Register Local Domain", domain1, "Use default ports") and click Finish
- Check a new node appeared under Servers node in Services view
- Register Installed GlassFish
- In services view perform "Add Server..." action on Servers node
- Select "GlassFish Server 3.x", fill "GlassFish Non Default" name and click Next
- Specify path to previously downloaded or installed GlassFish server and click Next
- Type domain2 in Domain field, uncheck "Use default ports" and click Finish
- Check a new node appeared under Servers node in Services view
- In the question dialog with "Domain creation successful. View the results?" message click Yes.
- You should see output from domain creation
- Add another instance named "GlassFish Remote" and in page "Domain Location" select "Register Remote Domain" and type localhost in "Host Name:" field
- Click Finish.
- EXPECTED RESULT: All operations are successful.
- Server manager
- Right-click "GlassFish Default" node and choose Properties
- Servers Manager is opened
- Check settings of application servers
- 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:
- Deploying Web Application
- Open "File|New Project" wizard
- Choose "Java Web|Web Application"
- Select "GlassFish Default" server as target server
- Run project (F6) and wait until server is started and browser with default JSP page is opened
- Change "Hello World!" in index.jsp and save the file
- Refresh your browser and check application was redeployed
- Right-click project node and choose Deploy
- Check application was redeployed
- Right-click project node and choose Debug
- Confirm "Port Selection Notice" dialog. It is there to inform user about possible non standard port on which debugger may run
- Check debugger is started and page displayed in browser
- Right-click project node and choose Profile
- Confirm "Select Java Platform for Profiling" dialog
- Click Run in "Profile WebApplication1" dialog
- Check profiler is started and default page opened in browser
- Stop the server.
- EXPECTED RESULT: All operations run successfully.
- Application Node
- Run project (F6)
- Expand "Servers|GlassFish Default|Applications" node in Services View
- Check deployed application is present
- Right-click WebApplication1 node and choose Disable
- Try to refresh page in browser and check it is not available. Check also badge on the node
- Right-click WebApplication1 node and choose Enable
- Refresh page in browser and check it is available. Check also badge on the node disappears
- Right-click WebApplication1 node and choose Open in Browser
- Check browser is opened
- Right-click WebApplication1 node and choose Undeploy
- Check WebApplication1 node disappears and application is not available in browser after refresh
- Run project (F6) again and expand "Servers|GlassFish Remote|Applications" node
- Check application is visible tha same way as in "GlassFish Default" instance and repeat all above steps for this remote instance
- EXPECTED RESULT: Everything works.
- Resources
- Open "File|New File" wizard
- Select "GlassFish|JDBC Connection Pool" and finish the wizard with default values
- Check glassfish-resources.xml file is created under "WebApplication1|Server Resources" node and it contains <jdbc-connection-pool> element
- The same way create "JDBC Resource", "JMS Service" and "JavaMail Session". Fill some dummy values where required.
- Deploy project, refresh server node and check all created resources are deployed under Resources server node
- Refresh and check also "GlassFish Remote" instance
- Create a new Session Bean
- Create a new Servlet
- Right-click in editor and choose "Insert Code...|Call Enterprise Bean...", navigate to previously created session bean and click OK
- Check @EJB annotation for NewSeesionBean was added
- Right-click in editor and choose "Insert Code...|Use Database..."
- In "Choose Database" dialog click Add
- In "Add Data Source Reference" dialog select "Server Data Sources" and choose sample source. Type myDataSource in "Reference Name" field and confirm all dialogs
- Check annotation "@Resource(name = "myDataSource")" is added to source code
- Right-click in editor and choose "Insert Code...|Send JMS Message...",
- 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 {
- Right-click in editor and choose "Insert Code...|Send E-mail...",
- 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 {
- Deploy this project to the glassfish.
- EXPECTED RESULT: Everything works.
Test suite: Managing GlassFish
Purpose: To verify a GlassFish can be controlled from IDE.
- Managing GlassFish
- Perform Start action on "GlassFish Default" server node.
- Check output window, there should be server log displayed.
- Perform Refresh action on GlassFish.
- Perform Stop action and wait until server stops and sub nodes are gone.
- Perform Start in Debug Mode and check icon.
- Perform Restart action and check server is started again in debug mode.
- Perform Stop action and wait until server stops and sub nodes are gone.
- Perform Start in Profile Mode, confirm all information dialogs and check server is waiting for profiler to connect.
- Run application (F6) to restart server.
- Close output window. And perform View Server Log operation. (see #200372)
- Perform View Domain Admin Console action.
- Perform View Domain Update Center action. (prerequisite: logged in as user with administrative rights)
- Stop server.
- Go to Output tab "GlassFish Default" and repeat all possible actions (Start, Debug, Restart, Stop, Refresh) using icons in Output view
- Perform previous steps for all registered GlassFish instances
- 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.