@Test(dataProvider = "parse")
  public void testParse(String output, String script, int line) throws Exception {
    NodeJsOutput nodeJsOutput = NodeJsOutput.of(output);

    Location location = parser.parse(nodeJsOutput);

    assertEquals(location.getTarget(), script);
    assertEquals(location.getLineNumber(), line);
  }
Example #2
0
 @Override
 public void deleteBreakpoint(Location location) throws DebuggerException {
   final String className = location.getTarget();
   final int lineNumber = location.getLineNumber();
   EventRequestManager requestManager = getEventManager();
   List<BreakpointRequest> snapshot = new ArrayList<>(requestManager.breakpointRequests());
   for (BreakpointRequest breakpointRequest : snapshot) {
     com.sun.jdi.Location jdiLocation = breakpointRequest.location();
     if (jdiLocation.declaringType().name().equals(className)
         && jdiLocation.lineNumber() == lineNumber) {
       requestManager.deleteEventRequest(breakpointRequest);
       LOG.debug("Delete breakpoint: {}", location);
     }
   }
 }