FeaturesPluginsDocs & SupportCommunityPartners

JSP Debug Test Specification

Author: Jiri Skrivanek, Libor Martinek
Version: 1.0.2
Last update: 9.6.2005
Introduction: This is test specification of debugging of web applications in NetBeans IDE 4.1.
Comment:

Table of Contents

Test suite 1: JSP Debugging overall

Purpose:
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. Try to start debugger again. Question dialog should appear whether you want to close current session and start a new one.
  3. Cancel dialog.
  4. Try to start debugger once more.
  5. Click OK in the dialog.
  6. Finish debugger.
RESULT:Question dialog appears and a new session is (not) started.
9Run project when debugging
  1. Start debugger.
  2. When breakpoint is reached, try to run project. Question dialog should appear whether you want to close current debugging session and run project.
  3. Cancel dialog.
  4. Try to run project once more.
  5. Click OK in the dialog.
RESULT:Question dialog appears and debugger is (not) finished and project is (not) started.
10Stop server when debugging
  1. Start debugger and wait until it stops at breakpoint
  2. Call menu item Start/Stop Server in Runtime view
  3. Check it is not possible to stop and start server.
RESULT:
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. Invoke Server Status dialog by menu item "Start/Stop Server" on server instance node
  4. Stop server
  5. Start Server in debug mode
  6. Call menu item 'Run|Attach Debugger...' and in Attach dialog fill in the following fields: Connector - SharedMemoryAttach, Name - tomcat_shared_memory_id
  7. Click OK in Attach dialog
  8. Add breakpoint into index.jsp in your web application and reload application in browser
  9. Debugger should stop at breakpoint
  10. Finish debugging
  11. Stop server
  12. Change Debugging Type in properties to 'Socket'
  13. Start server in debug mode
  14. Call menu item 'Run|Attach Debugger...' and in Attach dialog fill in the following fields: Connector - SocketAttach, Host - localhost, Port - 11555
  15. Click OK in Attach dialog
  16. Reload application in browser
  17. Debugger should stop at breakpoint
  18. Finish debugging
RESULT:

Test suite 2: JSP Debugging

Purpose:
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 (Alt+Shift+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
RESULT:
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).
RESULT:
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.
RESULT:
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.
RESULT:
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.
RESULT:
7Java Libraries
  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.
RESULT:
8Freeform debugging
  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 'Debugging Type' to Socket. Then open Server Status dialog by menu item 'Start/Stop Server' and click 'Start Server (Debug)' button.
  8. Modify passwd property in build.xml (look at ${nbuserdir}/jakarta-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.
RESULT:

Test suite 3: Servlet Debugging

Purpose:
Setup:

#Test caseDescription
1Step into/out/over servlet
  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 (Alt+Shift+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
RESULT:
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 (issue 59738).
  8. Continue debugging and check modified content appears in browser.
  9. Finish debugging.
RESULT:

Test suite 4: Breakpoints in JSP

Purpose:
Setup:

#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 breakpoint 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
RESULT:
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
RESULT:
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
RESULT:
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.
RESULT:
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.
RESULT:
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
RESULT:
8Breakpoints at various 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.

Generated: 2005 07 04 12:12
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by