test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume007a.java
changeset 51583 ad2224d4f346
parent 50018 3ba0d8631f24
equal deleted inserted replaced
51582:18ca918b4ed9 51583:ad2224d4f346
    31  * This class is used as debuggee application for the resume007 JDI test.
    31  * This class is used as debuggee application for the resume007 JDI test.
    32  */
    32  */
    33 
    33 
    34 public class resume007a {
    34 public class resume007a {
    35 
    35 
    36     //----------------------------------------------------- templete section
    36     //----------------------------------------------------- template section
       
    37     static int testCase    = -1;
    37 
    38 
    38     static final int PASSED = 0;
    39     static final int PASSED = 0;
    39     static final int FAILED = 2;
    40     static final int FAILED = 2;
    40     static final int PASS_BASE = 95;
    41     static final int PASS_BASE = 95;
    41 
    42 
    96 
    97 
    97                 switch (i) {
    98                 switch (i) {
    98 
    99 
    99     //------------------------------------------------------  section tested
   100     //------------------------------------------------------  section tested
   100 
   101 
   101                     case 0: resume007aTestClass.method();
   102                     case 0:
   102                             break;
   103                         resume007aTestClass.method();
       
   104                         waitForTestCase(0);
       
   105                         break;
   103 
   106 
   104                     case 1: resume007aTestClass.method();
   107                     case 1: resume007aTestClass.method();
   105                             break;
   108                             break;
   106 
   109 
   107                     case 2: resume007aTestClass.method();
   110                     case 2: resume007aTestClass.method();
   116             }
   119             }
   117 
   120 
   118         log1("debuggee exits");
   121         log1("debuggee exits");
   119         System.exit(exitCode + PASS_BASE);
   122         System.exit(exitCode + PASS_BASE);
   120     }
   123     }
   121 
   124     // Synchronize with debugger progression.
       
   125     static void waitForTestCase(int t) {
       
   126         while (testCase < t) {
       
   127             try {
       
   128                 Thread.sleep(100);
       
   129             } catch (InterruptedException e) {
       
   130                 // ignored
       
   131             }
       
   132         }
       
   133     }
   122 }
   134 }
   123 
   135 
   124 class resume007aTestClass {
   136 class resume007aTestClass {
   125 
   137 
   126     static int breakpointLine = 3;
   138     static int breakpointLine = 3;