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());
}
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());
}
Aggregations