cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Web/Enterprise Application Debugging Test Specification

Author: Jiri Skrivanek, Libor Martinek
Version: NetBeans 5.5
Last update: 6-th March 2007

Introduction: This is test specification of debugging of web and enterprise applications in NetBeans IDE 5.5.
Comment: Debugging is not supported for BEA Weblogic server.

Table of Contents


Test suite 1: JSP Debugging overall

Setup: Open MainTestApplication and required projects. Open index.jsp and put breakpoint at title tag for example.

#Test caseDescription
1Start debugger
  1. Start debugger
  2. Continue debug session
  3. Finish debugging
RESULT: Debugger stops at breakpoint, after continue shows JSP in browser and finishes finally.
2Start debugger after run
  1. Run project
  2. Start debugger
  3. Continue debugging session
  4. Finish debugger
RESULT: Debugger stops at breakpoint.
3Start debugger after reached breakpoint
  1. Start debugger
  2. Finish debugger when it stops at breakpoint
  3. Start debugger again
  4. Finish debugger
RESULT: Debugger alway stops at breakpoint.
4Start debugger with stopped server
  1. Start debugger
  2. Finish debugger when it stops at breakpoint.
  3. Stop server in Runtime view.
  4. Start debugger again
  5. Finish debugger.
RESULT: Server starts and debugger always stops at breakpoint.
5Start debugger without breakpoint
  1. Delete breakpoint from index.jsp.
  2. Start debugger and wait until JSP is shown in browser
  3. Add breakpoint to index.jsp
  4. Reload JSP in browser and wait until debugger stops at breakpoint
  5. Continue debugging
  6. Repeat steps 4 and 5 several times.
  7. Finish debugger.
RESULT: Debugger stops at breakpoint.
6Start debugger on unsaved JSP
  1. Modify index.jsp and put a breakpoint
  2. Start debugger.
  3. Finish debugger.
RESULT: JSP is saved and debugger stops at breakpoint.
7Start debugger on JSP in folder
  1. Add a breakpoint in JSP in folder.
  2. Start debugger by menu item Run|Run File|Debug....
  3. Continue and finish debugger.
RESULT: Debugger stops at breakpoint.
8Start debugger with running session
  1. Start debugger.
  2. When breakpoint is reached, start debugger again.
  3. A message in output window should inform you that server is in suspended state.
  4. Finish debugger.
9Run project when debugging
  1. Start debugger.
  2. When breakpoint is reached, try to run project.
  3. A message in output window should inform you that server is in suspended state.
  4. Finish debugger.
10Stop server when debugging
  1. Start debugger and wait until it stops at breakpoint
  2. Open context menu on server node in Runtime view.
  3. Check it is not possible to stop and start server. All Start, Restart Stop items should be disabled.
  4. Check also state of buttons in output view.
RESULT: Items disabled.
11Two sessions - Java debugging
  1. Start debugger
  2. Create java application, add a breakpoint and call menu item 'Debug Project' on project's root node
  3. Open Sessions view (Windows|Debugging|Sessions) and check there are two sessions with correct names
  4. Double click web application session to make it current
  5. Call ' Finish All' action in popup in Session View
RESULT: Two sessions coexist together. Make current action brings file with breakpoint to front.
12Attach to external Tomcat
  1. Create a web application and run it
  2. Check properties of Bundled Tomcat server instance. Debugger Type should be 'Shared Memory'. Copy name 'tomcat_shared_memory_id' to clipboard.
  3. Stop server
  4. Start Server in debug mode
  5. Call menu item 'Run|Attach Debugger...' and in Attach dialog fill in the following fields: Connector - SharedMemoryAttach, Name - tomcat_shared_memory_id
  6. Click OK in Attach dialog
  7. Add breakpoint into index.jsp in your web application and reload application in browser
  8. Debugger should stop at breakpoint
  9. Finish debugging
  10. Stop server
  11. Change Debugging Type in properties to 'Socket'
  12. Start server in debug mode
  13. Call menu item 'Run|Attach Debugger...' and in Attach dialog fill in the following fields: Connector - SocketAttach, Host - localhost, Port - 11555
  14. Click OK in Attach dialog
  15. Reload application in browser
  16. Debugger should stop at breakpoint
  17. Finish debugging

