test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume006.java
changeset 51583 ad2224d4f346
parent 50018 3ba0d8631f24
equal deleted inserted replaced
51582:18ca918b4ed9 51583:ad2224d4f346
    46  * EVENT_THREAD, and ALL, for MethodEntryEvent sets.            <BR>
    46  * EVENT_THREAD, and ALL, for MethodEntryEvent sets.            <BR>
    47  * <BR>
    47  * <BR>
    48  * To check up on the method, a debugger,                       <BR>
    48  * To check up on the method, a debugger,                       <BR>
    49  * upon getting new set for the EventSet,                       <BR>
    49  * upon getting new set for the EventSet,                       <BR>
    50  * suspends VM with the method VirtualMachine.suspend(),        <BR>
    50  * suspends VM with the method VirtualMachine.suspend(),        <BR>
    51  * gets the List of geduggee's threads calling VM.allThreads(), <BR>
    51  * gets the List of debuggee's threads calling VM.allThreads(), <BR>
    52  * invokes the method EventSet.resume(), and                    <BR>
    52  * invokes the method EventSet.resume(), and                    <BR>
    53  * gets another List of geduggee's threads.                     <BR>
    53  * gets another List of debuggee's threads.                     <BR>
    54  * The debugger then compares values of                         <BR>
    54  * The debugger then compares values of                         <BR>
    55  * each thread's suspendCount from first and second Lists.      <BR>
    55  * each thread's suspendCount from first and second Lists.      <BR>
    56  * <BR>
    56  * <BR>
    57  * The test has three phases and works as follows.              <BR>
    57  * The test has three phases and works as follows.              <BR>
    58  * <BR>
    58  * <BR>
    85  * <BR>
    85  * <BR>
    86  */
    86  */
    87 
    87 
    88 public class resume006 {
    88 public class resume006 {
    89 
    89 
    90     //----------------------------------------------------- templete section
    90     //----------------------------------------------------- template section
    91     static final int PASSED = 0;
    91     static final int PASSED = 0;
    92     static final int FAILED = 2;
    92     static final int FAILED = 2;
    93     static final int PASS_BASE = 95;
    93     static final int PASS_BASE = 95;
    94 
    94 
    95     //----------------------------------------------------- templete parameters
    95     //----------------------------------------------------- template parameters
    96     static final String
    96     static final String
    97     sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume006 ",
    97     sHeader1 = "\n==> nsk/jdi/EventSet/resume/resume006 ",
    98     sHeader2 = "--> debugger: ",
    98     sHeader2 = "--> debugger: ",
    99     sHeader3 = "##> debugger: ";
    99     sHeader3 = "##> debugger: ";
   100 
   100 
   493                 }
   493                 }
   494             }
   494             }
   495 
   495 
   496             log2("......--> vm.resume()");
   496             log2("......--> vm.resume()");
   497             vm.resume();
   497             vm.resume();
       
   498             informDebuggeeTestCase(i);
   498             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   499             //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   499         }
   500         }
   500         log1("    TESTING ENDS");
   501         log1("    TESTING ENDS");
   501         return;
   502         return;
   502     }
   503     }
   630             log3("ERROR: ATTENTION: Exception within settingMethodEntryRequest() : " + e);
   631             log3("ERROR: ATTENTION: Exception within settingMethodEntryRequest() : " + e);
   631             log3("       MethodEntryRequest HAS NOT BEEN SET UP");
   632             log3("       MethodEntryRequest HAS NOT BEEN SET UP");
   632             throw new JDITestRuntimeException("** FAILURE to set up MethodEntryRequest **");
   633             throw new JDITestRuntimeException("** FAILURE to set up MethodEntryRequest **");
   633         }
   634         }
   634     }
   635     }
   635 
   636     /**
       
   637      * Inform debuggee which thread test the debugger has completed.
       
   638      * Used for synchronization, so the debuggee does not move too quickly.
       
   639      * @param testCase index of just completed test
       
   640      */
       
   641     void informDebuggeeTestCase(int testCase) {
       
   642         try {
       
   643             ((ClassType)debuggeeClass)
       
   644                 .setValue(debuggeeClass.fieldByName("testCase"),
       
   645                           vm.mirrorOf(testCase));
       
   646         } catch (InvalidTypeException ite) {
       
   647             throw new Failure("** FAILURE setting testCase  **");
       
   648         } catch (ClassNotLoadedException cnle) {
       
   649             throw new Failure("** FAILURE notifying debuggee  **");
       
   650         } catch (VMDisconnectedException e) {
       
   651             throw new Failure("** FAILURE debuggee connection **");
       
   652         }
       
   653     }
   636 }
   654 }