You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by eo...@apache.org on 2019/05/01 07:39:40 UTC
[maven-checkstyle-plugin] 03/03: [MCHECKSTYLE-163] Add integration
test
This is an automated email from the ASF dual-hosted git repository.
eolivelli pushed a commit to branch MCHECKSTYLE-353
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 023ed0c698cdcf55faff5eeec0ff362158e9bbf2
Author: Zoran Regvart <zr...@apache.org>
AuthorDate: Thu Jan 31 13:11:28 2019 +0100
[MCHECKSTYLE-163] Add integration test
---
src/it/MCHECKSTYLE-163/checkstyle.xml | 29 ++++++++++++
src/it/MCHECKSTYLE-163/invoker.properties | 18 +++++++
src/it/MCHECKSTYLE-163/pom.xml | 55 ++++++++++++++++++++++
.../checkstyle/mcheckstyle163/Mcheckstyle163.java | 38 +++++++++++++++
4 files changed, 140 insertions(+)
diff --git a/src/it/MCHECKSTYLE-163/checkstyle.xml b/src/it/MCHECKSTYLE-163/checkstyle.xml
new file mode 100644
index 0000000..96e0366
--- /dev/null
+++ b/src/it/MCHECKSTYLE-163/checkstyle.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE module PUBLIC
+ "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
+ "https://checkstyle.org/dtds/configuration_1_3.dtd">
+<module name="Checker">
+ <property name="severity" value="warning"/>
+ <module name="TreeWalker">
+ <module name="IllegalThrows"/>
+ </module>
+</module>
diff --git a/src/it/MCHECKSTYLE-163/invoker.properties b/src/it/MCHECKSTYLE-163/invoker.properties
new file mode 100644
index 0000000..7b2ec5e
--- /dev/null
+++ b/src/it/MCHECKSTYLE-163/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals=clean checkstyle:check
diff --git a/src/it/MCHECKSTYLE-163/pom.xml b/src/it/MCHECKSTYLE-163/pom.xml
new file mode 100644
index 0000000..02fccdb
--- /dev/null
+++ b/src/it/MCHECKSTYLE-163/pom.xml
@@ -0,0 +1,55 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins.checkstyle</groupId>
+ <artifactId>mcheckstyle-163</artifactId>
+ <version>1.0</version>
+ <url>https://issues.apache.org/jira/browse/MCHECKSTYLE-163</url>
+ <description>Test classpath resolution fails in mvn check:check when includeTestSourceDirectory = true</description>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <configLocation>checkstyle.xml</configLocation>
+ <includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <failsOnError>true</failsOnError>
+ <violationSeverity>info</violationSeverity>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/it/MCHECKSTYLE-163/src/test/java/org/apache/maven/plugins/checkstyle/mcheckstyle163/Mcheckstyle163.java b/src/it/MCHECKSTYLE-163/src/test/java/org/apache/maven/plugins/checkstyle/mcheckstyle163/Mcheckstyle163.java
new file mode 100644
index 0000000..2fa525d
--- /dev/null
+++ b/src/it/MCHECKSTYLE-163/src/test/java/org/apache/maven/plugins/checkstyle/mcheckstyle163/Mcheckstyle163.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.maven.plugins.checkstyle.mcheckstyle163;
+
+import org.junit.runners.model.InitializationError;
+
+public class Mcheckstyle163 {
+
+ public void shouldNotTriggerRedundantThrows() throws InitializationError {
+ }
+
+ public void shouldTriggerRedundantThrows() throws InitializationError, Exception {
+ }
+
+ public void workingDoesNotTriggerRedundantThrowsExample() throws IllegalArgumentException {
+ }
+
+ public void workingRedundantThrowsExample() throws IllegalArgumentException, Exception {
+ }
+
+}