Test suite 2: JSP Debugging

Setup: Open MainTestApplication and required projects.

#Test caseDescription
1Run to Cursor
  1. Set cursor to a line in index.jsp
  2. Do action 'Run To Cursor' and wait until debugger stops at the line.
  3. Move cursor several lines ahead and do action 'Run to Cursor' again.
  4. Move cursor several lines backward and do action 'Run to Cursor'
  5. Reload JSP in browser and debugger should stop at specified line.
  6. Continue.
  7. Finish debugger.
RESULT: Debugger stops at line with cursor.
2Step into/out/over
  1. Add breakpoint to index.jsp
  2. Start debugging and wait until debugger stops at breakpoint
  3. Try Step into action (F7) several times and check if it steps line by line in JSP
  4. Continue and reload in browser to reach breakpoint again
  5. Try Step Out action (Ctrl+F7) and check if debugger continues.
  6. Reload in browser to reach breakpoint again
  7. Try Step Over action (F8) several times and check if it steps line by line in JSP
  8. Finish debugging
3JSP includes
  1. Add breakpoint before include directives into index.jsp (line containing 'Using include directive')
  2. Start debugger and wait until it stops at breakpoint
  3. Use Step Into (F7) action to go through all includes and check whether all included pages are really opened.
  4. Continue and reload in browser to reach breakpoint again
  5. Use Step Over (F8) to continue. It should not go into included pages (issue 31118)
  6. Continue and reload in browser to reach breakpoint again
  7. Use Step Into (F7) to go to the first included page. Do Step Out action. It should stop debugger after include statement (issue 31118)
  8. Add breakpoint before '<jsp:include' into index.jsp (line containing 'Using dynamic include')
  9. Repeat steps 2 to 7 for dynamic includes
  10. Remove all breakpoints and add new breakpoints into every included page
  11. Start debugger and check whether it stops everytime at breakpoint (keep in mind that there are embedded includes, so one page is accessed several times).
4JSP forwards
  1. Add breakpoint before 'jsp:forward' into forwardTest.jsp
  2. Start debugger (Run|Run File|Debug "forwardTest.jsp") and wait until it stops at breakpoint
  3. Use Step Into (F7) action to step into forwarded.jsp
  4. Continue and reload in browser to reach breakpoint again
  5. Use Step Over (F8) to continue. It should not go into forward page
  6. Continue and reload in browser to reach breakpoint again
  7. Use Step Into (F7) to go to the forwarded page. Do Step Out action. It should stop debugger at forward statement
  8. Remove all breakpoints and add new breakpoints into forwarded.jsp page
  9. Start debugger and check whether it stops at breakpoint.
5Tag files
  1. Add breakpoint before tag directive into index.jsp (line containing 'Using tag libraries')
  2. Start debugger and wait until it stops at breakpoint
  3. Use Step Into (F7) action to go through all tag files and handlers and check whether files are really opened.
  4. Continue and reload in browser to reach breakpoint again
  5. Use Step Over (F8) to continue. It should not go into tag files and handlers
  6. Continue and reload in browser to reach breakpoint again
  7. Use Step Into (F7) to go to the first tag handler. Do Step Out action. It should stop debugger at calling JSP.
  8. Use Step Into (F7) to go to the first tag file. Do Step Out action. It should stop debugger at calling JSP.
  9. Remove all breakpoints and add new breakpoints into every tag file and tag handler
  10. Start debugger and check whether it stops everytime at breakpoint.
6Tagx files
  1. Add breakpoint before tags directive into jspxExample.jsp. It must be at 'jsp:element (issue 53734)
  2. Start debugger for jspxExample.jspx file and wait until it stops at breakpoint
  3. Use Step Into (F7) action to go through tagx file.
  4. Continue and reload in browser to reach breakpoint again
  5. Use Step Over (F8) to continue. It should not go into tag files and handlers
  6. Continue and reload in browser to reach breakpoint again
  7. Use Step Into (F7) to go to tagx file. Do Step Out action. It should stop debugger at calling JSP.
  8. Remove all breakpoints and add new breakpoints into tagx file. It must be at 'jsp:element (issue 53734).
  9. Start debugger for jspxExample.jspx file and check whether it stops at breakpoint.
