aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-checkstyle-plugin/test-resources
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-09-07 09:11:52 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-09-07 09:11:52 +0000
commite51183ff04b26f3e6481233fe7243d2b28b2411e (patch)
treebd0c86ac0e27ed41349252215ee3c175feecb4ef /plugins/sonar-checkstyle-plugin/test-resources
parentaef2286bf00aca219862aa62ef5dcac4bb9d2e9a (diff)
downloadsonarqube-e51183ff04b26f3e6481233fe7243d2b28b2411e.tar.gz
sonarqube-e51183ff04b26f3e6481233fe7243d2b28b2411e.zip
checkstyle plugin : add some unit tests
Diffstat (limited to 'plugins/sonar-checkstyle-plugin/test-resources')
-rw-r--r--plugins/sonar-checkstyle-plugin/test-resources/Hello.java11
-rw-r--r--plugins/sonar-checkstyle-plugin/test-resources/World.java8
-rw-r--r--plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml18
3 files changed, 37 insertions, 0 deletions
diff --git a/plugins/sonar-checkstyle-plugin/test-resources/Hello.java b/plugins/sonar-checkstyle-plugin/test-resources/Hello.java
new file mode 100644
index 00000000000..4e6f2dd42d3
--- /dev/null
+++ b/plugins/sonar-checkstyle-plugin/test-resources/Hello.java
@@ -0,0 +1,11 @@
+class Hello {
+
+ public boolean methodWithViolations() {
+ String foo = "foo";
+ String bar = "bar";
+ if (true) {
+ ;;
+ }
+ return foo==bar;
+ }
+} \ No newline at end of file
diff --git a/plugins/sonar-checkstyle-plugin/test-resources/World.java b/plugins/sonar-checkstyle-plugin/test-resources/World.java
new file mode 100644
index 00000000000..3e78a97aeaf
--- /dev/null
+++ b/plugins/sonar-checkstyle-plugin/test-resources/World.java
@@ -0,0 +1,8 @@
+public class World {
+
+ public void hello() {
+ if (true) {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml b/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml
new file mode 100644
index 00000000000..097456f6ebf
--- /dev/null
+++ b/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<!-- Generated by Sonar -->
+<module name="Checker">
+ <module name="SuppressionCommentFilter"/>
+ <module name="JavadocPackage">
+ <property name="severity" value="warning"/>
+ </module>
+ <module name="TreeWalker">
+ <module name="FileContentsHolder"/>
+ <module name="EmptyStatement">
+ <property name="severity" value="info"/>
+ </module>
+ <module name="StringLiteralEqualityCheck">
+ <property name="severity" value="error"/>
+ </module>
+ </module>
+</module>