From de632e61935ba379412dd477f51ead512d8832a9 Mon Sep 17 00:00:00 2001 From: snuyanzin Date: Tue, 15 Oct 2019 22:08:02 +0200 Subject: [PATCH 1/2] [PMD-2072] Add expected and actual line of numbers to message wording --- .../main/java/net/sourceforge/pmd/testframework/RuleTst.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java index 232f8a45cc..5ba2ce9815 100644 --- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java +++ b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java @@ -212,8 +212,9 @@ public abstract class RuleTst { List expected = test.getExpectedLineNumbers(); if (report.size() != expected.size()) { - throw new RuntimeException("Test setup error: number of execpted line numbers doesn't match " - + "number of violations for test case '" + test.getDescription() + "'"); + throw new RuntimeException("Test setup error: number of expected line numbers " + expected.size() + + " doesn't match number of violations " + report.size() + " for test case '" + + test.getDescription() + "'"); } Iterator it = report.iterator(); From dde5cb530a590e6d25da4c3f26531251a814d0ed Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 17 Oct 2019 21:02:34 +0200 Subject: [PATCH 2/2] [doc] Update release notes, refs #2073, fixes #2072 --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e5a964f245..c6bd1daf52 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -33,6 +33,7 @@ This is a {{ site.pmd.release_type }} release. * core * [#2014](https://github.com/pmd/pmd/issues/2014): \[core] Making add(SourceCode sourceCode) public for alternative file systems * [#2036](https://github.com/pmd/pmd/issues/2036): \[core] Wrong include/exclude patterns are silently ignored + * [#2072](https://github.com/pmd/pmd/issues/2072): \[test]\[core] Not enough info in "test setup error" when numbers of lines do not match * java * [#2042](https://github.com/pmd/pmd/issues/2042): \[java] PMD crashes with ClassFormatError: Absent Code attribute... * java-bestpractices @@ -95,6 +96,7 @@ This is a {{ site.pmd.release_type }} release. * [#2032](https://github.com/pmd/pmd/pull/2032): \[core] Allow adding SourceCode directly into CPD - [Nathan Braun](https://github.com/nbraun-Google) * [#2047](https://github.com/pmd/pmd/pull/2047): \[java] Fix computation of metrics with annotations - [Andi](https://github.com/andipabst) * [#2065](https://github.com/pmd/pmd/pull/2065): \[java] Stop checking UR anomalies - [Carlos Macasaet](https://github.com/l0s) +* [#2073](https://github.com/pmd/pmd/pull/2073): \[test]\[core] Add expected and actual line of numbers to message wording - [snuyanzin](https://github.com/snuyanzin) {% endtocmaker %}