From 2fe93d6595c15133f9a1865249a9cc907e11d84f Mon Sep 17 00:00:00 2001 From: vmassol Date: Wed, 12 May 2004 15:21:59 +0000 Subject: [PATCH] Improved plugin tests and show how to use exclusion filters git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115243 13f79535-47bb-0310-9956-ffa450edef68 --- checkstyle/src/plugin-test/checkstyle.xml | 21 +++++++++++++++++++ checkstyle/src/plugin-test/maven.xml | 18 ++++++++++++---- checkstyle/src/plugin-test/project.properties | 2 ++ .../src/main/org/apache/maven/Dummy.java | 2 ++ .../apache/maven/SuppressionFilterSample.java | 11 ++++++++++ checkstyle/src/plugin-test/suppressions.xml | 9 ++++++++ 6 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 checkstyle/src/plugin-test/checkstyle.xml create mode 100644 checkstyle/src/plugin-test/src/main/org/apache/maven/SuppressionFilterSample.java create mode 100644 checkstyle/src/plugin-test/suppressions.xml diff --git a/checkstyle/src/plugin-test/checkstyle.xml b/checkstyle/src/plugin-test/checkstyle.xml new file mode 100644 index 00000000..3c6b525b --- /dev/null +++ b/checkstyle/src/plugin-test/checkstyle.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + diff --git a/checkstyle/src/plugin-test/maven.xml b/checkstyle/src/plugin-test/maven.xml index f62c042d..842d7639 100644 --- a/checkstyle/src/plugin-test/maven.xml +++ b/checkstyle/src/plugin-test/maven.xml @@ -15,20 +15,30 @@ * limitations under the License. */ --> - + - - ${expectedFile} not generated + + + + + + + Should not have generated an error as we have a suppression filter set on SuppressionFilterSample + + \ No newline at end of file diff --git a/checkstyle/src/plugin-test/project.properties b/checkstyle/src/plugin-test/project.properties index b9ae4c45..7aa4fa61 100644 --- a/checkstyle/src/plugin-test/project.properties +++ b/checkstyle/src/plugin-test/project.properties @@ -16,3 +16,5 @@ # required so it can be called from reactor maven.checkstyle.header.file = ${basedir}/LICENSE.txt +maven.checkstyle.properties=${basedir}/checkstyle.xml + diff --git a/checkstyle/src/plugin-test/src/main/org/apache/maven/Dummy.java b/checkstyle/src/plugin-test/src/main/org/apache/maven/Dummy.java index b966b0c8..3e34d7d6 100644 --- a/checkstyle/src/plugin-test/src/main/org/apache/maven/Dummy.java +++ b/checkstyle/src/plugin-test/src/main/org/apache/maven/Dummy.java @@ -2,5 +2,7 @@ package org.apache.maven; public class Dummy { + // Voluntarily missing static keyword in order to trigger the + // VisibilityModifier check (only static members must be private). public String badChecky = "error"; } \ No newline at end of file diff --git a/checkstyle/src/plugin-test/src/main/org/apache/maven/SuppressionFilterSample.java b/checkstyle/src/plugin-test/src/main/org/apache/maven/SuppressionFilterSample.java new file mode 100644 index 00000000..08db441c --- /dev/null +++ b/checkstyle/src/plugin-test/src/main/org/apache/maven/SuppressionFilterSample.java @@ -0,0 +1,11 @@ +package org.apache.maven; + +import java.lang.Boolean; + +public class SuppressionFilterSample +{ + // Voluntarily instantiate a boolean in order to have the + // IllegalInstantiationCheck check fail. We let it pass using a + // suppression filter in order to test that feature. + public Boolean forbidden = new Boolean(true); +} diff --git a/checkstyle/src/plugin-test/suppressions.xml b/checkstyle/src/plugin-test/suppressions.xml new file mode 100644 index 00000000..fa5b3307 --- /dev/null +++ b/checkstyle/src/plugin-test/suppressions.xml @@ -0,0 +1,9 @@ + + + + + +