use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testDeletedBUILDFileButLeftPackageInLocalTargets.
@Test
public void testDeletedBUILDFileButLeftPackageInLocalTargets() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("Error:com.google.a.b.Exception exception in Bar: no targets found beneath " + "'tests/com/google/a/b/c/d/baz' Thrown during call: ...");
assertThat(issue).isNotNull();
assertThat(issue.getFile()).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo(".blazeproject");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getMessage()).isEqualTo("no targets found beneath 'tests/com/google/a/b/c/d/baz'");
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseCompileErrorWithColumn.
@Test
public void testParseCompileErrorWithColumn() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("java/com/google/devtools/aswb/pluginrepo/googleplex/PluginsEndpoint.java:33:26: " + "error: '|' is not preceded with whitespace.");
assertThat(issue).isNotNull();
assertThat(issue.getLine()).isEqualTo(33);
assertThat(issue.getColumn()).isEqualTo(26);
assertThat(issue.getMessage()).isEqualTo("'|' is not preceded with whitespace.");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create(0, "java/com/google/devtools/aswb/pluginrepo/googleplex/PluginsEndpoint.java:33:26".length()));
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseLinelessBuildError.
@Test
public void testParseLinelessBuildError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: /path/to/root/java/package_path/BUILD:char offsets 1222--1229: " + "name 'grubber' is not defined");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/path/to/root/java/package_path/BUILD");
assertThat(issue.getMessage()).isEqualTo("name 'grubber' is not defined");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create("ERROR: ".length(), "ERROR: /path/to/root/java/package_path/BUILD".length()));
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testExtraParserMatch.
@Test
public void testExtraParserMatch() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(ImmutableList.of(new TestParser()));
IssueOutput issue = blazeIssueParser.parseIssue("TEST This is a test message for our test parser.");
assertThat(issue).isNotNull();
assertThat(issue.getMessage()).isEqualTo("This is a test message for our test parser.");
assertThat(issue.getLine()).isEqualTo(-1);
assertThat(issue.getColumn()).isEqualTo(-1);
assertThat(issue.getCategory()).isEqualTo(Category.WARNING);
assertThat(issue.getFile()).isNull();
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testMultilineTraceback.
@Test
public void testMultilineTraceback() {
String[] lines = new String[] { "ERROR: /home/plumpy/whatever:9:12: Traceback (most recent call last):", "\tFile \"/path/to/root/java/com/google/android/samples/helloroot/BUILD\", line 8", "\t\tpackage_group(name = BAD_FUNCTION(\"hellogoogle...\"), ...\"])", "\tFile \"/path/to/root/java/com/google/android/samples/helloroot/BUILD\", line 9, " + "in package_group", "\t\tBAD_FUNCTION", "name 'BAD_FUNCTION' is not defined." };
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
for (int i = 0; i < lines.length - 1; ++i) {
IssueOutput issue = blazeIssueParser.parseIssue(lines[i]);
assertThat(issue).isNull();
}
IssueOutput issue = blazeIssueParser.parseIssue(lines[lines.length - 1]);
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/home/plumpy/whatever");
assertThat(issue.getMessage().split("\n")).hasLength(lines.length);
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
}
Aggregations