<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="./spec.xsl" ?>

<spec title="BPEL Debugger Test Specification"
    version="2.0" 
    author = "Alexander Pepin" 
    author-email="apepin@netbeans.org"  
    last-updated = "03 November 2006">
    
    <intro>This specification provides a usecases for BPEL debugger for Service Oriented Architecture features within Netbeans Enterprise Pack Beta2
     and explains methods of testing a debugger for BPEL processes . It uses Synchronous, Asynchronous and TravelReservationService sample projects from SOA 
     samples as examples of BPEL processes to be debugged.
    </intro>
    <!-- Start Debug session -->
    <caseblock name="Start Debug session">  
        <purpose>Check different ways to start debug session.</purpose>
        <setup>Start the IDE. Start Sun Java System Application Server. 
                Create a new BPEL project from "Samples | Service Oriented Architecture " project.</setup> 

        <!-- DebugEnabled -->
        <usecase name="Check DebugEnabled option">
            <action>Start Sun Java Application Server.
            Switch to Runtime tab. 
            Expand "Sun Java System Application Server/JBI/Service Engines/com.sun.bpelse" and call Properties from the context menu.</action>
            <action>Set "DebugEnabled" property to false.</action>
            <action>Set "DebugEnabled" property to true.</action>

            <result>"com.sun.bpelse - Properties" window appears.</result>
            <result>"DebugEnabled" property is set to false.</result>
            <result>"DebugEnabled" property is set to true.</result>
        </usecase>
        
        <!-- DebugPort -->
        <usecase name="Check DebugPort option">
            <action>Start Sun Java Application Server.
            Switch to Runtime tab. 
            Expand "Sun Java System Application Server/JBI/Service Engines/com.sun.bpelse" and call Properties from the context menu.</action>
            <action>Set "DebugPort" property to 3344.</action>
            <action>Set "DebugPort" property to 3343.</action>

            <result>"com.sun.bpelse - Properties" window appears.</result>
            <result>"DebugPort" property is set to 3344.</result>
            <result>"DebugPort" property is set to 3343.</result>
        </usecase>
        
        <!-- Start debug session on default port  -->
        <usecase name="Start debug session on default port">
            <action>Start Sun Java Application Server.
            Switch to Runtime tab. 
            Expand "Sun Java System Application Server/JBI/Service Engines/com.sun.bpelse" and call Properties from the context menu.</action>
            <action>Set "DebugEnabled" property to true.</action>
            <action>Be sure that "DebugPort" property is set to 3343 if not then adjust it and restart the application server.</action>
            <action>Attach debugger, select BPEL debugger and set a host to localhost and a port to 3343.</action>
            <action>Stop debug session.</action>

            <result>"com.sun.bpelse - Properties" window appears.</result>
            <result>"DebugEnabled" property is set to true.</result>
            <result>"DebugPort" property is set to 3343. The application server is running, BPEL service engine started.</result>
            <result>BPEL Debugger Console shows "Connecting to localhost:3343. Debug session started." </result>
            <result>BPEL Debugger Console shows "Debug session finished."</result>
        </usecase>

        <!-- Start debug session on a new port  -->
        <usecase name="Start debug session on a new port">
            <action>Start Sun Java Application Server.
            Switch to Runtime tab. 
            Expand "Sun Java System Application Server/JBI/Service Engines/com.sun.bpelse" and call Properties from the context menu.</action>
            <action>Check that "DebugEnabled" is set to true otherwise set it to true.</action>
            <action>Set "DebugPort" property to 3344.</action>
            <action>Restart the application server.</action>
            <action>Attach debugger, select BPEL debugger and set a host to localhost and a port to 3343.</action>
            <action>Attach debugger, select BPEL debugger and set a host to localhost and a port to 3344.</action>
            <action>Stop debug session.</action>

            <result>"com.sun.bpelse - Properties" window appears.</result>
            <result>"DebugEnabled" property is set to true.</result>
            <result>"DebugPort" property is set to 3344.</result>
            <result>The application server is running, BPEL service engine started.</result>
            <result>BPEL Debugger Console shows "Unable to start debug session: Unable to connect to localhost:3343 : Connection refused".</result>
            <result>BPEL Debugger Console shows "Connecting to localhost:3344. Debug session started." </result>
            <result>BPEL Debugger Console shows "Debug session finished."</result>
        </usecase>
        
        <!-- Start a remote debug session -->
        <usecase name="Start a remote debug session">
            <action>Start Sun Java System Application Server on another machine, set there DebugEnabled to true and check DebugPort (e.g. 3343).</action>
            <action>Attach debugger, select BPEL debugger and set a host to the name of the machine where AS is running and a port to appropriate value.</action>
            <action>Stop debug session.</action>

            <result>On remote machine "DebugEnabled" property is set to true and "DebugPort" property is set to 3343 ,the application server is running, BPEL service engine started.</result>
            <result>BPEL Debugger Console shows "Connecting to (remotehostname):3343. Debug session started." </result>
            <result>BPEL Debugger Console shows "Debug session finished."</result>
        </usecase>

    </caseblock>
    
    <!-- Debugger windows -->
    <caseblock name="Check Debugger windows">  
        <purpose>Check Debugger windows features.</purpose>
        <setup>Start the IDE. Start Sun Java System Application Server. Create a new BPEL project from "Samples | Service Oriented Architecture " project.
        Start a debug session. Set a breakpoint in the BPEL source. Deploy the BPEL process. Run test scenario. Wait until the breakpoint is reached.</setup> 

        <!-- Debugger windows -->
        <usecase name="Check debug windows">
           <action>Open the "BPEL Variables" debug window via the "Window | Debugging | BPEL" menu</action>
           <action>Open the "Watches" debug window via the "Window | Debugging" menu</action>
           <action>Open the "Breakpoints" debug window via the "Window | Debugging | BPEL" menu</action>
           <action>Open the "Sessions" debug window via the "Window | Debugging | BPEL" menu</action>
           <action>Open the "BPEL Process Instances" debug window via the "Window | Debugging | BPEL" menu</action>
           <action>Open the "BPEL Console" debug window via the "Window | Debugging | BPEL" menu</action>

           <result>The "BPEL Variables" debug window appears. It contains Name, Type and Value columns.</result>
           <result>The "Watches" debug window appears. It contains Name, Type and Value columns.</result>
           <result>The "Breakpoints" debug window appears. It contains Name and Enabled columns.</result>
           <result>The "Sessions" debug window appears. It contains Name, State and Language columns.</result>
           <result>The "BPEL Process Instances" debug window appears. It contains Name, State and Suspended columns.</result>
           <result>The "BPEL Console" debug window appears</result>
        </usecase>

        <!-- BPEL Variables -->
        <usecase name="Check BPEL Variables window">
           <action>Open the "BPEL Variables" debug window via the "Window | Debugging | BPEL" menu</action>
            
           <result>The "BPEL Variables" debug window appears. It contains Name, Type and Value columns.</result>
        </usecase>
        
        <!-- Watches -->
        <usecase name="Check Watches window">
           <action>Open the "Watches" debug window via the "Window | Debugging" menu</action>
           <action>Create a new Watch using valid xPath expression</action>

           <result>The "Watches" debug window appears. It contains Name, Type and Value columns.</result>
           <result>The xPath expression and its value appear in the Watches window.</result>
        </usecase>
        
        <!-- Breakpoints -->
        <usecase name="Check Breakpoints window">
           <action>Open the "Breakpoints" debug window via the "Window | Debugging | BPEL" menu</action>

           <result>The "Breakpoints" debug window appears. It contains Name and Enabled columns.</result>
        </usecase>
        
        <!-- Sessions -->
        <usecase name="Check Sessions window">
           <action>Open the "Sessions" debug window via the "Window | Debugging | BPEL" menu</action>

           <result>The "Sessions" debug window appears. It contains Name, State and Language columns.</result>
        </usecase>
        
        <!-- BPEL Process Instances -->
        <usecase name="Check BPEL Process Instances window">
           <action>Open the "BPEL Process Instances" debug window via the "Window | Debugging | BPEL" menu</action>

           <result>The "BPEL Process Instances" debug window appears. It contains Name, State and Suspended columns.</result>
        </usecase>
        
        <!-- BPEL Console -->
        <usecase name="Check BPEL Console window">
           <action>Open the "BPEL Console" debug window via the "Window | Debugging | BPEL" menu</action>

           <result>The "BPEL Console" debug window appears</result>
        </usecase>
        
        
        
    </caseblock>

    <!-- Breakpoints -->
    <caseblock name="Check Breakpoints">
            <purpose>Check that breakpoints can be set and modified in BPEL project</purpose>
            <setup>Open TravelReservationService sample project.
                   Open TravelReservationService.bpel in the Editor.
                   Open "Breakpoints" debug window.
            </setup>
            
            <!-- Toggle in Source -->
            <usecase name="Toggle a breakpoint via a source editor">
               <action>Click on a gutter in the source editor next to the certain line</action>
               <action>Uncheck the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Check the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Click on a gutter in the source editor next to the same line</action>

               <result>A new breakpoint is added, breakpoint annotation is added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>The breakpoint is disabled, breakpoint annotation is greyed in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is enabled, breakpoint annotation is enabled in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is removed, breakpoint annotation is removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>
            
            <!-- Toggle in Designer -->
            <usecase name="Toggle a breakpoint via Designer">
               <action>Right-click on the element in Designer and choose Toggle Breakpoint</action>
               <action>Uncheck the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Check the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Right-click on the same element in Designer and choose Toggle Breakpoint</action>

               <result>A new breakpoint is added, breakpoint annotation is added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>The breakpoint is disabled, breakpoint annotation is greyed in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is enabled, breakpoint annotation is enabled in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is removed, breakpoint annotation is removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>
            
            <!-- Toggle in Navigator -->
            <usecase name="Toggle a breakpoint via Navigator">
               <action>Right-click on the element in Navigator and choose Toggle Breakpoint</action>
               <action>Uncheck the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Check the checkbox in the column Enabled in the Breakpoints window.</action>
               <action>Right-click on the same element in Navigator and choose Toggle Breakpoint</action>

               <result>A new breakpoint is added, breakpoint annotation is added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>The breakpoint is disabled, breakpoint annotation is greyed in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is enabled, breakpoint annotation is enabled in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is removed, breakpoint annotation is removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>
            
            <!-- Toggle via main menu -->
            <usecase name="Toggle a breakpoint via the main menu">
               <action>Click on some line in the source editor then call "Run | Toggle Breakpoint" from the main menu.</action>
               <action>Right-click on the breakpoint in the column Name in the Breakpoints window and call "Disable" from the popup menu.</action>
               <action>Call "Run | Toggle Breakpoint" from the main menu one more time.</action>

               <result>A new breakpoint is added, breakpoint annotation is added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>The breakpoint is disabled, breakpoint annotation is greyed in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>The breakpoint is removed, breakpoint annotation is removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>

            <!-- Toggle via a shortcut -->
            <usecase name="Toggle a breakpoint via a shortcut">
               <action>Click on some line in the source editor then press "Ctrl+F8.</action>
               <action>Press "Ctrl+F8 one more time.</action>

               <result>A new breakpoint is added, breakpoint annotation is added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>The breakpoint is removed, breakpoint annotation is removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>
            
            <!-- Toggle several breakpoints -->
            <usecase name="Toggle several breakpoints">
               <action>Set several breakpoints in the source editor.</action>
               <action>Select all lines in the the Breakpoints window, right-click on them and call "Disable" from the popup menu.</action>
               <action>Select all lines in the the Breakpoints window, right-click on them and call "Enable" from the popup menu.</action>
               <action>Remove all the breakpoints in the source editor.</action>

               <result>All breakpoints are added, breakpoint annotations are added to the editor and "Breakpoints" window is updated accordingly</result>
               <result>All the breakpoints are disabled, breakpoint annotations are greyed in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>All the breakpoints are enabled, breakpoint annotations are enabled in the editor and "Breakpoints" window is updated accordingly.</result>
               <result>All the breakpoints are removed, breakpoint annotations are removed from the editor and "Breakpoints" window is updated accordingly.</result>
            </usecase>
    </caseblock>

    <!-- Debugger toolbar -->
    <caseblock name="Check Debugger toolbar">  
        <purpose>Check that the debugger toolbar is accessible while debug session and its buttons work properly.</purpose>
        <setup>Start the IDE. 
            Start Sun Java System Application Server. 
            Create a new BPEL project from "Samples | Service Oriented Architecture " project.
            Deploy the project.
            Start a debug session.
        </setup>
            
        <!-- Check tolbar buttons -->    
        <usecase name="Check tolbar buttons">
           <action>When user starts a debug session debug toolbar appears.</action>

           <result>There are the following buttons on toolbar.
           Finish debug session - enabled,
           Pause - disabled,
           Continue - disabled,
           Step Over - disabled,
           Step Into - disabled,
           Step Out - disabled,
           Run to Cursor - disabled,
           New Watch... - enabled</result>
        </usecase>
        
        <!-- Pause -->    
        <usecase name="Check Pause button">
           <action>Functionality is not Accessible, the button is disabled.</action>

        </usecase>
        
        <!-- Continue (Ctrl+F5) -->    
        <usecase name="Check Continue button">
           <action>Set a breakpoint in the process then run test.</action>
           <action>Click on Continue button or press Ctrl+F5.</action>

           <result>The process suspends when the breakpoint is reached.</result>
           <result>The process resumes.</result>
        </usecase>
        
        <!-- Step Over (F8) -->    
        <usecase name="Check Step Over button">
           <action>Functionality is not accessible, the button is disabled.</action>

        </usecase>
        
        <!-- Step Into (F7) -->    
        <usecase name="Check Step Into button">
           <action>Set a breakpoint in the process then run test.</action>
           <action>Click on StepInto button or press F7.</action>

           <result>The process suspends when the breakpoint is reached.</result>
           <result>The process resumes performs one activity then suspends.</result>
        </usecase>
        
        <!-- Step Out (Ctrl+F7) -->    
        <usecase name="Check Step Out button">
           <action>Functionality is not accessible, the button is disabled.</action>

        </usecase>
        
        <!-- Run to Cursor (F4) -->    
        <usecase name="Check Run to Cursor button">
           <action>Functionality is not accessible, the button is disabled.</action>

        </usecase>
        
        <!-- New Watch -->    
        <usecase name="Check New Watch button">
           <action>Click on New Watch... button</action>

           <result>A New Watch dialog window appears.</result>
        </usecase>
        
        <!-- Finish Debug Sssion (Shift+F5) -->    
        <usecase name="Check Finish Debug Session button">
           <action>Click on the Finish Debug Sssion button or press Shift+F5.</action>
           <action>Start a new debug session.</action>
           <action>Set a breakpoint in a bpel peocess</action>
           <action>Run a test.</action>
           <action>Click on the Finish Debug Sssion button or press Shift+F5.</action>

           <result>Debug session finishes. All debug windows close.</result>
           <result>A new debug session starts.</result>
           <result>A breakpoint is set.</result>
           <result>The breakpoint is reached. The process suspends. All debug windows are updated accordingly.</result>
           <result>The process resumes and completes.</result>
        </usecase>
        
    </caseblock>

    <!-- Debugging BPEL process-->
    <caseblock name="Debugging BPEL process">
        <purpose>Check that the BPEL process instance can be debugged and breakpoints are processed correctly.</purpose>
        <setup>Open the TravelReservationService sample project. 
            Open the TravelReservationService.bpel in the Editor, switch to Source view. 
            Set a breakpoint. 
            Start a new debug session. 
            Open debug windows.
        </setup>

        <!-- Stop at breakpoint -->
        <usecase name="Reach a breakpoint">
           <action>Select the "Run" context menu item for the "TravelReservationService | Processes | TravelReservationService.bpel | Test Scenarios | HasHotel" node</action>
           <action>Switch to the Source editor window</action>
           <action>Switch to the "Threads" debug window</action>
           <action>Switch to the "Local variables" debug window</action>

           <result>A new process instance starts, reaches the breakpoint and gets suspended</result>
           <result>The current position (where process instance have stopped) is marked in the Source editor and the cursor is set on that position</result>
           <result>The corresponding record in the "Threads" window  has state "suspended"</result>
           <result>The "Local variables" window is populated with the variable values of the "current" process instance. </result>
        </usecase>

        <!-- Step Into -->
        <usecase name="Do Step Into">
           <action>Press the "Step Into" button on the toolbar</action>
           <action>Press "F7"</action>

           <result>Process instance change it's state to "running" performs one step and gets suspended. The "Local variables" window is updated</result>
           <result>Process instance change it's state to "running" performs one step and gets suspended. The "Local variables" window is updated</result>
        </usecase>

        <!-- Continue -->
        <usecase name="Do Continue">
           <action>Press the "Continue" button on the toolbar or "F5"</action>
           <action>Run the "HasHotel" test scenario one more time and press the "F5" key when it stops at the breakpoint</action>

           <result>Process instance continue working till the end and gets completed. The "Local variables" window is cleared.</result>
           <result>Process instance continue working till the end and gets completed. The "Local variables" window is cleared.</result>
        </usecase>

        <!-- Inner elements -->
        <usecase name="Debug elements inside Flow">
           <action>Create a Flow activity.
           Add some activities into the Flow so they are in different threads of the Flow.</action>
           <action>Redeploy the bpel process.</action>
           <action>Set a breakpoint to the Flow activity.</action>
           <action>Run test from CompositeApplication/Test</action>
           <action>Do StepInto steadily to perform an activities inside the Flow.</action>
           <action>Do continue to complete execution.</action>

           <result>The Flow activity contains several activities in different threads.</result>
           <result>The deployed process is updated.</result>
           <result>Breakpoint is set.</result>
           <result>The breakpoint is reached, the process becomes suspended. Debug widows are updated accordingly.</result>
           <result>All activities inside the Flow are performed in indefinite order.</result>
           <result>Bpel process completes.</result>
        </usecase>

        <!-- Catch elements -->
        <usecase name="Debug Catch elements">
           <action>Add Throw activity to the process.
           Add CatchAll fault handler to the process and put some activities inside it.</action>
           <action>Redeploy the bpel process.</action>
           <action>Set a breakpoint to an activity inside the CatchAll fault handler.</action>
           <action>Run test from CompositeApplication/Test</action>
           <action>Do StepInto to perform an activityinside the the CatchAll fault handler.</action>
           <action>Do continue to complete execution.</action>

           <result>A new CatchAll fault handler is added to the process.</result>
           <result>The deployed process is updated.</result>
           <result>Breakpoint is set.</result>
           <result>The breakpoint is reached, the process becomes suspended. Debug widows are updated accordingly.</result>
           <result>An activity is performed, debug widows are updated accordingly.</result>
           <result>Bpel process completes.</result>
        </usecase>

    </caseblock>

    <!-- Debugging several BPEL processes -->
    <caseblock name="Debugging several BPEL processes">
        <purpose>Check that several BPEL process instances can be debugged simultaneously</purpose>
        <setup>Open the TravelReservationService sample project. 
            Open the TravelReservationService.bpel in the Editor. 
            Set a breakpoint. Start a new debug session. 
            Open debug windows
        </setup>
        <intro>User can switch between process instances in the "BPEL Processes" window by marking one of them as "current". 
            There can be only one thread marked as "current".
        </intro>

        <!-- Create -->
        <usecase name="Create another BPEL process">
           <action>Select the "Run" context menu item for the "TravelReservationService | Processes | TravelReservationService.bpel | Test Scenarios | HasHotel" node</action>
           <action>Press the "Step Into" button on the toolbar</action>
           <action>Select the "Run" context menu item for the "TravelReservationService | Processes | TravelReservationService.bpel | Test Scenarios | HasAirline" node</action>

           <result>A new process instance starts, reaches the breakpoint and gets suspended</result>
           <result>Process instance change it's state to "running" performs one step and gets suspended. The "Local variables" window is updated. The current position (where process instance have stopped) jump to the next executable line in the Source editor and the cursor is set on that position</result>
           <result>A new process instance starts, reaches the breakpoint and gets suspended. A new process appears in the "BPEL Processes" debug window. Now both threads are suspended. The current position (where process instance have stopped) is set to breakpoint line in the Source editor and the cursor is set on that position</result>
        </usecase>

        <!-- Switch -->
        <usecase name="Switch between processes">
           <action>Double-click on the first thread in the "BPEL Processes" debug window</action>
           <action>Right-click on the last thread in the "BPEL Processes" debug window and select "Make Current" in the context menu</action>
           <action>Press the "Continue" button on the toolbar or "F5"</action>
           <action>Double-click on the first thread in the "BPEL Processes" debug window and press the "Continue" button on the toolbar or "F5"</action>

           <result>The current position is updated according the first process state in the Source editor and the cursor is set on that position</result>
           <result>The current position is updated according the second process state in the Source editor and the cursor is set on that position</result>
           <result>The second process instance continue working till the end and the second thread gets completed.</result>
           <result>The first process instance continue working till the end and the first thread gets completed.</result>
        </usecase>

        <!-- Multiple -->
        <usecase name="Debug multiple BPEL application">
           <action>Creaet an Asynchronous sample application.</action>
           <action>Add AsynchronousSample as JBI module to the AsynchronousSampleApplication.
           Deploy the AsynchronousSampleApplication.</action>
           <action>Set Breakpoints in the AsynchronousSample.bpel and in AsynchronousSampleClient.bpel on the "invokepartner" activity.</action>
           <action>Run a test from AsynchronousSampleApplication/Test.</action>
           <action>Do StepInto twice.</action>
           <action>Switch to AsynchronousSample process and do StepInto until it completes.</action>
           <action>Press Continue to compelte AsynchronousSampleClient process.</action>

           <result>AsynchronousSample and AsynchronousSampleApplication appear inthe project tree.</result>
           <result>AsynchronousSampleApplication is deployed.</result>
           <result>A new AsynchronousSampleClient BPEL process appears in BPEL processes debug window, reaches the breakpoint and becomes suspended.</result>
           <result>A new AsynchronousSample BPEL process appears in BPEL processes debug window, reaches the breakpoint and becomes suspended.
           The AsynchronousSampleClient BPEL process becomes running.</result>
           <result>The AsynchronousSample BPEL process becomes completed then disappears from the BPEL processes debug window.
           The AsynchronousSampleClient BPEL process becomes suspended.</result>
           <result>The AsynchronousSampleClient BPEL process becomes completed then disappears from the BPEL processes debug window.</result>
        </usecase>

    </caseblock>

    <!-- Use several debug sessions -->
    <caseblock name="Switching between several debug sessions">  
        <purpose>Check that IDE allows to switch between several debug sessions.</purpose>
        <setup>Start the IDE. 
            Start Sun Java System Application Server. 
            Create a new BPEL project from "Samples | Service Oriented Architecture " project.
            Start BPEL debug session.
            Deploy BPEL process.
        </setup> 

        <!-- Start another session  -->
        <usecase name="Start one more debug session">
            <action>Create a new java application.</action>
            <action>Set some breakpoints in java code.</action>
            <action>Debug the java application.</action>

            <result>A new Java Application appears in the Projects tree.</result>
            <result>Breakpoints appear in java editor and in the Breakpoints debug window.</result>
            <result>A new debug session starts and appears in the Sessions debug window.</result>
        </usecase>

        <!-- Switch between sessions  -->
        <usecase name="Switch between debug sessions">
            <action>Open the Sessions debug window.</action>
            <action>Double-click on BPEL debug session in the Session debug window.</action>
            <action>Double-click on Java debug session in the Session debug window.</action>
            <action>Right-click on BPEL debug session in the Session debug window and choose "Make current" from the context menu.</action>
            <action>Right-click on Java debug session in the Session debug window and choose "Make current" from the context menu.</action>

            <result>Sessions debug window appears and shows existing BPEL and Java debug sessions.</result>
            <result>The BPEL debug session becomes active and its name is decorated in bold font.
            The content of other debug windos is updated according the current state of the BPEL process.</result>
            <result>The Java debug session becomes active and its name is decorated in bold font.
            The content of other debug windos is updated according the current state of the Java process.</result>
            <result>The BPEL debug session becomes active and its name is decorated in bold font.
            The content of other debug windos is updated according the current state of the BPEL process.</result>
            <result>The Java debug session becomes active and its name is decorated in bold font.
            The content of other debug windos is updated according the current state of the Java process.</result>
        </usecase>
        
    </caseblock>
    
    <!-- Finish Debug session -->
    <caseblock name="Finish Debug session">
	<purpose>Check that the debug session can be finished</purpose>
	<setup>Open the TravelReservationService sample project. 
            Start a new debug session. 
            Open debug windows.
	</setup>
        
        <!-- Finish via Toolbar -->
	<usecase name="Finish the debug session using debugger toolbar">
	   <action>Press the "Finish" button on the toolbar or press "Shift+F5"</action>

	   <result>The debug toolbar disappears. The "BPEL variables" and "BPEL Processes" window are cleared.</result>
	   <result>The "BPEL variables" and "BPEL Processes" window are cleared.</result>
	   <result>The Debug sessions finishes. The Debugger console output window is updated with notification "hh:mm:ss Debug session finished"</result>
	</usecase>
        
        <!-- Finish via Sessions window -->
	<usecase name="Finish the debug session using Sessions debugger window">
	   <action>Select "Finish" or "Finish All" menu item in the session context menu in the Sessions debugger window.</action>

	   <result>The debug toolbar disappears. The "BPEL variables" and "BPEL Processes" window are cleared.</result>
	   <result>The "BPEL variables" and "BPEL Processes" window are cleared.</result>
	   <result>The Debug sessions finishes. The Debugger console output window is updated with notification "hh:mm:ss Debug session finished"</result>
	</usecase>
        
    </caseblock>
</spec>