7Java Libraries
SETUP: Java classes in freeform project need to be compiled with debug="true" to be available for debugging.
  1. Add breakpoint before usage of java class from library into index.jsp (line containing 'Using java libraries')
  2. Start debugger and wait until it stops at breakpoint
  3. Use Step Into (F7) action to go through all java files from regular java library and freeform library. Check whether files are really opened.
  4. Continue and reload in browser to reach breakpoint again
  5. Use Step Over (F8) to continue. It should not go into java files
  6. Continue and reload in browser to reach breakpoint again
  7. Use Step Into (F7) to go to the first java file. Do Step Out action. It should stop debugger at calling JSP.
  8. Remove all breakpoints and add new breakpoints into every java file
  9. Start debugger and check whether it stops everytime at breakpoint.
8Freeform debugging
SETUP: Unzip freeformProject.zip.
  1. Open New Project wizard and select category 'Web' and project 'Web Application with Existing Ant Script'.
  2. Browse to unzipped FreeformProjectExample directory.
  3. In the next page change 'build' target to 'dist'.
  4. In the next 'Web Sources' page type '/myapp' in the context path field.
  5. Add both 'src-servlets' and 'src-utils' folders to the Source Package Folders list.
  6. Finish the wizard.
  7. Start tomcat in debugging mode - first open properties for Tomcat server in Runtime view and set 'Debugger Transport' to Socket on page Startup. Then call context menu item Start in Debug Mode.
  8. Modify passwd property in build.xml (look at ${nbuserdir}/apache-tomcat-x.x.x_base/conf/tomcat-users.xml for current value)
  9. Build FreeformProjectExample project.
  10. Deploy myapp.war to Tomcat server: open Tomcat manager at http://localhost:8084/manager/html, browse for war file and click deploy button. myapp application should appear both in Tomcat manager and under server node in Runtime view (need refresh).
  11. Add breakpoint to index.jsp, servlet and java file.
  12. Choose 'Run|Debug Main Project' (F5) and confirm generate dialog. IDE should generate nbproject/ide-targets.xml script and debug.properties.
  13. Check debug.properties and use appropriate ones according to your needs.
  14. Start debugger again (F5) and check that it stops at all breakpoints. Click 'Display' and 'Current time' links to reach breakpoints in java files.
  15. Finish debugging session.

Test suite 3: Servlet Debugging

#Test caseDescription
1Step into/out/over servlet
SETUP: Make sure all source folders from TestFreeformLibrary are checked to be used for debugging in Sources view (Window|Debugging|Sources).
  1. Add breakpoint to DivideServlet in package org.netbeans.test.servlets under Source Packages of MainTestApplication project
  2. Start debugging from main menu 'Run|Run File|Debug "DivideServlet.java"' and wait until debugger stops at breakpoint
  3. Try Step into action (F7) several times and check if it steps line by line in servlet. It should also go to Divider.java class.
  4. Continue and reload in browser to reach breakpoint again
  5. Try Step Out action (Ctrl+F7) and check if debugger continues.
  6. Reload in browser to reach breakpoint again
  7. Try Step Over action (F8) several times and check if it steps line by line in servlet. It should not dive into Divider.java file.
  8. Finish debugging
2Apply Code Changes
  1. Add breakpoint to DivideServlet in package org.netbeans.test.servlets under Source Packages of MainTestApplication project
  2. Start debugging from main menu 'Run|Run File|Debug "DivideServlet.java"' and wait until debugger stops at breakpoint
  3. Change something in source code of DivideServlet.java.
  4. Click "Apply Code Changes" toolbar button and check DivideServlet.java is saved, target debug-fix is successfully run in output window.
  5. Continue debugging and check modified content appears in browser.
  6. Again change something in source code of DivideServlet.java.
  7. Click main menu item "Run|Apply Code Changes" and check DivideServlet.java is saved, target debug-fix is successfully run in output window.
  8. Continue debugging and check modified content appears in browser.
  9. Finish debugging.

Test suite 4: Breakpoints in JSP

