< prev index next >

test/com/sun/jdi/InterruptHangTest.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung



























   1 /**
   2  *  @test
   3  *  @bug 6459476
   4  *  @summary Debuggee is blocked,  looks like running
   5  *
   6  *  @author jjh
   7  *

   8  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
   9  *  @run compile -g InterruptHangTest.java
  10  *  @run driver InterruptHangTest
  11  */
  12 import com.sun.jdi.*;
  13 import com.sun.jdi.event.*;
  14 import com.sun.jdi.request.*;
  15 
  16 /*
  17  * Debuggee has two threads.  Debugger keeps stepping in
  18  * the first thread.  The second thread keeps interrupting the first
  19  * thread.  If a long time goes by with the debugger not getting
  20  * a step event, the test fails.
  21  */
  22 class InterruptHangTarg {
  23     public static String sync = "sync";
  24     public static void main(String[] args){
  25         int answer = 0;
  26         System.out.println("Howdy!");
  27         Interruptor interruptorThread = new Interruptor(Thread.currentThread());
  28 
  29         synchronized(sync) {
  30             interruptorThread.start();
  31             try {
  32                 sync.wait();
  33             } catch (InterruptedException ee) {
  34                 System.out.println("Debuggee interruptee: interrupted before starting loop");
  35             }
  36         }


   1 /*
   2  * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.sun.jdi.*;
  25 import com.sun.jdi.event.*;
  26 import com.sun.jdi.request.*;
  27 
  28 /**
  29  *  @test
  30  *  @bug 6459476
  31  *  @summary Debuggee is blocked,  looks like running
  32  *
  33  *  @author jjh
  34  *
  35  *  @modules jdk.jdi
  36  *  @run build TestScaffold VMConnection TargetListener TargetAdapter
  37  *  @run compile -g InterruptHangTest.java
  38  *  @run driver InterruptHangTest
  39  */



  40 
  41 /**
  42  * Debuggee has two threads.  Debugger keeps stepping in
  43  * the first thread.  The second thread keeps interrupting the first
  44  * thread.  If a long time goes by with the debugger not getting
  45  * a step event, the test fails.
  46  */
  47 class InterruptHangTarg {
  48     public static String sync = "sync";
  49     public static void main(String[] args){
  50         int answer = 0;
  51         System.out.println("Howdy!");
  52         Interruptor interruptorThread = new Interruptor(Thread.currentThread());
  53 
  54         synchronized(sync) {
  55             interruptorThread.start();
  56             try {
  57                 sync.wait();
  58             } catch (InterruptedException ee) {
  59                 System.out.println("Debuggee interruptee: interrupted before starting loop");
  60             }
  61         }


< prev index next >