Search in sources :

Example 31 with Breakpoint

use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.

the class NodeJsBreakpointsParserTest method testParseBreakpoints.

@Test
public void testParseBreakpoints() throws Exception {
    NodeJsOutput nodeJsOutput = NodeJsOutput.of("{ breakpoints: \n" + "   [ { number: 1,\n" + "       line: 1,\n" + "       column: null,\n" + "       groupId: null,\n" + "       active: true,\n" + "       condition: null,\n" + "       actual_locations: [Object],\n" + "       type: 'scriptId',\n" + "       script_id: '63' } ],\n" + "  breakOnExceptions: false,\n" + "  breakOnUncaughtExceptions: false }");
    assertTrue(parser.match(nodeJsOutput));
    List<Breakpoint> breakpoints = parser.parse(nodeJsOutput).getAll();
    assertEquals(breakpoints.size(), 1);
    Breakpoint breakpoint = breakpoints.get(0);
    assertEquals(breakpoint.getLocation().getLineNumber(), 2);
    assertEquals(breakpoint.getLocation().getTarget(), "scriptId:63");
    assertNull(breakpoint.getCondition());
    assertTrue(breakpoint.isEnabled());
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) NodeJsOutput(org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput) Test(org.testng.annotations.Test)

Example 32 with Breakpoint

use of org.eclipse.che.api.debug.shared.model.Breakpoint in project che by eclipse.

the class NodeJsBreakpointsParserTest method testParseBreakpointsWhenScriptIsNotLoaded.

@Test
public void testParseBreakpointsWhenScriptIsNotLoaded() throws Exception {
    NodeJsOutput nodeJsOutput = NodeJsOutput.of("{ breakpoints: \n" + "   [ { number: 1,\n" + "       line: 1,\n" + "       column: null,\n" + "       groupId: null,\n" + "       active: true,\n" + "       condition: null,\n" + "       actual_locations: [Object],\n" + "       type: 'scriptRegExp',\n" + "       script_regexp: '^(.*[\\\\/\\\\\\\\])?df3dfasdfs\\\\.js$' } ]," + "  breakOnExceptions: false,\n" + "  breakOnUncaughtExceptions: false }");
    assertTrue(parser.match(nodeJsOutput));
    List<Breakpoint> breakpoints = parser.parse(nodeJsOutput).getAll();
    assertEquals(breakpoints.size(), 1);
    Breakpoint breakpoint = breakpoints.get(0);
    assertEquals(breakpoint.getLocation().getLineNumber(), 2);
    assertEquals(breakpoint.getLocation().getTarget(), "scriptRegExp:^(.*[\\/\\\\])?df3dfasdfs\\.js$");
    assertNull(breakpoint.getCondition());
    assertTrue(breakpoint.isEnabled());
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) NodeJsOutput(org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput) Test(org.testng.annotations.Test)

Aggregations

Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)32 Test (org.testng.annotations.Test)14 BreakpointImpl (org.eclipse.che.api.debug.shared.model.impl.BreakpointImpl)13 ArrayList (java.util.ArrayList)11 Location (org.eclipse.che.api.debug.shared.model.Location)7 LocationImpl (org.eclipse.che.api.debug.shared.model.impl.LocationImpl)7 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)5 BreakpointActivatedEvent (org.eclipse.che.api.debug.shared.model.event.BreakpointActivatedEvent)4 BreakpointRequest (com.sun.jdi.request.BreakpointRequest)3 DebuggerEvent (org.eclipse.che.api.debug.shared.model.event.DebuggerEvent)3 GdbContinue (org.eclipse.che.plugin.gdb.server.parser.GdbContinue)3 ClassPrepareRequest (com.sun.jdi.request.ClassPrepareRequest)2 EventRequestManager (com.sun.jdi.request.EventRequestManager)2 IOException (java.io.IOException)2 StackFrameDump (org.eclipse.che.api.debug.shared.model.StackFrameDump)2 Variable (org.eclipse.che.api.debug.shared.model.Variable)2 VariableImpl (org.eclipse.che.api.debug.shared.model.impl.VariableImpl)2 VariablePathImpl (org.eclipse.che.api.debug.shared.model.impl.VariablePathImpl)2 ResumeActionImpl (org.eclipse.che.api.debug.shared.model.impl.action.ResumeActionImpl)2 BreakpointActivatedEventImpl (org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl)2