#Test caseDescription
1Toggle breakpoint
  1. Toggle breakpoint by mouse click at left side bar in editor.
  2. Toggle breakpoint by shortcut Ctrl+F8
  3. Toggle breakpoint by editor's popup menu 'Toggle Breakpoint'
  4. Toggle breakpoint in unsaved JSP.
  5. Toggle breakpoint in unsaved JSP at last line.
RESULT: All breakpoints created.
2Breakpoint group
  1. Add several breakpoints to a JSP
  2. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  3. Select one or more breakpoints
  4. On the selection call ' Set Group Name' from popup menu and type a name in the field
  5. Group should be created and shown in Breakpoints view
3Disable breakpoint
  1. Add a breakpoint
  2. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  3. Disable breakpoint either from popup menu or by inline check box
  4. Start debugger and check that it doesn't stop at breakpoint
  5. Enable breakpoint again and reload page in browser. Debugger should stop at breakpoint
4Delete breakpoint
  1. Add a breakpoint
  2. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  3. Delete breakpoint either from popup menu or by Delete shortcut. Check whether breakpoint is removed both from editor and Breakpoints view
5Customize breakpoint
  1. Add a breakpoint
  2. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  3. Open Customize Breakpoint dialog from popup menu.
  4. Change line number and close the dialog.
  5. Check whether breakpoint is moved in editor.
6Go to source
  1. Add a breakpoint
  2. Close JSP with breakpoint
  3. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  4. Double click breakpoint and JSP with breakpoint should be open in editor. Try also 'Go to source' popup.
