Search in sources :

Example 1 with NodeJsOutput

use of org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput in project che by eclipse.

the class NodeJsBackTraceParserTest method testMatch.

@Test(dataProvider = "match")
public void testMatch(String output, Boolean result) throws Exception {
    NodeJsOutput nodeJsOutput = NodeJsOutput.of(output);
    assertTrue(parser.match(nodeJsOutput) == result);
}
Also used : NodeJsOutput(org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput) Test(org.testng.annotations.Test)

Example 2 with NodeJsOutput

use of org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput in project che by eclipse.

the class NodeJsStepParserTest method testMatch.

@Test
public void testMatch() throws Exception {
    NodeJsOutput nodeJsOutput = NodeJsOutput.of("break in module.js:559\n" + " 557   if (depth === 0) stat.cache = null;\n" + " 558   return result;\n" + ">559 };\n" + " 560 \n" + " 561");
    assertTrue(parser.match(nodeJsOutput));
}
Also used : NodeJsOutput(org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput) Test(org.testng.annotations.Test)

Example 3 with NodeJsOutput

use of org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput 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 4 with NodeJsOutput

use of org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput 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)

Example 5 with NodeJsOutput

use of org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput in project che by eclipse.

the class NodeJsScriptsParserTest method testParseScriptCommand.

@Test
public void testParseScriptCommand() throws Exception {
    NodeJsOutput output = NodeJsOutput.of("  35: bootstrap_node.js\n" + "* 63: app.js\n");
    assertTrue(parser.match(output));
    Map<Integer, String> scripts = parser.parse(output).getAll();
    assertEquals(scripts.size(), 2);
    assertEquals(scripts.get(35), "bootstrap_node.js");
    assertEquals(scripts.get(63), "app.js");
}
Also used : NodeJsOutput(org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput) Test(org.testng.annotations.Test)

Aggregations

NodeJsOutput (org.eclipse.che.plugin.nodejsdbg.server.NodeJsOutput)7 Test (org.testng.annotations.Test)7 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)2 Location (org.eclipse.che.api.debug.shared.model.Location)2