diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-07 09:11:52 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-07 09:11:52 +0000 |
commit | e51183ff04b26f3e6481233fe7243d2b28b2411e (patch) | |
tree | bd0c86ac0e27ed41349252215ee3c175feecb4ef /plugins/sonar-checkstyle-plugin/test-resources | |
parent | aef2286bf00aca219862aa62ef5dcac4bb9d2e9a (diff) | |
download | sonarqube-e51183ff04b26f3e6481233fe7243d2b28b2411e.tar.gz sonarqube-e51183ff04b26f3e6481233fe7243d2b28b2411e.zip |
checkstyle plugin : add some unit tests
Diffstat (limited to 'plugins/sonar-checkstyle-plugin/test-resources')
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> |