7Enable/Disable/Delete All
  1. Add more breakpoints
  2. Open Breakpoints view (menu item 'Window|Debugging|Breakpoints)
  3. Disable all breakpoints from popup menu item 'Disable All'
  4. Start debugger and check that it doesn't stop at breakpoints
  5. Enable all breakpoints from popup menu item 'Enable All' and reload page in browser. Debugger should stop at all breakpoints
  6. Delete all breakpoints at once by popup menu
8Breakpoints at various places
SETUP: Create breakpoint at the following places:
  1. One line JSP comment
    <%-- --%>
    Debugger should stop here because it is translated as '\n' into servlet.
  2. Multi line JSP comment. Debugger stops at the last line because whole JSP comment is translated as one '\n' char
  3. One line HTML comment
    <!-- -->
    Debugger stops here because comment is also in servlet
  4. Multi line HTML comment. Debugger stops at each line because comment is in servlet.
  5. One line scriplet
    <% int i = 0; %>
  6. Multi line scriplet
    1: <%
    2:      String name = 
    3:              "very long name";
    4: %>
    Debugger stops only at lines 2 and 4.
  7. Page directive @page.
  8. Taglib directive @taglib.
  9. Custom tag.
  10. Expression language
    ${1 + 2}
  11. Use bean tag
    jsp:bean
RESULT: Debugger stops at all breakpoints except ones mentioned in description.

Test suite 5: Enterprise Application Debugging

Setup: In Runtime view add Application Server which supports Enterprise Applications.

#Test caseDescription
1Enterprise Java Beans
  1. Create new Enterprise Application by New Project wizard (category Enterprise|Enterprise Application). In the wizard check 'Create Application Client Module' option. Do not create application in directory with space in path.
  2. On EJBModule node call New|Session Bean context menu.
  3. Provide a package name and finish the wizard.
  4. Right-click in editor and choose EJB Methods|Add Business Method....
  5. Confirm "Add Business Method..." dialog and add some code to body of the method.
  6. On WebModule node call New|Servlet context menu.
  7. Provide a package name and finish the wizard.
  8. Right-click in editor and choose Enterprise Resources|Call Enterprise Bean.
  9. In "Call Enterprise Bean" dialog choose your session bean and confirm the dialog.
  10. Add code to call your session bean from the servlet. Add something like this lookupNewSessionBean().businessMethod(); to processRequest method.
  11. Add breakpoint at line you just added.
  12. Start to debug enterprise application. Just press F5 if it is main project or call Debug Project on project node.
  13. Wait until index.jsp appears in browser. Load servlet in browser to reach breakpoint. Address should look like this http://localhost:8080/EnterpriseApplication-war/NewServlet.
  14. Use Step Into (F7) action and check you passed through your business method.
  15. Remove breakpoint in servlet and add new breakpoint to your business method.
  16. Reload servlet in browser and check whether debugger stops at breakpoint.
  17. Use Step Out action (Ctrl+F7) to return to servlet code.
  18. Finish debugging.
2Web Service
SETUP: Go to Runtime view and open properties on server node. Uncheck "Use IDE Proxy Setting" and close dialog. Then stop the server to let changes to take effect after next start.
  1. On web application node call New|Web Service... context menu.
  2. Provide a package name and finish the wizard.
  3. Add operation if needed.
  4. Add breakpoint to operation body.
  5. Start to debug enterprise application which also deploys Enterprise Application with created web service. To do so, just press F5 if it is main project or call Debug Project on project node.
  6. On your web service node call Test Web Service (it is available only for Java EE 5 applications).
  7. Wait until tester page is opened in browser, type in a string and click sampleOperation button.
  8. Check whether debugger stops at breakpoint in your operation.
  9. Continue (Ctrl+F5).
  10. Go back and repeat once more.
  11. Finish debugging.
3Web Service Client
  1. On web application node call New|Web Service Client... context menu.
  2. Browse for project.
  3. Select your web service and confirm the dialog.
  4. Provide a package name and finish the wizard.
  5. On web application node call New|Servlet context menu.
  6. Provide a package name and finish the wizard.
  7. Right-click in editor and choose Web Service Client Resources|Call Web Service Operation....
  8. Select operation in the dialog and click OK.
  9. Start to debug enterprise application. Just press F5 if it is main project or call Debug Project on project node.
  10. Wait until index.jsp appears in browser. Load servlet in browser to reach breakpoint in your operation. Address should look like this http://localhost:8080/EnterpriseApplication-war/NewServlet.
  11. Check whether debugger stops at breakpoint in your operation.
  12. Finish debugging.
4Application Client
  1. On EJBModule node call New|Session Bean context menu.
  2. Provide a name, a package name, check 'Remote' option and finish the wizard.
  3. Right-click in editor and choose EJB Methods|Add Business Method....
  4. Confirm "Add Business Method..." dialog and add some code to body of the method.
  5. Add breakpoint to business method.
  6. Open Main class from application client project.
  7. Right-click in editor and choose Enterprise Resources|Call Enterprise Bean.
  8. In "Call Enterprise Bean" dialog choose your session bean, click Remote radio button and confirm the dialog.
  9. Add code to call your session bean from Main class. Add something like this newSession2Bean.businessMethod(); to main method.
  10. Add breakpoint at line you just added.
  11. Deploy your enterprise application.
  12. Stop application server.
  13. Start to debug application client project. Call Debug Project on project node.
  14. Click 'No' button in dialog asking 'Is server running in debug mode?'.
  15. Wait until breakpoint reached at Main class.
  16. Use Step Into (F7) action and check you passed through your business method (it doesn't go into business method because of issue 83055).
  17. Finish debugging.
RESULT: The behaviour could change after the following issues will be resolved: 81331, 83055, 83056, 83057.

Test suite 6: Java Sources Debugging

Setup: Use Enterprise application created in previous tests.

#Test caseDescription
1Debug Sources
  1. Create a new Java Main class in Source Packages under EJB project.
  2. Add line into main method and toggle breaikpoint on it.
  3. Start to debug file using Debug File context menu.
  4. Wait until debigger stops at breakpoint and continue debugging. It should finish.
  5. Create a new Java Main class in Source Packages under WAR project.
  6. Add line into main method and toggle breaikpoint on it.
  7. Start to debug file using Debug File context menu.
  8. Wait until debigger stops at breakpoint and continue debugging. It should finish.
2Debug Tests
  1. Create a test for main classes used in previous test case. Use Tools|Create Unit Tests context menu.
  2. Add breakpoint to a line in test.
  3. Start to debug file using Debug File context menu.
  4. Wait until debigger stops at breakpoint and continue debugging. It should finish.
  5. Repeat both for EJB and WAR projects.

Generated: 2007 03 06 02:54
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems