1 19 20 package org.netbeans.api.debugger.jpda; 21 22 import org.netbeans.api.debugger.DebuggerManager; 23 24 import java.net.URL ; 25 import org.netbeans.api.debugger.jpda.event.JPDABreakpointEvent; 26 import org.netbeans.api.debugger.jpda.event.JPDABreakpointListener; 27 import org.netbeans.junit.NbTestCase; 28 29 30 35 public class BreakpointResumeTest extends NbTestCase { 36 37 private String sourceRoot = System.getProperty ("test.dir.src"); 38 39 public BreakpointResumeTest (String s) { 40 super (s); 41 } 42 43 public void testBreakpointResume () throws Exception { 44 JPDASupport support = null; 45 JPDASupport.removeAllBreakpoints (); 46 try { 47 LineBreakpoint lb = LineBreakpoint.create ( 48 Utils.getURL(sourceRoot + "org/netbeans/api/debugger/jpda/testapps/LineBreakpointApp.java"), 49 36 50 ); 51 lb.addJPDABreakpointListener (new TestBreakpointListener ()); 52 DebuggerManager.getDebuggerManager ().addBreakpoint (lb); 53 54 support = JPDASupport.attach ( 55 "org.netbeans.api.debugger.jpda.testapps.LineBreakpointApp" 56 ); 57 support.waitState (JPDADebugger.STATE_DISCONNECTED); 58 DebuggerManager.getDebuggerManager ().removeBreakpoint (lb); 59 } finally { 60 if (support != null) { 61 support.doFinish (); 62 } 63 } 64 } 65 66 private class TestBreakpointListener implements JPDABreakpointListener { 67 68 public TestBreakpointListener() { 69 } 70 71 public void breakpointReached(JPDABreakpointEvent event) { 72 event.resume(); 73 } 74 } 75 } 76 | Popular Tags |