From fc49be8638bbeb32b8a850ab1417c764f894af74 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Tue, 15 May 2018 23:37:41 +0200 Subject: [PATCH] Added a test that exposes violations-lib/issues/#37. See https://github.com/tomasbjerre/violations-lib/issues/37 --- .../parser/violations/ErrorProneAdapterTest.java | 13 ++++++++++++- .../parser/violations/error-prone-maven.log | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/edu/hm/hafner/analysis/parser/violations/error-prone-maven.log diff --git a/src/test/java/edu/hm/hafner/analysis/parser/violations/ErrorProneAdapterTest.java b/src/test/java/edu/hm/hafner/analysis/parser/violations/ErrorProneAdapterTest.java index 3838348aa..1c4cc4259 100644 --- a/src/test/java/edu/hm/hafner/analysis/parser/violations/ErrorProneAdapterTest.java +++ b/src/test/java/edu/hm/hafner/analysis/parser/violations/ErrorProneAdapterTest.java @@ -1,9 +1,13 @@ package edu.hm.hafner.analysis.parser.violations; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + import edu.hm.hafner.analysis.AbstractParser; import edu.hm.hafner.analysis.AbstractParserTest; -import edu.hm.hafner.analysis.Report; import edu.hm.hafner.analysis.Priority; +import edu.hm.hafner.analysis.Report; +import static edu.hm.hafner.analysis.assertj.Assertions.assertThat; import edu.hm.hafner.analysis.assertj.SoftAssertions; /** @@ -35,4 +39,11 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti protected AbstractParser createParser() { return new ErrorProneAdapter(); } + + @Test @Disabled("See https://github.com/tomasbjerre/violations-lib/issues/37") + void shouldProvideDetailsWhenParsingMavenLog() { + Report report = parse("error-prone-maven.log"); + + assertThat(report).hasSize(1); + } } \ No newline at end of file diff --git a/src/test/resources/edu/hm/hafner/analysis/parser/violations/error-prone-maven.log b/src/test/resources/edu/hm/hafner/analysis/parser/violations/error-prone-maven.log new file mode 100644 index 000000000..f82d4f5dd --- /dev/null +++ b/src/test/resources/edu/hm/hafner/analysis/parser/violations/error-prone-maven.log @@ -0,0 +1,7 @@ +[INFO] Compiling 143 source files to /Users/hafner/Development/jenkins/workspace/Model - Freestyle - New/target/classes +[WARNING] /Users/hafner/Development/jenkins/workspace/Model - Freestyle - New/src/main/java/edu/hm/hafner/analysis/parser/RobocopyParser.java:[29,45] [StringSplitter] String.split(String) has surprising behavior + (see http://errorprone.info/bugpattern/StringSplitter) + Did you mean 'String file = matcher.group(4).split("\\s{11}", -1)[0];'? +[INFO] +[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ analysis-model --- +[INFO] Using 'UTF-8' encoding to copy filtered resources.