From 2a5eea17c29c46566a13f84eead54b202a9bae83 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 14 Aug 2015 14:49:49 +0200 Subject: Migrate batch ITs --- .../sonar-project.properties | 5 + .../case-sensitive-file-extensions/src/UPPER.XOO | 2 + .../src/UPPER.XOO.measures | 1 + .../case-sensitive-file-extensions/src/lower.xoo | 10 ++ .../src/lower.xoo.measures | 1 + .../module_a/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a1/HelloA1.xoo | 16 +++ .../it/samples/modules/a1/HelloA1.xoo.measures | 2 + .../module_b/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a2/HelloA2.xoo | 12 ++ .../it/samples/modules/a2/HelloA2.xoo.measures | 2 + .../custom-module-key/sonar-project.properties | 12 ++ .../duplicate-source/sonar-project.properties | 6 + .../src/main/xoo/org/sonar/tests/ClassOne.xoo | 5 + .../src/main/xoo2/org/sonar/tests/ClassOne.xoo | 5 + .../src/test/xoo/org/sonar/tests/ClassOne.xoo | 5 + .../batch/extension-lifecycle/module_a/pom.xml | 14 +++ .../module_a/src/main/java/HelloA.java | 10 ++ .../batch/extension-lifecycle/module_b/pom.xml | 13 +++ .../module_b/src/main/java/HelloB.java | 10 ++ it/it-projects/batch/extension-lifecycle/pom.xml | 13 +++ it/it-projects/batch/links-project/pom.xml | 31 ++++++ .../batch/links-project/sonar-project.properties | 11 ++ .../links-project/src/main/java/sample/Sample.java | 12 ++ .../batch/multi-languages/java-module/pom.xml | 15 +++ .../java-module/src/main/java/HelloJava.java | 10 ++ .../multi-languages/javascript-module/pom.xml | 20 ++++ .../javascript-module/src/Person.js | 14 +++ it/it-projects/batch/multi-languages/pom.xml | 16 +++ .../batch/multi-languages/python-module/pom.xml | 19 ++++ .../multi-languages/python-module/src/__init__.py | 0 .../python-module/src/badfortune.py | 92 +++++++++++++++ .../batch/multi-languages/sonar-project.properties | 19 ++++ .../projectAB/module_a/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a1/HelloA1.xoo | 16 +++ .../it/samples/modules/a1/HelloA1.xoo.measures | 2 + .../projectAB/module_b/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a2/HelloA2.xoo | 12 ++ .../it/samples/modules/a2/HelloA2.xoo.measures | 2 + .../projectAB/sonar-project.properties | 12 ++ .../projectAC/module_a/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a1/HelloA1.xoo | 16 +++ .../it/samples/modules/a1/HelloA1.xoo.measures | 2 + .../projectAC/module_c/sonar-project.properties | 2 + .../com/sonar/it/samples/modules/a2/HelloA2.xoo | 12 ++ .../it/samples/modules/a2/HelloA2.xoo.measures | 2 + .../projectAC/sonar-project.properties | 12 ++ .../batch/project-builder/module_a/src/HelloA.java | 10 ++ .../batch/project-builder/module_b/src/HelloB.java | 10 ++ .../project-builder/module_b/src/IgnoredFile.java | 1 + it/it-projects/batch/project-builder/pom.xml | 15 +++ .../batch/tracking/v1/sonar-project.properties | 5 + .../tracking/v1/src/main/xoo/sample/Sample.xoo | 12 ++ .../v1/src/main/xoo/sample/Sample.xoo.measures | 1 + .../batch/tracking/v2/sonar-project.properties | 5 + .../tracking/v2/src/main/xoo/sample/Sample.xoo | 14 +++ .../v2/src/main/xoo/sample/Sample.xoo.measures | 1 + .../batch/xoo-history-v2/sonar-project.properties | 5 + .../src/main/xoo/sample/ClassAdded.xoo | 12 ++ .../src/main/xoo/sample/ClassAdded.xoo.measures | 3 + .../src/main/xoo/sample/ClassToModify.xoo | 16 +++ .../src/main/xoo/sample/ClassToModify.xoo.measures | 3 + .../src/main/xoo/sample/UnchangedClass.xoo | 12 ++ .../main/xoo/sample/UnchangedClass.xoo.measures | 2 + .../xoo-multi-languages/sonar-project.properties | 4 + .../xoo-multi-languages/src/sample/Sample.xoo | 12 ++ .../src/sample/Sample.xoo.measures | 10 ++ .../xoo-multi-languages/src/sample/Sample.xoo2 | 12 ++ .../src/sample/Sample.xoo2.measures | 10 ++ .../v1/my sources/main/xoo/sample/My Sample.xoo | 12 ++ .../main/xoo/sample/My Sample.xoo.measures | 11 ++ .../v1/sonar-project.properties | 5 + .../v2/my sources/main/xoo/sample/My Sample.xoo | 12 ++ .../main/xoo/sample/My Sample.xoo.measures | 11 ++ .../v2/sonar-project.properties | 5 + .../duplications/cross-project/a/pom.xml | 9 ++ .../cross-project/a/src/main/java/MyClass.java | 14 +++ .../duplications/cross-project/b/pom.xml | 9 ++ .../cross-project/b/src/main/java/MyClass2.java | 14 +++ .../duplications/file-duplications/pom.xml | 8 ++ .../DuplicatedLinesWithOtherPackage.java | 60 ++++++++++ .../DuplicatedLinesWithOtherPackage.java | 60 ++++++++++ .../DuplicatedLinesInSamePackage1.java | 124 +++++++++++++++++++++ .../DuplicatedLinesInSamePackage2.java | 90 +++++++++++++++ .../DuplicatedLinesInSameClass.java | 89 +++++++++++++++ .../Class1.java | 60 ++++++++++ .../Class2.java | 59 ++++++++++ .../Class3.java | 62 +++++++++++ .../exclusions/exclusions/sonar-project.properties | 6 + .../exclusions/src/main/xoo/FileOnRootFolder.xoo | 10 ++ .../src/main/xoo/FileOnRootFolder.xoo.measures | 1 + .../src/main/xoo/org/sonar/tests/ClassOne.xoo | 32 ++++++ .../main/xoo/org/sonar/tests/ClassOne.xoo.measures | 1 + .../main/xoo/org/sonar/tests/ClassToExclude.xoo | 66 +++++++++++ .../org/sonar/tests/ClassToExclude.xoo.measures | 1 + .../xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo | 4 + .../sonar/tests/ClassToIgnoreGlobally.xoo.measures | 1 + .../src/main/xoo/org/sonar/tests/ClassTwo.xoo | 26 +++++ .../main/xoo/org/sonar/tests/ClassTwo.xoo.measures | 1 + .../main/xoo/org/sonar/tests/NoSonarComment.xoo | 13 +++ .../org/sonar/tests/NoSonarComment.xoo.measures | 1 + .../sonar/tests/packageToExclude/ClassThree.xoo | 26 +++++ .../tests/packageToExclude/ClassThree.xoo.measures | 1 + .../src/test/xoo/org/sonar/tests/ClassOneTest.xoo | 11 ++ .../xoo/org/sonar/tests/ClassOneTest.xoo.measures | 1 + .../xoo/org/sonar/tests/ClassToExcludeTest.xoo | 19 ++++ .../sonar/tests/ClassToExcludeTest.xoo.measures | 1 + .../src/test/xoo/org/sonar/tests/ClassTwoTest.xoo | 12 ++ .../xoo/org/sonar/tests/ClassTwoTest.xoo.measures | 1 + .../module_a/module_a1/sonar-project.properties | 1 + .../com/sonar/it/samples/modules/a1/HelloA1.xoo | 17 +++ .../it/samples/modules/a1/HelloA1.xoo.measures | 2 + .../module_a/module_a2/sonar-project.properties | 1 + .../com/sonar/it/samples/modules/a2/HelloA2.xoo | 14 +++ .../it/samples/modules/a2/HelloA2.xoo.measures | 2 + .../module_a/sonar-project.properties | 4 + .../module_b/module_b1/sonar-project.properties | 1 + .../com/sonar/it/samples/modules/b1/HelloB1.xoo | 12 ++ .../it/samples/modules/b1/HelloB1.xoo.measures | 2 + .../module_b/module_b2/sonar-project.properties | 1 + .../com/sonar/it/samples/modules/b2/HelloB2.xoo | 12 ++ .../it/samples/modules/b2/HelloB2.xoo.measures | 2 + .../module_b/sonar-project.properties | 4 + .../xoo-multi-modules/sonar-project.properties | 12 ++ .../maven/inclusions_apply_to_source_dirs/pom.xml | 22 ++++ .../src/main/java/Hello.java | 5 + .../src/main/java/Hello2.java | 5 + it/it-projects/maven/jee/ear-module/pom.xml | 61 ++++++++++ it/it-projects/maven/jee/ejb-module/pom.xml | 28 +++++ .../src/main/java/org/sonar/tests/App.java | 13 +++ .../src/main/resources/META-INF/ejb-jar.xml | 13 +++ .../src/test/java/org/sonar/tests/AppTest.java | 38 +++++++ it/it-projects/maven/jee/java-module/pom.xml | 12 ++ .../src/main/java/org/sonar/tests/App.java | 13 +++ .../src/test/java/org/sonar/tests/AppTest.java | 38 +++++++ it/it-projects/maven/jee/pom.xml | 24 ++++ it/it-projects/maven/jee/web-module/pom.xml | 50 +++++++++ .../jee/web-module/src/main/webapp/WEB-INF/web.xml | 7 ++ .../maven/jee/web-module/src/main/webapp/index.jsp | 5 + .../maven/maven-bad-parameters/module_a/pom.xml | 13 +++ .../src/main/java/org/sonar/tests/Hello.java | 10 ++ .../maven/maven-bad-parameters/module_b/pom.xml | 13 +++ .../src/main/java/org/sonar/tests/Hello.java | 10 ++ it/it-projects/maven/maven-bad-parameters/pom.xml | 47 ++++++++ .../maven/maven-bad-sources-property/pom.xml | 22 ++++ .../src/main/java/Hello.java | 5 + .../maven/maven-bad-tests-property/pom.xml | 22 ++++ .../src/main/java/Hello.java | 5 + .../src/test/java/HelloTest.java | 3 + it/it-projects/maven/maven-extensions/pom.xml | 25 +++++ .../org/sonar/tests/mavenExtensions/Hello.java | 13 +++ it/it-projects/maven/maven-only-test-dir/pom.xml | 18 +++ .../src/test/java/HelloTest.java | 10 ++ .../maven/maven-override-sources/pom.xml | 22 ++++ .../src/main/java/Hello.java | 5 + .../src/main/java2/Hello2.java | 5 + .../maven/modules-declaration/module_a/pom.xml | 14 +++ .../module_a/src/main/java/HelloA.java | 2 + .../maven/modules-declaration/module_b/pom.xml | 14 +++ .../module_b/src/main/java/HelloB.java | 2 + .../maven/modules-declaration/module_c/pom.xml | 14 +++ .../module_c/src/main/java/HelloC.java | 2 + .../maven/modules-declaration/module_d/mypom.xml | 14 +++ .../module_d/src/main/java/HelloD.java | 2 + .../maven/modules-declaration/module_e/mypom | 14 +++ .../module_e/src/main/java/HelloE.java | 2 + it/it-projects/maven/modules-declaration/pom.xml | 27 +++++ it/it-projects/maven/modules-order/README.txt | 5 + .../maven/modules-order/module_a/pom.xml | 14 +++ .../module_a/src/main/java/HelloA.java | 2 + .../maven/modules-order/module_b/pom.xml | 14 +++ .../module_b/src/main/java/HelloB.java | 2 + it/it-projects/maven/modules-order/parent/pom.xml | 10 ++ it/it-projects/maven/modules-order/pom.xml | 17 +++ .../project-with-module-without-sources/pom.xml | 14 +++ .../with-sources/pom.xml | 15 +++ .../with-sources/src/main/java/sample/Sample.java | 12 ++ .../without-sources/pom.xml | 15 +++ .../child1/pom.xml | 13 +++ .../child2/pom.xml | 47 ++++++++ .../shade-with-dependency-reduced-pom/pom.xml | 19 ++++ .../module_a/module_a1/pom.xml | 14 +++ .../com/sonar/it/samples/modules/a1/HelloA1.java | 16 +++ .../module_a/module_a2/pom.xml | 13 +++ .../com/sonar/it/samples/modules/a2/HelloA2.java | 12 ++ .../shared/multi-modules-sample/module_a/pom.xml | 17 +++ .../module_b/module_b1/pom.xml | 14 +++ .../com/sonar/it/samples/modules/b1/HelloB1.java | 12 ++ .../module_b/module_b2/pom.xml | 14 +++ .../com/sonar/it/samples/modules/b2/HelloB2.java | 12 ++ .../shared/multi-modules-sample/module_b/pom.xml | 17 +++ it/it-projects/shared/multi-modules-sample/pom.xml | 28 +++++ .../multi-modules-sample/sonar-project.properties | 16 +++ .../shared/xoo-history-v1/sonar-project.properties | 5 + .../src/main/xoo/sample/ClassToModify.xoo | 12 ++ .../src/main/xoo/sample/ClassToModify.xoo.measures | 2 + .../src/main/xoo/sample/UnchangedClass.xoo | 12 ++ .../main/xoo/sample/UnchangedClass.xoo.measures | 2 + .../shared/xoo-history-v2/sonar-project.properties | 5 + .../src/main/xoo/sample/ClassAdded.xoo | 12 ++ .../src/main/xoo/sample/ClassAdded.xoo.measures | 3 + .../src/main/xoo/sample/ClassToModify.xoo | 16 +++ .../src/main/xoo/sample/ClassToModify.xoo.measures | 3 + .../src/main/xoo/sample/UnchangedClass.xoo | 12 ++ .../main/xoo/sample/UnchangedClass.xoo.measures | 2 + .../xoo-sample-with-tests/sonar-project.properties | 6 + .../src/main/xoo/sample/Sample.xoo | 12 ++ .../src/main/xoo/sample/Sample.xoo.measures | 5 + .../src/test/xoo/sample/SampleTest.xoo | 21 ++++ .../src/test/xoo/sample/SampleTest.xoo.measures | 6 + .../xoo-two-letters-named/sonar-project.properties | 5 + .../src/main/xoo/sample/Sample.xoo | 12 ++ .../src/main/xoo/sample/Sample.xoo.measures | 1 + 213 files changed, 2941 insertions(+) create mode 100644 it/it-projects/batch/case-sensitive-file-extensions/sonar-project.properties create mode 100644 it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO create mode 100644 it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO.measures create mode 100644 it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo create mode 100644 it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo.measures create mode 100644 it/it-projects/batch/custom-module-key/module_a/sonar-project.properties create mode 100644 it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo create mode 100644 it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures create mode 100644 it/it-projects/batch/custom-module-key/module_b/sonar-project.properties create mode 100644 it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo create mode 100644 it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures create mode 100644 it/it-projects/batch/custom-module-key/sonar-project.properties create mode 100644 it/it-projects/batch/duplicate-source/sonar-project.properties create mode 100644 it/it-projects/batch/duplicate-source/src/main/xoo/org/sonar/tests/ClassOne.xoo create mode 100644 it/it-projects/batch/duplicate-source/src/main/xoo2/org/sonar/tests/ClassOne.xoo create mode 100644 it/it-projects/batch/duplicate-source/src/test/xoo/org/sonar/tests/ClassOne.xoo create mode 100644 it/it-projects/batch/extension-lifecycle/module_a/pom.xml create mode 100644 it/it-projects/batch/extension-lifecycle/module_a/src/main/java/HelloA.java create mode 100644 it/it-projects/batch/extension-lifecycle/module_b/pom.xml create mode 100644 it/it-projects/batch/extension-lifecycle/module_b/src/main/java/HelloB.java create mode 100644 it/it-projects/batch/extension-lifecycle/pom.xml create mode 100644 it/it-projects/batch/links-project/pom.xml create mode 100644 it/it-projects/batch/links-project/sonar-project.properties create mode 100644 it/it-projects/batch/links-project/src/main/java/sample/Sample.java create mode 100644 it/it-projects/batch/multi-languages/java-module/pom.xml create mode 100644 it/it-projects/batch/multi-languages/java-module/src/main/java/HelloJava.java create mode 100644 it/it-projects/batch/multi-languages/javascript-module/pom.xml create mode 100644 it/it-projects/batch/multi-languages/javascript-module/src/Person.js create mode 100644 it/it-projects/batch/multi-languages/pom.xml create mode 100644 it/it-projects/batch/multi-languages/python-module/pom.xml create mode 100644 it/it-projects/batch/multi-languages/python-module/src/__init__.py create mode 100644 it/it-projects/batch/multi-languages/python-module/src/badfortune.py create mode 100644 it/it-projects/batch/multi-languages/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_a/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_b/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures create mode 100644 it/it-projects/batch/prevent-common-module/projectAB/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_a/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_c/sonar-project.properties create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures create mode 100644 it/it-projects/batch/prevent-common-module/projectAC/sonar-project.properties create mode 100644 it/it-projects/batch/project-builder/module_a/src/HelloA.java create mode 100644 it/it-projects/batch/project-builder/module_b/src/HelloB.java create mode 100644 it/it-projects/batch/project-builder/module_b/src/IgnoredFile.java create mode 100644 it/it-projects/batch/project-builder/pom.xml create mode 100644 it/it-projects/batch/tracking/v1/sonar-project.properties create mode 100644 it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo create mode 100644 it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo.measures create mode 100644 it/it-projects/batch/tracking/v2/sonar-project.properties create mode 100644 it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo create mode 100644 it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo.measures create mode 100644 it/it-projects/batch/xoo-history-v2/sonar-project.properties create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo create mode 100644 it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures create mode 100644 it/it-projects/batch/xoo-multi-languages/sonar-project.properties create mode 100644 it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo create mode 100644 it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo.measures create mode 100644 it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2 create mode 100644 it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2.measures create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo.measures create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v1/sonar-project.properties create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo.measures create mode 100644 it/it-projects/batch/xoo-sample-with-spaces/v2/sonar-project.properties create mode 100644 it/it-projects/duplications/cross-project/a/pom.xml create mode 100644 it/it-projects/duplications/cross-project/a/src/main/java/MyClass.java create mode 100644 it/it-projects/duplications/cross-project/b/pom.xml create mode 100644 it/it-projects/duplications/cross-project/b/src/main/java/MyClass2.java create mode 100644 it/it-projects/duplications/file-duplications/pom.xml create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package1/DuplicatedLinesWithOtherPackage.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package2/DuplicatedLinesWithOtherPackage.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage1.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage2.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_same_class/DuplicatedLinesInSameClass.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class1.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class2.java create mode 100644 it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class3.java create mode 100644 it/it-projects/exclusions/exclusions/sonar-project.properties create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo.measures create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo create mode 100644 it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo.measures create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_a/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures create mode 100644 it/it-projects/exclusions/xoo-multi-modules/module_b/sonar-project.properties create mode 100644 it/it-projects/exclusions/xoo-multi-modules/sonar-project.properties create mode 100644 it/it-projects/maven/inclusions_apply_to_source_dirs/pom.xml create mode 100644 it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello.java create mode 100644 it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello2.java create mode 100644 it/it-projects/maven/jee/ear-module/pom.xml create mode 100644 it/it-projects/maven/jee/ejb-module/pom.xml create mode 100644 it/it-projects/maven/jee/ejb-module/src/main/java/org/sonar/tests/App.java create mode 100644 it/it-projects/maven/jee/ejb-module/src/main/resources/META-INF/ejb-jar.xml create mode 100644 it/it-projects/maven/jee/ejb-module/src/test/java/org/sonar/tests/AppTest.java create mode 100644 it/it-projects/maven/jee/java-module/pom.xml create mode 100644 it/it-projects/maven/jee/java-module/src/main/java/org/sonar/tests/App.java create mode 100644 it/it-projects/maven/jee/java-module/src/test/java/org/sonar/tests/AppTest.java create mode 100644 it/it-projects/maven/jee/pom.xml create mode 100644 it/it-projects/maven/jee/web-module/pom.xml create mode 100644 it/it-projects/maven/jee/web-module/src/main/webapp/WEB-INF/web.xml create mode 100644 it/it-projects/maven/jee/web-module/src/main/webapp/index.jsp create mode 100644 it/it-projects/maven/maven-bad-parameters/module_a/pom.xml create mode 100644 it/it-projects/maven/maven-bad-parameters/module_a/src/main/java/org/sonar/tests/Hello.java create mode 100644 it/it-projects/maven/maven-bad-parameters/module_b/pom.xml create mode 100644 it/it-projects/maven/maven-bad-parameters/module_b/src/main/java/org/sonar/tests/Hello.java create mode 100644 it/it-projects/maven/maven-bad-parameters/pom.xml create mode 100644 it/it-projects/maven/maven-bad-sources-property/pom.xml create mode 100644 it/it-projects/maven/maven-bad-sources-property/src/main/java/Hello.java create mode 100644 it/it-projects/maven/maven-bad-tests-property/pom.xml create mode 100644 it/it-projects/maven/maven-bad-tests-property/src/main/java/Hello.java create mode 100644 it/it-projects/maven/maven-bad-tests-property/src/test/java/HelloTest.java create mode 100644 it/it-projects/maven/maven-extensions/pom.xml create mode 100644 it/it-projects/maven/maven-extensions/src/main/java/org/sonar/tests/mavenExtensions/Hello.java create mode 100644 it/it-projects/maven/maven-only-test-dir/pom.xml create mode 100644 it/it-projects/maven/maven-only-test-dir/src/test/java/HelloTest.java create mode 100644 it/it-projects/maven/maven-override-sources/pom.xml create mode 100644 it/it-projects/maven/maven-override-sources/src/main/java/Hello.java create mode 100644 it/it-projects/maven/maven-override-sources/src/main/java2/Hello2.java create mode 100644 it/it-projects/maven/modules-declaration/module_a/pom.xml create mode 100644 it/it-projects/maven/modules-declaration/module_a/src/main/java/HelloA.java create mode 100644 it/it-projects/maven/modules-declaration/module_b/pom.xml create mode 100644 it/it-projects/maven/modules-declaration/module_b/src/main/java/HelloB.java create mode 100644 it/it-projects/maven/modules-declaration/module_c/pom.xml create mode 100644 it/it-projects/maven/modules-declaration/module_c/src/main/java/HelloC.java create mode 100644 it/it-projects/maven/modules-declaration/module_d/mypom.xml create mode 100644 it/it-projects/maven/modules-declaration/module_d/src/main/java/HelloD.java create mode 100644 it/it-projects/maven/modules-declaration/module_e/mypom create mode 100644 it/it-projects/maven/modules-declaration/module_e/src/main/java/HelloE.java create mode 100644 it/it-projects/maven/modules-declaration/pom.xml create mode 100644 it/it-projects/maven/modules-order/README.txt create mode 100644 it/it-projects/maven/modules-order/module_a/pom.xml create mode 100644 it/it-projects/maven/modules-order/module_a/src/main/java/HelloA.java create mode 100644 it/it-projects/maven/modules-order/module_b/pom.xml create mode 100644 it/it-projects/maven/modules-order/module_b/src/main/java/HelloB.java create mode 100644 it/it-projects/maven/modules-order/parent/pom.xml create mode 100644 it/it-projects/maven/modules-order/pom.xml create mode 100644 it/it-projects/maven/project-with-module-without-sources/pom.xml create mode 100644 it/it-projects/maven/project-with-module-without-sources/with-sources/pom.xml create mode 100644 it/it-projects/maven/project-with-module-without-sources/with-sources/src/main/java/sample/Sample.java create mode 100644 it/it-projects/maven/project-with-module-without-sources/without-sources/pom.xml create mode 100644 it/it-projects/maven/shade-with-dependency-reduced-pom/child1/pom.xml create mode 100644 it/it-projects/maven/shade-with-dependency-reduced-pom/child2/pom.xml create mode 100644 it/it-projects/maven/shade-with-dependency-reduced-pom/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_a/module_a1/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_a/module_a1/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java create mode 100644 it/it-projects/shared/multi-modules-sample/module_a/module_a2/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_a/module_a2/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java create mode 100644 it/it-projects/shared/multi-modules-sample/module_a/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_b/module_b1/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_b/module_b1/src/main/java/com/sonar/it/samples/modules/b1/HelloB1.java create mode 100644 it/it-projects/shared/multi-modules-sample/module_b/module_b2/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/module_b/module_b2/src/main/java/com/sonar/it/samples/modules/b2/HelloB2.java create mode 100644 it/it-projects/shared/multi-modules-sample/module_b/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/pom.xml create mode 100644 it/it-projects/shared/multi-modules-sample/sonar-project.properties create mode 100644 it/it-projects/shared/xoo-history-v1/sonar-project.properties create mode 100644 it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo create mode 100644 it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo.measures create mode 100644 it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo create mode 100644 it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo.measures create mode 100644 it/it-projects/shared/xoo-history-v2/sonar-project.properties create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo create mode 100644 it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures create mode 100644 it/it-projects/shared/xoo-sample-with-tests/sonar-project.properties create mode 100644 it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo create mode 100644 it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo.measures create mode 100644 it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo create mode 100644 it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo.measures create mode 100644 it/it-projects/shared/xoo-two-letters-named/sonar-project.properties create mode 100644 it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo create mode 100644 it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo.measures (limited to 'it/it-projects') diff --git a/it/it-projects/batch/case-sensitive-file-extensions/sonar-project.properties b/it/it-projects/batch/case-sensitive-file-extensions/sonar-project.properties new file mode 100644 index 00000000000..795bbeb5cf9 --- /dev/null +++ b/it/it-projects/batch/case-sensitive-file-extensions/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=case-sensitive-file-extensions +sonar.projectName=Case Sensitive +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src +sonar.language=xoo diff --git a/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO b/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO new file mode 100644 index 00000000000..7a7569a867b --- /dev/null +++ b/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO @@ -0,0 +1,2 @@ +File extension is upper case. +It should not be ignored since SQ 4.0. diff --git a/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO.measures b/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO.measures new file mode 100644 index 00000000000..5143bc664f8 --- /dev/null +++ b/it/it-projects/batch/case-sensitive-file-extensions/src/UPPER.XOO.measures @@ -0,0 +1 @@ +ncloc:2 diff --git a/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo b/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo new file mode 100644 index 00000000000..fd97999fff8 --- /dev/null +++ b/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo @@ -0,0 +1,10 @@ +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo.measures b/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo.measures new file mode 100644 index 00000000000..f82c5911efa --- /dev/null +++ b/it/it-projects/batch/case-sensitive-file-extensions/src/lower.xoo.measures @@ -0,0 +1 @@ +ncloc:5 diff --git a/it/it-projects/batch/custom-module-key/module_a/sonar-project.properties b/it/it-projects/batch/custom-module-key/module_a/sonar-project.properties new file mode 100644 index 00000000000..7c95bd81729 --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_a/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module A +sonar.moduleKey=com.sonarsource.it.samples:moduleA diff --git a/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..74d29a4fa08 --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo @@ -0,0 +1,16 @@ +package com.sonar.it.samples.modules.a1; + +public class HelloA1 { + private int i; + private HelloA1() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } + + protected String getHello() { + return "hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures b/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/batch/custom-module-key/module_b/sonar-project.properties b/it/it-projects/batch/custom-module-key/module_b/sonar-project.properties new file mode 100644 index 00000000000..04cd79e2247 --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module B +sonar.moduleKey=com.sonarsource.it.samples:moduleB diff --git a/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..42039538a92 --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.a2; + +public class HelloA2 { + private int i; + private HelloA2() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures b/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures new file mode 100644 index 00000000000..3947d3bdbff --- /dev/null +++ b/it/it-projects/batch/custom-module-key/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 \ No newline at end of file diff --git a/it/it-projects/batch/custom-module-key/sonar-project.properties b/it/it-projects/batch/custom-module-key/sonar-project.properties new file mode 100644 index 00000000000..7935cb5ffb0 --- /dev/null +++ b/it/it-projects/batch/custom-module-key/sonar-project.properties @@ -0,0 +1,12 @@ +# Root project information +sonar.projectKey=com.sonarsource.it.samples:multi-modules-sample +sonar.projectName=Sonar :: Integration Tests :: Multi-modules Sample +sonar.projectVersion=1.0-SNAPSHOT + +sonar.language=xoo + +# Some properties that will be inherited by the modules +sonar.sources=src/main/xoo + +# List of the module identifiers +sonar.modules=module_a,module_b diff --git a/it/it-projects/batch/duplicate-source/sonar-project.properties b/it/it-projects/batch/duplicate-source/sonar-project.properties new file mode 100644 index 00000000000..cf176850bae --- /dev/null +++ b/it/it-projects/batch/duplicate-source/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=com.sonarsource.it.projects.batch:duplicate-source +sonar.projectName=exclusions +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo,src/main/xoo2 +sonar.tests=src/test/xoo +sonar.language=xoo diff --git a/it/it-projects/batch/duplicate-source/src/main/xoo/org/sonar/tests/ClassOne.xoo b/it/it-projects/batch/duplicate-source/src/main/xoo/org/sonar/tests/ClassOne.xoo new file mode 100644 index 00000000000..8cf8aec82fe --- /dev/null +++ b/it/it-projects/batch/duplicate-source/src/main/xoo/org/sonar/tests/ClassOne.xoo @@ -0,0 +1,5 @@ +package org.sonar.tests; + +public class ClassOne { + +} diff --git a/it/it-projects/batch/duplicate-source/src/main/xoo2/org/sonar/tests/ClassOne.xoo b/it/it-projects/batch/duplicate-source/src/main/xoo2/org/sonar/tests/ClassOne.xoo new file mode 100644 index 00000000000..8cf8aec82fe --- /dev/null +++ b/it/it-projects/batch/duplicate-source/src/main/xoo2/org/sonar/tests/ClassOne.xoo @@ -0,0 +1,5 @@ +package org.sonar.tests; + +public class ClassOne { + +} diff --git a/it/it-projects/batch/duplicate-source/src/test/xoo/org/sonar/tests/ClassOne.xoo b/it/it-projects/batch/duplicate-source/src/test/xoo/org/sonar/tests/ClassOne.xoo new file mode 100644 index 00000000000..8cf8aec82fe --- /dev/null +++ b/it/it-projects/batch/duplicate-source/src/test/xoo/org/sonar/tests/ClassOne.xoo @@ -0,0 +1,5 @@ +package org.sonar.tests; + +public class ClassOne { + +} diff --git a/it/it-projects/batch/extension-lifecycle/module_a/pom.xml b/it/it-projects/batch/extension-lifecycle/module_a/pom.xml new file mode 100644 index 00000000000..8cc056c4e81 --- /dev/null +++ b/it/it-projects/batch/extension-lifecycle/module_a/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + module_a + jar + Module A + + + com.sonarsource.it.projects.batch + extension-lifecycle + 1.0-SNAPSHOT + + + \ No newline at end of file diff --git a/it/it-projects/batch/extension-lifecycle/module_a/src/main/java/HelloA.java b/it/it-projects/batch/extension-lifecycle/module_a/src/main/java/HelloA.java new file mode 100644 index 00000000000..847098b9a50 --- /dev/null +++ b/it/it-projects/batch/extension-lifecycle/module_a/src/main/java/HelloA.java @@ -0,0 +1,10 @@ +public class HelloA { + private int i; + private HelloA() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/extension-lifecycle/module_b/pom.xml b/it/it-projects/batch/extension-lifecycle/module_b/pom.xml new file mode 100644 index 00000000000..449325b7691 --- /dev/null +++ b/it/it-projects/batch/extension-lifecycle/module_b/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + module_b + jar + Module B + + + com.sonarsource.it.projects.batch + extension-lifecycle + 1.0-SNAPSHOT + + \ No newline at end of file diff --git a/it/it-projects/batch/extension-lifecycle/module_b/src/main/java/HelloB.java b/it/it-projects/batch/extension-lifecycle/module_b/src/main/java/HelloB.java new file mode 100644 index 00000000000..afc7d2c906c --- /dev/null +++ b/it/it-projects/batch/extension-lifecycle/module_b/src/main/java/HelloB.java @@ -0,0 +1,10 @@ +public class HelloB { + private int i; + private HelloB() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/extension-lifecycle/pom.xml b/it/it-projects/batch/extension-lifecycle/pom.xml new file mode 100644 index 00000000000..30de64cef8c --- /dev/null +++ b/it/it-projects/batch/extension-lifecycle/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + com.sonarsource.it.projects.batch + extension-lifecycle + 1.0-SNAPSHOT + pom + Sonar :: Integration Tests :: Extension Lifecycle Sample + + module_a + module_b + + \ No newline at end of file diff --git a/it/it-projects/batch/links-project/pom.xml b/it/it-projects/batch/links-project/pom.xml new file mode 100644 index 00000000000..a0bc27aaab6 --- /dev/null +++ b/it/it-projects/batch/links-project/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + com.sonarsource.it.samples + simple-sample + 1.0-SNAPSHOT + Sonar :: Integration Tests :: Simple Sample + + http://www.simplesample.org + + + jira + http://jira.codehaus.org/browse/SIMPLESAMPLE + + + + scm:git:git@github.com:SonarSource/simplesample.git + scm:git:git@github.com:SonarSource/simplesample.git + https://github.com/SonarSource/simplesample + + + + bamboo + http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE + + + + + http://www.simplesample.org_OVERRIDDEN + + + \ No newline at end of file diff --git a/it/it-projects/batch/links-project/sonar-project.properties b/it/it-projects/batch/links-project/sonar-project.properties new file mode 100644 index 00000000000..4352408bd5c --- /dev/null +++ b/it/it-projects/batch/links-project/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=com.sonarsource.it.samples:simple-sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectName=Sonar :: Integration Tests :: Simple Sample + +sonar.sources=src/main/java + +sonar.links.homepage=http://www.simplesample.org_OVERRIDDEN +sonar.links.ci=http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE +sonar.links.issue=http://jira.codehaus.org/browse/SIMPLESAMPLE +sonar.links.scm=https://github.com/SonarSource/simplesample +sonar.links.scm_dev=scm:git:git@github.com:SonarSource/simplesample.git diff --git a/it/it-projects/batch/links-project/src/main/java/sample/Sample.java b/it/it-projects/batch/links-project/src/main/java/sample/Sample.java new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/batch/links-project/src/main/java/sample/Sample.java @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/multi-languages/java-module/pom.xml b/it/it-projects/batch/multi-languages/java-module/pom.xml new file mode 100644 index 00000000000..9b9cb11763f --- /dev/null +++ b/it/it-projects/batch/multi-languages/java-module/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + com.sonarsource.it.projects.batch.multi-languages + multi-languages + 1.0-SNAPSHOT + + java-module + Java Module + + + java + + diff --git a/it/it-projects/batch/multi-languages/java-module/src/main/java/HelloJava.java b/it/it-projects/batch/multi-languages/java-module/src/main/java/HelloJava.java new file mode 100644 index 00000000000..c575aeb9d4c --- /dev/null +++ b/it/it-projects/batch/multi-languages/java-module/src/main/java/HelloJava.java @@ -0,0 +1,10 @@ +public class HelloJava { + private int i; + private HelloJava() { + + } + + public void hello() { + System.out.println("hello" + " java"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/multi-languages/javascript-module/pom.xml b/it/it-projects/batch/multi-languages/javascript-module/pom.xml new file mode 100644 index 00000000000..f0eb641e9e2 --- /dev/null +++ b/it/it-projects/batch/multi-languages/javascript-module/pom.xml @@ -0,0 +1,20 @@ + + 4.0.0 + + com.sonarsource.it.projects.batch.multi-languages + multi-languages + 1.0-SNAPSHOT + + javascript-module + Javascript Module + + + js + + + + src + + + \ No newline at end of file diff --git a/it/it-projects/batch/multi-languages/javascript-module/src/Person.js b/it/it-projects/batch/multi-languages/javascript-module/src/Person.js new file mode 100644 index 00000000000..d5eb180de72 --- /dev/null +++ b/it/it-projects/batch/multi-languages/javascript-module/src/Person.js @@ -0,0 +1,14 @@ + +var Person = function(first, last, middle) { + this.first = first; + this.middle = middle; + this.last = last; +}; + +Person.prototype = { + + whoAreYou : function() { + return this.first + (this.middle ? ' ' + this.middle: '') + ' ' + this.last; + } + +}; diff --git a/it/it-projects/batch/multi-languages/pom.xml b/it/it-projects/batch/multi-languages/pom.xml new file mode 100644 index 00000000000..bdde8327393 --- /dev/null +++ b/it/it-projects/batch/multi-languages/pom.xml @@ -0,0 +1,16 @@ + + 4.0.0 + com.sonarsource.it.projects.batch.multi-languages + multi-languages + 1.0-SNAPSHOT + pom + Multi Languages + One language per module + + + java-module + javascript-module + python-module + + \ No newline at end of file diff --git a/it/it-projects/batch/multi-languages/python-module/pom.xml b/it/it-projects/batch/multi-languages/python-module/pom.xml new file mode 100644 index 00000000000..02520cd6de9 --- /dev/null +++ b/it/it-projects/batch/multi-languages/python-module/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + com.sonarsource.it.projects.batch.multi-languages + multi-languages + 1.0-SNAPSHOT + + python-module + Python Module + + + py + + + + src + + \ No newline at end of file diff --git a/it/it-projects/batch/multi-languages/python-module/src/__init__.py b/it/it-projects/batch/multi-languages/python-module/src/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/it/it-projects/batch/multi-languages/python-module/src/badfortune.py b/it/it-projects/batch/multi-languages/python-module/src/badfortune.py new file mode 100644 index 00000000000..b0900dc1695 --- /dev/null +++ b/it/it-projects/batch/multi-languages/python-module/src/badfortune.py @@ -0,0 +1,92 @@ + +# fortune.py -- chooses a random fortune, as the fortune(8) program in +# the BSD-games package does +# +# Copyright (c) 2010, Andrew M. Kuchling +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +import struct, random, string + +# C long variables are different sizes on 32-bit and 64-bit machines, +# so we have to measure how big they are on the machine where this is running. +LONG_SIZE = struct.calcsize('L') +is_64_bit = (LONG_SIZE == 8) + +def get(filename): + "Select a random quotation, using a pregenerated .dat file" + + # First, we open the .dat file, and read the header information. + # The C structure containing this info looks like: + ## typedef struct { /* information table */ + ## #define VERSION 1 + ## unsigned long str_version; /* version number */ + ## unsigned long str_numstr; /* # of strings in the file */ + ## unsigned long str_longlen; /* length of longest string */ + ## unsigned long str_shortlen; /* length of shortest string */ + ## #define STR_RANDOM 0x1 /* randomized pointers */ + ## #define STR_ORDERED 0x2 /* ordered pointers */ + ## #define STR_ROTATED 0x4 /* rot-13'd text */ + ## unsigned long str_flags; /* bit field for flags */ + ## unsigned char stuff[4]; /* long aligned space */ + ## #define str_delim stuff[0] /* delimiting character */ + ## } STRFILE; + + datfile = open(filename+'.dat', 'r') + data = datfile.read(5 * LONG_SIZE) + if is_64_bit: + v1, v2, n1, n2, l1, l2, s1, s2, f1, f2 = struct.unpack('!10L', data) + version = v1 + (v2 << 32) + numstr = n1 + (n2 << 32) + longlen = l1 + (l2 << 32) + shortlen = s1 + (s2 << 32) + flags = f1 + (f2 << 32) + else: + version, numstr, longlen, shortlen, flags = struct.unpack('5l', data) + + delimiter = datfile.read(1) + datfile.read(3) # Throw away padding bytes + if is_64_bit: datfile.read(4) # 64-bit machines align to 8 bytes + + # Pick a random number + r = random.randint(0, numstr) + datfile.seek(LONG_SIZE * r, 1) # Seek to the chosen pointer + data = datfile.read(LONG_SIZE * 2) + + if is_64_bit: + s1, s2, e1, e2 = struct.unpack('!4L', data) + start, end = s1 + (s2 << 32), e1 + (e2 << 32) + else: + start, end = struct.unpack('!ll', data) + datfile.close() + + file = open(filename, 'r') + file.seek(start) + quotation = file.read(end-start) + L=string.split(quotation, '\n') + while string.strip(L[-1]) == delimiter or string.strip(L[-1]) == "": + L=L[:-1] + return string.join(L, '\n') + +if __name__ == '__main__': + import sys + if len(sys.argv) == 1: + print 'Usage: fortune.py ' + sys.exit() + print get(sys.argv[1]) diff --git a/it/it-projects/batch/multi-languages/sonar-project.properties b/it/it-projects/batch/multi-languages/sonar-project.properties new file mode 100644 index 00000000000..ab848fa49f4 --- /dev/null +++ b/it/it-projects/batch/multi-languages/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=multi-languages +sonar.projectName=Multi Languages +sonar.projectVersion=1.0-SNAPSHOT +sonar.modules=java-module,javascript-module,python-module + +# not used but mandatory parameter because of https://jira.codehaus.org/browse/SONARPLUGINS-2297 +sonar.sources=src + +java-module.sonar.projectName=Java Module +java-module.sonar.sources=src/main/java +java-module.sonar.language=java + +javascript-module.sonar.projectName=Javascript Module +javascript-module.sonar.sources=src +javascript-module.sonar.language=js + +python-module.sonar.projectName=Python Module +python-module.sonar.sources=src +python-module.sonar.language=py \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_a/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAB/module_a/sonar-project.properties new file mode 100644 index 00000000000..7c95bd81729 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_a/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module A +sonar.moduleKey=com.sonarsource.it.samples:moduleA diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..74d29a4fa08 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo @@ -0,0 +1,16 @@ +package com.sonar.it.samples.modules.a1; + +public class HelloA1 { + private int i; + private HelloA1() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } + + protected String getHello() { + return "hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures b/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_b/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAB/module_b/sonar-project.properties new file mode 100644 index 00000000000..04cd79e2247 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module B +sonar.moduleKey=com.sonarsource.it.samples:moduleB diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..42039538a92 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.a2; + +public class HelloA2 { + private int i; + private HelloA2() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures b/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures new file mode 100644 index 00000000000..3947d3bdbff --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/module_b/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAB/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAB/sonar-project.properties new file mode 100644 index 00000000000..e3c23037ee1 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAB/sonar-project.properties @@ -0,0 +1,12 @@ +# Root project information +sonar.projectKey=projectAB +sonar.projectName=Project AB +sonar.projectVersion=1.0-SNAPSHOT + +sonar.language=xoo + +# Some properties that will be inherited by the modules +sonar.sources=src/main/xoo + +# List of the module identifiers +sonar.modules=module_a,module_b diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_a/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAC/module_a/sonar-project.properties new file mode 100644 index 00000000000..7c95bd81729 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_a/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module A +sonar.moduleKey=com.sonarsource.it.samples:moduleA diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..74d29a4fa08 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo @@ -0,0 +1,16 @@ +package com.sonar.it.samples.modules.a1; + +public class HelloA1 { + private int i; + private HelloA1() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } + + protected String getHello() { + return "hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures b/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_a/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_c/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAC/module_c/sonar-project.properties new file mode 100644 index 00000000000..670f26db1db --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_c/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectName=Module C +sonar.moduleKey=com.sonarsource.it.samples:moduleC diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..42039538a92 --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.a2; + +public class HelloA2 { + private int i; + private HelloA2() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures b/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures new file mode 100644 index 00000000000..3947d3bdbff --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/module_c/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 \ No newline at end of file diff --git a/it/it-projects/batch/prevent-common-module/projectAC/sonar-project.properties b/it/it-projects/batch/prevent-common-module/projectAC/sonar-project.properties new file mode 100644 index 00000000000..342fb68ec8f --- /dev/null +++ b/it/it-projects/batch/prevent-common-module/projectAC/sonar-project.properties @@ -0,0 +1,12 @@ +# Root project information +sonar.projectKey=projectAC +sonar.projectName=Project AC +sonar.projectVersion=1.0-SNAPSHOT + +sonar.language=xoo + +# Some properties that will be inherited by the modules +sonar.sources=src/main/xoo + +# List of the module identifiers +sonar.modules=module_a,module_c diff --git a/it/it-projects/batch/project-builder/module_a/src/HelloA.java b/it/it-projects/batch/project-builder/module_a/src/HelloA.java new file mode 100644 index 00000000000..847098b9a50 --- /dev/null +++ b/it/it-projects/batch/project-builder/module_a/src/HelloA.java @@ -0,0 +1,10 @@ +public class HelloA { + private int i; + private HelloA() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/project-builder/module_b/src/HelloB.java b/it/it-projects/batch/project-builder/module_b/src/HelloB.java new file mode 100644 index 00000000000..afc7d2c906c --- /dev/null +++ b/it/it-projects/batch/project-builder/module_b/src/HelloB.java @@ -0,0 +1,10 @@ +public class HelloB { + private int i; + private HelloB() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/batch/project-builder/module_b/src/IgnoredFile.java b/it/it-projects/batch/project-builder/module_b/src/IgnoredFile.java new file mode 100644 index 00000000000..9574c15b0ee --- /dev/null +++ b/it/it-projects/batch/project-builder/module_b/src/IgnoredFile.java @@ -0,0 +1 @@ +this file has been selected by the extension CreateSubProjects. \ No newline at end of file diff --git a/it/it-projects/batch/project-builder/pom.xml b/it/it-projects/batch/project-builder/pom.xml new file mode 100644 index 00000000000..e79f785f013 --- /dev/null +++ b/it/it-projects/batch/project-builder/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + com.sonarsource.it.projects.batch + project-builder + 1.0-SNAPSHOT + pom + Sonar :: Integration Tests :: Project Builder Sample + + + + \ No newline at end of file diff --git a/it/it-projects/batch/tracking/v1/sonar-project.properties b/it/it-projects/batch/tracking/v1/sonar-project.properties new file mode 100644 index 00000000000..e01f062e51b --- /dev/null +++ b/it/it-projects/batch/tracking/v1/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo b/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo.measures new file mode 100644 index 00000000000..7bb5f438500 --- /dev/null +++ b/it/it-projects/batch/tracking/v1/src/main/xoo/sample/Sample.xoo.measures @@ -0,0 +1 @@ +ncloc:8 diff --git a/it/it-projects/batch/tracking/v2/sonar-project.properties b/it/it-projects/batch/tracking/v2/sonar-project.properties new file mode 100644 index 00000000000..e01f062e51b --- /dev/null +++ b/it/it-projects/batch/tracking/v2/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo b/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..3f624a15b08 --- /dev/null +++ b/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,14 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + System.out.println("foo"); + } + + private String myMethod() { + System.out.println("foo"); + return "hello"; + } +} diff --git a/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo.measures new file mode 100644 index 00000000000..69a10eb19d4 --- /dev/null +++ b/it/it-projects/batch/tracking/v2/src/main/xoo/sample/Sample.xoo.measures @@ -0,0 +1 @@ +ncloc:10 diff --git a/it/it-projects/batch/xoo-history-v2/sonar-project.properties b/it/it-projects/batch/xoo-history-v2/sonar-project.properties new file mode 100644 index 00000000000..e01f062e51b --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo new file mode 100644 index 00000000000..b0fd1087030 --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassAdded { + + public ClassAdded(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures new file mode 100644 index 00000000000..66ba834e1ef --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures @@ -0,0 +1,3 @@ +ncloc:12 +classes:1 + diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo new file mode 100644 index 00000000000..393111bbab0 --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo @@ -0,0 +1,16 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + public String addedMethod() { + return "This method was added in v2"; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures new file mode 100644 index 00000000000..71d60758637 --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures @@ -0,0 +1,3 @@ +ncloc:16 +classes:1 + diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo new file mode 100644 index 00000000000..2b0288fc971 --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/batch/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/batch/xoo-multi-languages/sonar-project.properties b/it/it-projects/batch/xoo-multi-languages/sonar-project.properties new file mode 100644 index 00000000000..a2941788c41 --- /dev/null +++ b/it/it-projects/batch/xoo-multi-languages/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=multi-language-sample +sonar.projectName=Multi-Language Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src diff --git a/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo.measures b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo.measures new file mode 100644 index 00000000000..ab1671431fc --- /dev/null +++ b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo.measures @@ -0,0 +1,10 @@ +ncloc:13 +#Used by dashboard/widgets tests +complexity_in_classes:3 +classes:1 +comment_lines:3 +public_api:5 +public_undocumented_api:2 +duplicated_files:1 +duplicated_blocks:2 +duplicated_lines:3 diff --git a/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2 b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2 new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2 @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2.measures b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2.measures new file mode 100644 index 00000000000..ab1671431fc --- /dev/null +++ b/it/it-projects/batch/xoo-multi-languages/src/sample/Sample.xoo2.measures @@ -0,0 +1,10 @@ +ncloc:13 +#Used by dashboard/widgets tests +complexity_in_classes:3 +classes:1 +comment_lines:3 +public_api:5 +public_undocumented_api:2 +duplicated_files:1 +duplicated_blocks:2 +duplicated_lines:3 diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo b/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo.measures b/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo.measures new file mode 100644 index 00000000000..3f73ea8f695 --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v1/my sources/main/xoo/sample/My Sample.xoo.measures @@ -0,0 +1,11 @@ +ncloc:13 +#Used by dashboard/widgets tests +complexity:3 +complexity_in_classes:3 +classes:1 +comment_lines:3 +public_api:5 +public_undocumented_api:2 +duplicated_files:1 +duplicated_blocks:2 +duplicated_lines:3 diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v1/sonar-project.properties b/it/it-projects/batch/xoo-sample-with-spaces/v1/sonar-project.properties new file mode 100644 index 00000000000..bae5f7f152c --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v1/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=my sources/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo b/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo new file mode 100644 index 00000000000..8c91df8b6cf --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod_modified() { + return "hello"; + } +} diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo.measures b/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo.measures new file mode 100644 index 00000000000..3f73ea8f695 --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v2/my sources/main/xoo/sample/My Sample.xoo.measures @@ -0,0 +1,11 @@ +ncloc:13 +#Used by dashboard/widgets tests +complexity:3 +complexity_in_classes:3 +classes:1 +comment_lines:3 +public_api:5 +public_undocumented_api:2 +duplicated_files:1 +duplicated_blocks:2 +duplicated_lines:3 diff --git a/it/it-projects/batch/xoo-sample-with-spaces/v2/sonar-project.properties b/it/it-projects/batch/xoo-sample-with-spaces/v2/sonar-project.properties new file mode 100644 index 00000000000..bae5f7f152c --- /dev/null +++ b/it/it-projects/batch/xoo-sample-with-spaces/v2/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=my sources/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/duplications/cross-project/a/pom.xml b/it/it-projects/duplications/cross-project/a/pom.xml new file mode 100644 index 00000000000..fc279f29aaa --- /dev/null +++ b/it/it-projects/duplications/cross-project/a/pom.xml @@ -0,0 +1,9 @@ + + 4.0.0 + + com.sonarsource.it.samples.duplications + a + 1.0-SNAPSHOT + + diff --git a/it/it-projects/duplications/cross-project/a/src/main/java/MyClass.java b/it/it-projects/duplications/cross-project/a/src/main/java/MyClass.java new file mode 100644 index 00000000000..2dca0f23534 --- /dev/null +++ b/it/it-projects/duplications/cross-project/a/src/main/java/MyClass.java @@ -0,0 +1,14 @@ +public class MyClass { + public void sayHello() { + int d1; + int d2; + int d3; + int d4; + int d5; + int d6; + int d7; + int d8; + int d9; + int d10; + } +} diff --git a/it/it-projects/duplications/cross-project/b/pom.xml b/it/it-projects/duplications/cross-project/b/pom.xml new file mode 100644 index 00000000000..e3db8fc52a2 --- /dev/null +++ b/it/it-projects/duplications/cross-project/b/pom.xml @@ -0,0 +1,9 @@ + + 4.0.0 + + com.sonarsource.it.samples.duplications + b + 1.0-SNAPSHOT + + diff --git a/it/it-projects/duplications/cross-project/b/src/main/java/MyClass2.java b/it/it-projects/duplications/cross-project/b/src/main/java/MyClass2.java new file mode 100644 index 00000000000..b8a203b884b --- /dev/null +++ b/it/it-projects/duplications/cross-project/b/src/main/java/MyClass2.java @@ -0,0 +1,14 @@ +public class MyClass2 { + public void sayHello2() { + int d1; + int d2; + int d3; + int d4; + int d5; + int d6; + int d7; + int d8; + int d9; + int d10; + } +} diff --git a/it/it-projects/duplications/file-duplications/pom.xml b/it/it-projects/duplications/file-duplications/pom.xml new file mode 100644 index 00000000000..dd73385ea96 --- /dev/null +++ b/it/it-projects/duplications/file-duplications/pom.xml @@ -0,0 +1,8 @@ + + 4.0.0 + + com.sonarsource.it.samples + duplications + 1.0-SNAPSHOT + + diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package1/DuplicatedLinesWithOtherPackage.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package1/DuplicatedLinesWithOtherPackage.java new file mode 100644 index 00000000000..cb27ed9455a --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package1/DuplicatedLinesWithOtherPackage.java @@ -0,0 +1,60 @@ +/* + * Sonar, entreprise quality control tool. + * Copyright (C) 2007-2008 Hortis-GRC SA + * mailto:be_agile HAT hortis DOT ch + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_lines_with_other_package1; + +public class DuplicatedLinesWithOtherPackage { + + public DuplicatedLinesWithOtherPackage() { + } + + public void duplicatedMethodWithOtherPackage() { + char[] charList = new char[30]; + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} \ No newline at end of file diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package2/DuplicatedLinesWithOtherPackage.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package2/DuplicatedLinesWithOtherPackage.java new file mode 100644 index 00000000000..f49127f3a06 --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_with_other_package2/DuplicatedLinesWithOtherPackage.java @@ -0,0 +1,60 @@ +/* + * Sonar, entreprise quality control tool. + * Copyright (C) 2007-2008 Hortis-GRC SA + * mailto:be_agile HAT hortis DOT ch + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_lines_with_other_package2; + +public class DuplicatedLinesWithOtherPackage { + + public DuplicatedLinesWithOtherPackage() { + } + + public void duplicatedMethodWithOtherPackage() { + char[] charList = new char[30]; + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + for (int i = 0; i < 10; i++) { + charList[i] = 'a'; + } + } +} \ No newline at end of file diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage1.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage1.java new file mode 100644 index 00000000000..7316bdebbcf --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage1.java @@ -0,0 +1,124 @@ +/* + * Sonar, entreprise quality control tool. + * Copyright (C) 2007-2008 Hortis-GRC SA + * mailto:be_agile HAT hortis DOT ch + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_lines_within_package; + +public class DuplicatedLinesInSamePackage1 { + + public DuplicatedLinesInSamePackage1() { + } + + /* + * sddfgdfgfg + */ + public void duplicatedMethodInSameClass1() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + // first + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + + public void duplicatedMethodInSameClass3() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + // test2 + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + // test 1 + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + int intergerToBeIncremented70 = 0; + while (intergerToBeIncremented70 < 100) { + intergerToBeIncremented70++; + } + } + + public void duplicated2MethodInSameClass3() { + System.out.print("copy test start"); + int intergerToBeIncremented1 = 0; + while (intergerToBeIncremented1 < 100) { + intergerToBeIncremented1++; + } + int intergerToBeIncremented20 = 0; + while (intergerToBeIncremented20 < 100) { + intergerToBeIncremented20++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + System.out.print("copy test end"); + } +} \ No newline at end of file diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage2.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage2.java new file mode 100644 index 00000000000..d338c25b369 --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_package/DuplicatedLinesInSamePackage2.java @@ -0,0 +1,90 @@ +/* + * Sonar, entreprise quality control tool. + * Copyright (C) 2007-2008 Hortis-GRC SA + * mailto:be_agile HAT hortis DOT ch + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_lines_within_package; + +public class DuplicatedLinesInSamePackage2 { + + public DuplicatedLinesInSamePackage2() { + } + + public void duplicated2MethodInSameClass3() { + System.out.print("copy test start"); + int intergerToBeIncremented1 = 0; + while (intergerToBeIncremented1 < 100) { + intergerToBeIncremented1++; + } + int intergerToBeIncremented20 = 0; + while (intergerToBeIncremented20 < 100) { + intergerToBeIncremented20++; + } + int intergerToBeIncremented8 = 0; + while (intergerToBeIncremented8 < 100) { + intergerToBeIncremented8++; + } + int intergerToBeIncremented9 = 0; + while (intergerToBeIncremented9 < 100) { + intergerToBeIncremented9++; + } + int intergerToBeIncremented10 = 0; + while (intergerToBeIncremented10 < 100) { + intergerToBeIncremented10++; + } + int intergerToBeIncremented60 = 0; + while (intergerToBeIncremented60 < 100) { + intergerToBeIncremented60++; + } + System.out.print("copy test end"); + } + + public void duplicatedMethodInSameClass1() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + int intergerToBeIncremented2 = 0; + while (intergerToBeIncremented2 < 100) { + intergerToBeIncremented2++; + } + // second + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + // vghgvhz + // bhjjh + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + +} \ No newline at end of file diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_same_class/DuplicatedLinesInSameClass.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_same_class/DuplicatedLinesInSameClass.java new file mode 100644 index 00000000000..3bf33bbbaa2 --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_lines_within_same_class/DuplicatedLinesInSameClass.java @@ -0,0 +1,89 @@ +/* + * Sonar, entreprise quality control tool. + * Copyright (C) 2007-2008 Hortis-GRC SA + * mailto:be_agile HAT hortis DOT ch + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_lines_within_same_class; + +public class DuplicatedLinesInSameClass { + + public DuplicatedLinesInSameClass() { + } + + public void duplicatedMethodInSameClass1() { + String temp = ""; + for (int i=0; i<10; i++){ + temp += "say something"+i; + } + for (int i=0; i<20; i++){ + temp += "say nothing"+i; + } + for (int i=0; i<30; i++){ + temp += "always say nothing"+i; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + + public void duplicatedMethodInSameClass2() { + String temp = ""; + for (int i=0; i<10; i++){ + temp += "say something"+i; + } + for (int i=0; i<20; i++){ + temp += "say nothing"+i; + } + for (int i=0; i<30; i++){ + temp += "always say nothing"+i; + } + for (int i=0; i<40; i++){ + temp += "really nothing to say "+i; + } + for (int i=0; i<50; i++){ + temp += "really really nothing to say "+i; + } + for (int i=0; i<60; i++){ + temp += ".. "+i; + } + for (int i=0; i<70; i++){ + temp += "you say something? "+i; + } + for (int i=0; i<80; i++){ + temp += "ah no..."+i; + } + for (int i=0; i<90; i++){ + temp += "bye"+i; + } + } + +} diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class1.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class1.java new file mode 100644 index 00000000000..250c3d6228d --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class1.java @@ -0,0 +1,60 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_same_lines_within_3_classes; + +public class Class1 { + + public void someMethod() { + System.out.println("Test"); + } + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + +} diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class2.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class2.java new file mode 100644 index 00000000000..494cbb9d43d --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class2.java @@ -0,0 +1,59 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_same_lines_within_3_classes; + +public class Class2 { + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + public void someOtherMethod() { + System.out.println("Test2"); + } +} diff --git a/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class3.java b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class3.java new file mode 100644 index 00000000000..a785723c3bc --- /dev/null +++ b/it/it-projects/duplications/file-duplications/src/main/java/duplicated_same_lines_within_3_classes/Class3.java @@ -0,0 +1,62 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2008-2011 SonarSource + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package duplicated_same_lines_within_3_classes; + +public class Class3 { + + private String test; + + public void duplicatedMethod() { + int intergerToBeIncremented = 0; + while (intergerToBeIncremented < 100) { + intergerToBeIncremented++; + } + System.out.println("test"); + int intergerToBeIncremented3 = 0; + while (intergerToBeIncremented3 < 100) { + intergerToBeIncremented3++; + } + System.out.println("test"); + int intergerToBeIncremented4 = 0; + while (intergerToBeIncremented4 < 100) { + intergerToBeIncremented4++; + } + System.out.println("test"); + int intergerToBeIncremented5 = 0; + while (intergerToBeIncremented5 < 100) { + intergerToBeIncremented5++; + } + System.out.println("test"); + int intergerToBeIncremented6 = 0; + while (intergerToBeIncremented6 < 100) { + intergerToBeIncremented6++; + } + System.out.println("test"); + int intergerToBeIncremented7 = 0; + while (intergerToBeIncremented7 < 100) { + intergerToBeIncremented7++; + } + } + + public String getTest() { + return test; + } + +} diff --git a/it/it-projects/exclusions/exclusions/sonar-project.properties b/it/it-projects/exclusions/exclusions/sonar-project.properties new file mode 100644 index 00000000000..8b26cec2224 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=exclusions +sonar.projectName=Exclusions +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.tests=src/test/xoo +sonar.language=xoo diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo new file mode 100644 index 00000000000..52d311f7e38 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo @@ -0,0 +1,10 @@ +public class ClassOnDefaultPackage { + + public ClassOnDefaultPackage(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo.measures new file mode 100644 index 00000000000..7bb5f438500 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/FileOnRootFolder.xoo.measures @@ -0,0 +1 @@ +ncloc:8 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo new file mode 100644 index 00000000000..be537077200 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo @@ -0,0 +1,32 @@ +package org.sonar.tests; + +public class ClassOne { + public void toto() throws Exception { + int i=0; + i++; + } + public String hello() { + return "hello"; + } + + protected void duplicatedMethod(int i) { + i++; + int j=10; + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + System.out.println("i=" + i); + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo.measures new file mode 100644 index 00000000000..7f28308edeb --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassOne.xoo.measures @@ -0,0 +1 @@ +ncloc:30 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo new file mode 100644 index 00000000000..6e7c3f7ba16 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo @@ -0,0 +1,66 @@ +package org.sonar.tests; + +/** + * JAVADOC + * ......... + */ +public class ClassToExclude { + String test = "foo"; + String test2 = "bar"; + String test3 = "toto"; + + public ClassToExclude(){ + String t; + if (true) + t = "sonar"; + } + + public static final String method1(String unused) { + if (true) { + return "foo"; + } + if (false) { + return "foooooo"; + } + String loooooooooooooooooooooooooooooooooooooooooooooongVar = "wantsViolations"; + return loooooooooooooooooooooooooooooooooooooooooooooongVar; + } + + protected void duplicatedMethod(int i) { + // commmmmmmments + // foo.............. + i++; + int j=10; + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + if (i==0) { + i=j + 10; + } + System.out.println("i=" + i); + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo.measures new file mode 100644 index 00000000000..9c54091bef9 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToExclude.xoo.measures @@ -0,0 +1 @@ +ncloc:59 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo new file mode 100644 index 00000000000..1db5746a7b5 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo @@ -0,0 +1,4 @@ +package org.sonar.tests; + +public class ClassToIgnoreGlobally { +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo.measures new file mode 100644 index 00000000000..1fa2c73b3d0 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassToIgnoreGlobally.xoo.measures @@ -0,0 +1 @@ +ncloc:3 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo new file mode 100644 index 00000000000..8d6db94e588 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo @@ -0,0 +1,26 @@ +package org.sonar.tests; + +import java.lang.String; + +/** + * THE JAVADOC HEADER + */ +public class ClassTwo { + + public ClassTwo(int i) { + // single comment + int j = i++; + myMethod(); + } + + private String myMethod() { + /* + comment + on + many + lines + */ + int toto = 34; // comment at end of line + return "hello"; + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo.measures new file mode 100644 index 00000000000..7da3c1fffef --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/ClassTwo.xoo.measures @@ -0,0 +1 @@ +ncloc:12 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo new file mode 100644 index 00000000000..206d72ba6ac --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo @@ -0,0 +1,13 @@ +package org.sonar.tests; + +import java.lang.String;//NOSONAR + +public class NoSonarComment { + + public NoSonarComment(int i) {//NOSONAR + i=3;// NOSONAR + i=4; // ERROR magic number, parameter assignment + String s="foo"; + if (s=="bar") return; // ERROR: compare Strings with equals() + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo.measures new file mode 100644 index 00000000000..69a10eb19d4 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/NoSonarComment.xoo.measures @@ -0,0 +1 @@ +ncloc:10 diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo new file mode 100644 index 00000000000..e91881c4ba5 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo @@ -0,0 +1,26 @@ +package org.sonar.tests.packageToExclude; + +import java.lang.String; + +/** + * THE JAVADOC HEADER + */ +public class ClassThree { + + public ClassThree(int i) { + // single comment + int j = i++; + myMethod(); + } + + private String myMethod() { + /* + comment + on + many + lines + */ + int toto = 34; // comment at end of line + return "hello"; + } +} diff --git a/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo.measures b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo.measures new file mode 100644 index 00000000000..7da3c1fffef --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/main/xoo/org/sonar/tests/packageToExclude/ClassThree.xoo.measures @@ -0,0 +1 @@ +ncloc:12 diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo new file mode 100644 index 00000000000..8c0967e496f --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo @@ -0,0 +1,11 @@ +package org.sonar.tests; + +import org.junit.Test; + +public class ClassOneTest { + + @Test + public void nothing() { + + } +} diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo.measures b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo.measures new file mode 100644 index 00000000000..80cbee5aba9 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassOneTest.xoo.measures @@ -0,0 +1 @@ +tests:1 diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo new file mode 100644 index 00000000000..712e2ec4a4a --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo @@ -0,0 +1,19 @@ +package org.sonar.tests; + +import org.junit.Test; +import static org.junit.Assert.fail; + +public class ClassToExcludeTest { + + @Test + public void increaseCodeCoverage() { + new ClassToExclude().duplicatedMethod(222); + } + + @Test + public void shouldFail() { + if (true) { + fail(); + } + } +} diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo.measures b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo.measures new file mode 100644 index 00000000000..7424f2634f5 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassToExcludeTest.xoo.measures @@ -0,0 +1 @@ +tests:2 diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo new file mode 100644 index 00000000000..1239ee5276c --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo @@ -0,0 +1,12 @@ +package org.sonar.tests; + +import org.junit.Test; + + +public class ClassTwoTest { + + @Test + public void increaseCodeCoverage() { + new ClassTwo(67); + } +} diff --git a/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo.measures b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo.measures new file mode 100644 index 00000000000..80cbee5aba9 --- /dev/null +++ b/it/it-projects/exclusions/exclusions/src/test/xoo/org/sonar/tests/ClassTwoTest.xoo.measures @@ -0,0 +1 @@ +tests:1 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/sonar-project.properties new file mode 100644 index 00000000000..a081a0e6342 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectName=Sub-module A1 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..7e61727a85a --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo @@ -0,0 +1,17 @@ +// EXTERMINATE-ALL-ISSUES +package com.sonar.it.samples.modules.a1; + +public class HelloA1 { + private int i; + private HelloA1() { + + } + + public void hello() { + System.out.println("hello" + " xoo"); + } + + protected String getHello() { + return "hello"; + } +} diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/sonar-project.properties new file mode 100644 index 00000000000..fcedab83843 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectName=Sub-module A2 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..4cf0ec94f03 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo @@ -0,0 +1,14 @@ +package com.sonar.it.samples.modules.a2; + +public class HelloA2 { + private int i; + private HelloA2() { + + } + + // MUTE-SONAR + public void hello() { + System.out.println("hello" + " xoo"); + } + // UNMUTE-SONAR +} diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_a/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_a/sonar-project.properties new file mode 100644 index 00000000000..7e6ca9074a4 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_a/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=module_a +sonar.projectName=Module A + +sonar.modules=module_a1,module_a2 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/sonar-project.properties new file mode 100644 index 00000000000..ca8404b7bd4 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectName=Sub-module B1 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo new file mode 100644 index 00000000000..b83c3af128c --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.b1; + +public class HelloB1 { + private int i; + private HelloB1() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures new file mode 100644 index 00000000000..3947d3bdbff --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 \ No newline at end of file diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/sonar-project.properties new file mode 100644 index 00000000000..e597dab4f33 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectName=Sub-module B2 diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo new file mode 100644 index 00000000000..20b8bb3876a --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.b2; + +public class HelloB2 { + private int i; + private HelloB2() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures new file mode 100644 index 00000000000..3947d3bdbff --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 \ No newline at end of file diff --git a/it/it-projects/exclusions/xoo-multi-modules/module_b/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/module_b/sonar-project.properties new file mode 100644 index 00000000000..21d69f769d3 --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/module_b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=module_b +sonar.projectName=Module B + +sonar.modules=module_b1,module_b2 diff --git a/it/it-projects/exclusions/xoo-multi-modules/sonar-project.properties b/it/it-projects/exclusions/xoo-multi-modules/sonar-project.properties new file mode 100644 index 00000000000..9ba45876d2b --- /dev/null +++ b/it/it-projects/exclusions/xoo-multi-modules/sonar-project.properties @@ -0,0 +1,12 @@ +# Root project information +sonar.projectKey=com.sonarsource.it.samples:multi-modules-exclusions +sonar.projectName=Sonar :: Integration Tests :: Multi-modules With Exclusions +sonar.projectVersion=1.0-SNAPSHOT + +sonar.language=xoo + +# Some properties that will be inherited by the modules +sonar.sources=src/main/xoo + +# List of the module identifiers +sonar.modules=module_a,module_b diff --git a/it/it-projects/maven/inclusions_apply_to_source_dirs/pom.xml b/it/it-projects/maven/inclusions_apply_to_source_dirs/pom.xml new file mode 100644 index 00000000000..7727b4aa943 --- /dev/null +++ b/it/it-projects/maven/inclusions_apply_to_source_dirs/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + com.sonarsource.it.samples + inclusions_apply_to_source_dirs + 1.0-SNAPSHOT + + + src/main/java/**/Hello2.java + + + + + junit + junit + 4.11 + test + + + + diff --git a/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello.java b/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello.java new file mode 100644 index 00000000000..224a668297d --- /dev/null +++ b/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello2.java b/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello2.java new file mode 100644 index 00000000000..4bb53827bb6 --- /dev/null +++ b/it/it-projects/maven/inclusions_apply_to_source_dirs/src/main/java/Hello2.java @@ -0,0 +1,5 @@ +public class Hello2 { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/jee/ear-module/pom.xml b/it/it-projects/maven/jee/ear-module/pom.xml new file mode 100644 index 00000000000..b432a49d0c2 --- /dev/null +++ b/it/it-projects/maven/jee/ear-module/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.sonarsource.it.samples.jee + parent + 1.0-SNAPSHOT + + ear-module + ear-module + ear + + + + ${project.groupId} + java-module + ${project.version} + jar + + + ${project.groupId} + ejb-module + ${project.version} + ejb + + + ${project.groupId} + web-module + ${project.version} + war + + + + + + + org.apache.maven.plugins + maven-ear-plugin + 2.3.1 + + + + ${project.groupId} + java-module + + + ${project.groupId} + ejb-module + + + ${project.groupId} + web-module + jee-sample + + + + + + + + \ No newline at end of file diff --git a/it/it-projects/maven/jee/ejb-module/pom.xml b/it/it-projects/maven/jee/ejb-module/pom.xml new file mode 100644 index 00000000000..c2aafad18d6 --- /dev/null +++ b/it/it-projects/maven/jee/ejb-module/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + com.sonarsource.it.samples.jee + parent + 1.0-SNAPSHOT + + ejb-module + ejb-module + ejb + + + + org.apache.geronimo.specs + geronimo-ejb_2.1_spec + 1.1 + provided + + + + ${project.groupId} + java-module + ${project.version} + runtime + + + \ No newline at end of file diff --git a/it/it-projects/maven/jee/ejb-module/src/main/java/org/sonar/tests/App.java b/it/it-projects/maven/jee/ejb-module/src/main/java/org/sonar/tests/App.java new file mode 100644 index 00000000000..ddc6d08253b --- /dev/null +++ b/it/it-projects/maven/jee/ejb-module/src/main/java/org/sonar/tests/App.java @@ -0,0 +1,13 @@ +package org.sonar.tests; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/it/it-projects/maven/jee/ejb-module/src/main/resources/META-INF/ejb-jar.xml b/it/it-projects/maven/jee/ejb-module/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 00000000000..f97427d26aa --- /dev/null +++ b/it/it-projects/maven/jee/ejb-module/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/it/it-projects/maven/jee/ejb-module/src/test/java/org/sonar/tests/AppTest.java b/it/it-projects/maven/jee/ejb-module/src/test/java/org/sonar/tests/AppTest.java new file mode 100644 index 00000000000..ce03155a801 --- /dev/null +++ b/it/it-projects/maven/jee/ejb-module/src/test/java/org/sonar/tests/AppTest.java @@ -0,0 +1,38 @@ +package org.sonar.tests; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/it/it-projects/maven/jee/java-module/pom.xml b/it/it-projects/maven/jee/java-module/pom.xml new file mode 100644 index 00000000000..44dd3ae593c --- /dev/null +++ b/it/it-projects/maven/jee/java-module/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + + com.sonarsource.it.samples.jee + parent + 1.0-SNAPSHOT + + java-module + java-module + + \ No newline at end of file diff --git a/it/it-projects/maven/jee/java-module/src/main/java/org/sonar/tests/App.java b/it/it-projects/maven/jee/java-module/src/main/java/org/sonar/tests/App.java new file mode 100644 index 00000000000..ddc6d08253b --- /dev/null +++ b/it/it-projects/maven/jee/java-module/src/main/java/org/sonar/tests/App.java @@ -0,0 +1,13 @@ +package org.sonar.tests; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/it/it-projects/maven/jee/java-module/src/test/java/org/sonar/tests/AppTest.java b/it/it-projects/maven/jee/java-module/src/test/java/org/sonar/tests/AppTest.java new file mode 100644 index 00000000000..ce03155a801 --- /dev/null +++ b/it/it-projects/maven/jee/java-module/src/test/java/org/sonar/tests/AppTest.java @@ -0,0 +1,38 @@ +package org.sonar.tests; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/it/it-projects/maven/jee/pom.xml b/it/it-projects/maven/jee/pom.xml new file mode 100644 index 00000000000..d5dfb916675 --- /dev/null +++ b/it/it-projects/maven/jee/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + com.sonarsource.it.samples.jee + parent + pom + 1.0-SNAPSHOT + JEE project + + + junit + junit + 4.8.2 + test + + + + java-module + ejb-module + web-module + ear-module + + \ No newline at end of file diff --git a/it/it-projects/maven/jee/web-module/pom.xml b/it/it-projects/maven/jee/web-module/pom.xml new file mode 100644 index 00000000000..9751d52f2b1 --- /dev/null +++ b/it/it-projects/maven/jee/web-module/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + com.sonarsource.it.samples.jee + parent + 1.0-SNAPSHOT + + web-module + war + web-module Maven Webapp + + + web-module + + + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet + jsp-api + 2.0 + provided + + + org.apache.geronimo.specs + geronimo-ejb_2.1_spec + 1.1 + provided + + + ${project.groupId} + java-module + ${project.version} + runtime + + + ${project.groupId} + ejb-module + ${project.version} + runtime + ejb + + + \ No newline at end of file diff --git a/it/it-projects/maven/jee/web-module/src/main/webapp/WEB-INF/web.xml b/it/it-projects/maven/jee/web-module/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..9f88c1f9632 --- /dev/null +++ b/it/it-projects/maven/jee/web-module/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,7 @@ + + + + Archetype Created Web Application + diff --git a/it/it-projects/maven/jee/web-module/src/main/webapp/index.jsp b/it/it-projects/maven/jee/web-module/src/main/webapp/index.jsp new file mode 100644 index 00000000000..c38169bb958 --- /dev/null +++ b/it/it-projects/maven/jee/web-module/src/main/webapp/index.jsp @@ -0,0 +1,5 @@ + + +

Hello World!

+ + diff --git a/it/it-projects/maven/maven-bad-parameters/module_a/pom.xml b/it/it-projects/maven/maven-bad-parameters/module_a/pom.xml new file mode 100644 index 00000000000..e74835222cc --- /dev/null +++ b/it/it-projects/maven/maven-bad-parameters/module_a/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + module_a + jar + Module A + + + com.sonarsource.it.samples.maven-bad-parameters + parent + 1.0-SNAPSHOT + + \ No newline at end of file diff --git a/it/it-projects/maven/maven-bad-parameters/module_a/src/main/java/org/sonar/tests/Hello.java b/it/it-projects/maven/maven-bad-parameters/module_a/src/main/java/org/sonar/tests/Hello.java new file mode 100644 index 00000000000..4d61fb482fd --- /dev/null +++ b/it/it-projects/maven/maven-bad-parameters/module_a/src/main/java/org/sonar/tests/Hello.java @@ -0,0 +1,10 @@ +package org.sonar.tests; + +public class Hello { + public static String s=null; + + public String toString() { + while(true) + s="hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/maven/maven-bad-parameters/module_b/pom.xml b/it/it-projects/maven/maven-bad-parameters/module_b/pom.xml new file mode 100644 index 00000000000..84194b9c290 --- /dev/null +++ b/it/it-projects/maven/maven-bad-parameters/module_b/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + module_b + jar + Module B + + + com.sonarsource.it.samples.maven-bad-parameters + parent + 1.0-SNAPSHOT + + \ No newline at end of file diff --git a/it/it-projects/maven/maven-bad-parameters/module_b/src/main/java/org/sonar/tests/Hello.java b/it/it-projects/maven/maven-bad-parameters/module_b/src/main/java/org/sonar/tests/Hello.java new file mode 100644 index 00000000000..4d61fb482fd --- /dev/null +++ b/it/it-projects/maven/maven-bad-parameters/module_b/src/main/java/org/sonar/tests/Hello.java @@ -0,0 +1,10 @@ +package org.sonar.tests; + +public class Hello { + public static String s=null; + + public String toString() { + while(true) + s="hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/maven/maven-bad-parameters/pom.xml b/it/it-projects/maven/maven-bad-parameters/pom.xml new file mode 100644 index 00000000000..a38b06c51b9 --- /dev/null +++ b/it/it-projects/maven/maven-bad-parameters/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + com.sonarsource.it.samples.maven-bad-parameters + parent + 1.0-SNAPSHOT + pom + Sonar tests - maven-bad-parameters + + module_a + module_b + + + + + + maven-pmd-plugin + + true + + true + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + org.codehaus.mojo + findbugs-maven-plugin + + true + + + + + + + + \ No newline at end of file diff --git a/it/it-projects/maven/maven-bad-sources-property/pom.xml b/it/it-projects/maven/maven-bad-sources-property/pom.xml new file mode 100644 index 00000000000..daab137db14 --- /dev/null +++ b/it/it-projects/maven/maven-bad-sources-property/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + com.sonarsource.it.samples + maven-bad-sources-property + 1.0-SNAPSHOT + + + src/main/java2 + + + + + junit + junit + 4.11 + test + + + + diff --git a/it/it-projects/maven/maven-bad-sources-property/src/main/java/Hello.java b/it/it-projects/maven/maven-bad-sources-property/src/main/java/Hello.java new file mode 100644 index 00000000000..224a668297d --- /dev/null +++ b/it/it-projects/maven/maven-bad-sources-property/src/main/java/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/maven-bad-tests-property/pom.xml b/it/it-projects/maven/maven-bad-tests-property/pom.xml new file mode 100644 index 00000000000..024b8505d0d --- /dev/null +++ b/it/it-projects/maven/maven-bad-tests-property/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + com.sonarsource.it.samples + maven-bad-tests-property + 1.0-SNAPSHOT + + + src/test/java2 + + + + + junit + junit + 4.11 + test + + + + diff --git a/it/it-projects/maven/maven-bad-tests-property/src/main/java/Hello.java b/it/it-projects/maven/maven-bad-tests-property/src/main/java/Hello.java new file mode 100644 index 00000000000..224a668297d --- /dev/null +++ b/it/it-projects/maven/maven-bad-tests-property/src/main/java/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/maven-bad-tests-property/src/test/java/HelloTest.java b/it/it-projects/maven/maven-bad-tests-property/src/test/java/HelloTest.java new file mode 100644 index 00000000000..ffa7ea2109e --- /dev/null +++ b/it/it-projects/maven/maven-bad-tests-property/src/test/java/HelloTest.java @@ -0,0 +1,3 @@ +public class HelloTest { + +} diff --git a/it/it-projects/maven/maven-extensions/pom.xml b/it/it-projects/maven/maven-extensions/pom.xml new file mode 100644 index 00000000000..1634b63e61b --- /dev/null +++ b/it/it-projects/maven/maven-extensions/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + com.sonarsource.it.samples + maven-extensions + 1.0-SNAPSHOT + jar + Sonar tests - maven extensions + http://jira.codehaus.org/browse/SONAR-222 + + + + org.jvnet.wagon-svn + wagon-svn + 1.9 + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + \ No newline at end of file diff --git a/it/it-projects/maven/maven-extensions/src/main/java/org/sonar/tests/mavenExtensions/Hello.java b/it/it-projects/maven/maven-extensions/src/main/java/org/sonar/tests/mavenExtensions/Hello.java new file mode 100644 index 00000000000..5967512fb80 --- /dev/null +++ b/it/it-projects/maven/maven-extensions/src/main/java/org/sonar/tests/mavenExtensions/Hello.java @@ -0,0 +1,13 @@ +package org.sonar.tests.mavenExtensions; + +public class Hello { + private String hello; + + public Hello(String s){ + this.hello = s; + } + + public String say() { + return hello; + } +} diff --git a/it/it-projects/maven/maven-only-test-dir/pom.xml b/it/it-projects/maven/maven-only-test-dir/pom.xml new file mode 100644 index 00000000000..e1b343f6b53 --- /dev/null +++ b/it/it-projects/maven/maven-only-test-dir/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + com.sonarsource.it.samples + maven-only-test-dir + 1.0-SNAPSHOT + + + + junit + junit + 4.11 + test + + + + diff --git a/it/it-projects/maven/maven-only-test-dir/src/test/java/HelloTest.java b/it/it-projects/maven/maven-only-test-dir/src/test/java/HelloTest.java new file mode 100644 index 00000000000..bef477b4c1c --- /dev/null +++ b/it/it-projects/maven/maven-only-test-dir/src/test/java/HelloTest.java @@ -0,0 +1,10 @@ +import org.junit.Test; + +import static org.junit.Assert.assertNotSame; + +public class HelloTest { + @Test + public void hiho() { + assertNotSame("hi", "ho"); + } +} diff --git a/it/it-projects/maven/maven-override-sources/pom.xml b/it/it-projects/maven/maven-override-sources/pom.xml new file mode 100644 index 00000000000..a8fbbac3cde --- /dev/null +++ b/it/it-projects/maven/maven-override-sources/pom.xml @@ -0,0 +1,22 @@ + + 4.0.0 + + com.sonarsource.it.samples + maven-override-sources + 1.0-SNAPSHOT + + + src/main/java2 + + + + + junit + junit + 4.11 + test + + + + diff --git a/it/it-projects/maven/maven-override-sources/src/main/java/Hello.java b/it/it-projects/maven/maven-override-sources/src/main/java/Hello.java new file mode 100644 index 00000000000..224a668297d --- /dev/null +++ b/it/it-projects/maven/maven-override-sources/src/main/java/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/maven-override-sources/src/main/java2/Hello2.java b/it/it-projects/maven/maven-override-sources/src/main/java2/Hello2.java new file mode 100644 index 00000000000..4bb53827bb6 --- /dev/null +++ b/it/it-projects/maven/maven-override-sources/src/main/java2/Hello2.java @@ -0,0 +1,5 @@ +public class Hello2 { + public String hello() { + return "hello"; + } +} diff --git a/it/it-projects/maven/modules-declaration/module_a/pom.xml b/it/it-projects/maven/modules-declaration/module_a/pom.xml new file mode 100644 index 00000000000..73191c11f29 --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_a/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + + + module_a + + Module A + + diff --git a/it/it-projects/maven/modules-declaration/module_a/src/main/java/HelloA.java b/it/it-projects/maven/modules-declaration/module_a/src/main/java/HelloA.java new file mode 100644 index 00000000000..ac7c3f94636 --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_a/src/main/java/HelloA.java @@ -0,0 +1,2 @@ +public class HelloA { +} diff --git a/it/it-projects/maven/modules-declaration/module_b/pom.xml b/it/it-projects/maven/modules-declaration/module_b/pom.xml new file mode 100644 index 00000000000..b31c90d4731 --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_b/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + + + module_b + + Module B + + diff --git a/it/it-projects/maven/modules-declaration/module_b/src/main/java/HelloB.java b/it/it-projects/maven/modules-declaration/module_b/src/main/java/HelloB.java new file mode 100644 index 00000000000..4ee68d3ed39 --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_b/src/main/java/HelloB.java @@ -0,0 +1,2 @@ +public class HelloB { +} diff --git a/it/it-projects/maven/modules-declaration/module_c/pom.xml b/it/it-projects/maven/modules-declaration/module_c/pom.xml new file mode 100644 index 00000000000..ab027ada34b --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_c/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + + + module_c + + Module C + + diff --git a/it/it-projects/maven/modules-declaration/module_c/src/main/java/HelloC.java b/it/it-projects/maven/modules-declaration/module_c/src/main/java/HelloC.java new file mode 100644 index 00000000000..242abb3a77f --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_c/src/main/java/HelloC.java @@ -0,0 +1,2 @@ +public class HelloC { +} diff --git a/it/it-projects/maven/modules-declaration/module_d/mypom.xml b/it/it-projects/maven/modules-declaration/module_d/mypom.xml new file mode 100644 index 00000000000..13a86363e0e --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_d/mypom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + + + module_d + + Module D + + diff --git a/it/it-projects/maven/modules-declaration/module_d/src/main/java/HelloD.java b/it/it-projects/maven/modules-declaration/module_d/src/main/java/HelloD.java new file mode 100644 index 00000000000..b01a5d8d3ba --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_d/src/main/java/HelloD.java @@ -0,0 +1,2 @@ +public class HelloD { +} diff --git a/it/it-projects/maven/modules-declaration/module_e/mypom b/it/it-projects/maven/modules-declaration/module_e/mypom new file mode 100644 index 00000000000..de92d8431ec --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_e/mypom @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + + + module_e + + Module E + + diff --git a/it/it-projects/maven/modules-declaration/module_e/src/main/java/HelloE.java b/it/it-projects/maven/modules-declaration/module_e/src/main/java/HelloE.java new file mode 100644 index 00000000000..041f6e8984b --- /dev/null +++ b/it/it-projects/maven/modules-declaration/module_e/src/main/java/HelloE.java @@ -0,0 +1,2 @@ +public class HelloE { +} diff --git a/it/it-projects/maven/modules-declaration/pom.xml b/it/it-projects/maven/modules-declaration/pom.xml new file mode 100644 index 00000000000..0d4eedf4e96 --- /dev/null +++ b/it/it-projects/maven/modules-declaration/pom.xml @@ -0,0 +1,27 @@ + + 4.0.0 + + org.sonar.tests.modules-declaration + root + 1.0-SNAPSHOT + pom + + Root + + + + module_a + + + module_b/ + + + module_c/pom.xml + + + module_d/mypom.xml + module_e/mypom + + + diff --git a/it/it-projects/maven/modules-order/README.txt b/it/it-projects/maven/modules-order/README.txt new file mode 100644 index 00000000000..0401f824428 --- /dev/null +++ b/it/it-projects/maven/modules-order/README.txt @@ -0,0 +1,5 @@ +Order of modules during build would look as following : +parent +module_a +module_b +root diff --git a/it/it-projects/maven/modules-order/module_a/pom.xml b/it/it-projects/maven/modules-order/module_a/pom.xml new file mode 100644 index 00000000000..9fe82af9acb --- /dev/null +++ b/it/it-projects/maven/modules-order/module_a/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-order + parent + 1.0-SNAPSHOT + ../parent + + + module_a + + Module A + diff --git a/it/it-projects/maven/modules-order/module_a/src/main/java/HelloA.java b/it/it-projects/maven/modules-order/module_a/src/main/java/HelloA.java new file mode 100644 index 00000000000..ac7c3f94636 --- /dev/null +++ b/it/it-projects/maven/modules-order/module_a/src/main/java/HelloA.java @@ -0,0 +1,2 @@ +public class HelloA { +} diff --git a/it/it-projects/maven/modules-order/module_b/pom.xml b/it/it-projects/maven/modules-order/module_b/pom.xml new file mode 100644 index 00000000000..00883638007 --- /dev/null +++ b/it/it-projects/maven/modules-order/module_b/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + + + org.sonar.tests.modules-order + parent + 1.0-SNAPSHOT + ../parent + + + module_b + + Module B + diff --git a/it/it-projects/maven/modules-order/module_b/src/main/java/HelloB.java b/it/it-projects/maven/modules-order/module_b/src/main/java/HelloB.java new file mode 100644 index 00000000000..4ee68d3ed39 --- /dev/null +++ b/it/it-projects/maven/modules-order/module_b/src/main/java/HelloB.java @@ -0,0 +1,2 @@ +public class HelloB { +} diff --git a/it/it-projects/maven/modules-order/parent/pom.xml b/it/it-projects/maven/modules-order/parent/pom.xml new file mode 100644 index 00000000000..54873b339db --- /dev/null +++ b/it/it-projects/maven/modules-order/parent/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + org.sonar.tests.modules-order + parent + 1.0-SNAPSHOT + pom + + Parent + diff --git a/it/it-projects/maven/modules-order/pom.xml b/it/it-projects/maven/modules-order/pom.xml new file mode 100644 index 00000000000..4b646b849c8 --- /dev/null +++ b/it/it-projects/maven/modules-order/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + + org.sonar.tests.modules-order + root + 1.0-SNAPSHOT + pom + + Sonar tests - modules order + + + parent + module_a + module_b + + diff --git a/it/it-projects/maven/project-with-module-without-sources/pom.xml b/it/it-projects/maven/project-with-module-without-sources/pom.xml new file mode 100644 index 00000000000..afb83f459ea --- /dev/null +++ b/it/it-projects/maven/project-with-module-without-sources/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.sonarsource.it.samples.project-with-module-without-sources + parent + 1.0-SNAPSHOT + pom + + + with-sources + without-sources + + diff --git a/it/it-projects/maven/project-with-module-without-sources/with-sources/pom.xml b/it/it-projects/maven/project-with-module-without-sources/with-sources/pom.xml new file mode 100644 index 00000000000..393f9202bd7 --- /dev/null +++ b/it/it-projects/maven/project-with-module-without-sources/with-sources/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + + com.sonarsource.it.samples.project-with-module-without-sources + parent + 1.0-SNAPSHOT + + + with-sources + 1.0-SNAPSHOT + Module with sources + + diff --git a/it/it-projects/maven/project-with-module-without-sources/with-sources/src/main/java/sample/Sample.java b/it/it-projects/maven/project-with-module-without-sources/with-sources/src/main/java/sample/Sample.java new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/maven/project-with-module-without-sources/with-sources/src/main/java/sample/Sample.java @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/maven/project-with-module-without-sources/without-sources/pom.xml b/it/it-projects/maven/project-with-module-without-sources/without-sources/pom.xml new file mode 100644 index 00000000000..cdd2f0096a1 --- /dev/null +++ b/it/it-projects/maven/project-with-module-without-sources/without-sources/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + + com.sonarsource.it.samples.project-with-module-without-sources + parent + 1.0-SNAPSHOT + + + without-sources + 1.0-SNAPSHOT + Module without sources + + diff --git a/it/it-projects/maven/shade-with-dependency-reduced-pom/child1/pom.xml b/it/it-projects/maven/shade-with-dependency-reduced-pom/child1/pom.xml new file mode 100644 index 00000000000..2c0049a65de --- /dev/null +++ b/it/it-projects/maven/shade-with-dependency-reduced-pom/child1/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + + + + org.foo.bar + parent + 1.0-SNAPSHOT + + child1 + + diff --git a/it/it-projects/maven/shade-with-dependency-reduced-pom/child2/pom.xml b/it/it-projects/maven/shade-with-dependency-reduced-pom/child2/pom.xml new file mode 100644 index 00000000000..a25279f1f8b --- /dev/null +++ b/it/it-projects/maven/shade-with-dependency-reduced-pom/child2/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + + + org.foo.bar + parent + 1.0-SNAPSHOT + + + child2 + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.7.1 + + + + false + + true + + package + + shade + + + + + + + + + + + org.foo.bar + child1 + 1.0-SNAPSHOT + + + + + diff --git a/it/it-projects/maven/shade-with-dependency-reduced-pom/pom.xml b/it/it-projects/maven/shade-with-dependency-reduced-pom/pom.xml new file mode 100644 index 00000000000..af12af572e3 --- /dev/null +++ b/it/it-projects/maven/shade-with-dependency-reduced-pom/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + + org.foo.bar + parent + 1.0-SNAPSHOT + pom + + + child1 + child2 + + + + + + diff --git a/it/it-projects/shared/multi-modules-sample/module_a/module_a1/pom.xml b/it/it-projects/shared/multi-modules-sample/module_a/module_a1/pom.xml new file mode 100644 index 00000000000..b514c6ee0c7 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_a/module_a1/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + module_a1 + jar + Sub-module A1 + + + com.sonarsource.it.samples + module_a + 1.0-SNAPSHOT + + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_a/module_a1/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java b/it/it-projects/shared/multi-modules-sample/module_a/module_a1/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java new file mode 100644 index 00000000000..7471eaf64a9 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_a/module_a1/src/main/java/com/sonar/it/samples/modules/a1/HelloA1.java @@ -0,0 +1,16 @@ +package com.sonar.it.samples.modules.a1; + +public class HelloA1 { + private int i; + private HelloA1() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } + + protected String getHello() { + return "hello"; + } +} \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_a/module_a2/pom.xml b/it/it-projects/shared/multi-modules-sample/module_a/module_a2/pom.xml new file mode 100644 index 00000000000..c9bc3ce46db --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_a/module_a2/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + module_a2 + jar + Sub-module A2 + + + com.sonarsource.it.samples + module_a + 1.0-SNAPSHOT + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_a/module_a2/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java b/it/it-projects/shared/multi-modules-sample/module_a/module_a2/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java new file mode 100644 index 00000000000..3d767d9500a --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_a/module_a2/src/main/java/com/sonar/it/samples/modules/a2/HelloA2.java @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.a2; + +public class HelloA2 { + private int i; + private HelloA2() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_a/pom.xml b/it/it-projects/shared/multi-modules-sample/module_a/pom.xml new file mode 100644 index 00000000000..793fbcf8420 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_a/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + module_a + pom + Module A + + + com.sonarsource.it.samples + multi-modules-sample + 1.0-SNAPSHOT + + + module_a1 + module_a2 + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_b/module_b1/pom.xml b/it/it-projects/shared/multi-modules-sample/module_b/module_b1/pom.xml new file mode 100644 index 00000000000..dc2cc52447f --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_b/module_b1/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + module_b1 + jar + Sub-module B1 + + + com.sonarsource.it.samples + module_b + 1.0-SNAPSHOT + + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_b/module_b1/src/main/java/com/sonar/it/samples/modules/b1/HelloB1.java b/it/it-projects/shared/multi-modules-sample/module_b/module_b1/src/main/java/com/sonar/it/samples/modules/b1/HelloB1.java new file mode 100644 index 00000000000..b83c3af128c --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_b/module_b1/src/main/java/com/sonar/it/samples/modules/b1/HelloB1.java @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.b1; + +public class HelloB1 { + private int i; + private HelloB1() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_b/module_b2/pom.xml b/it/it-projects/shared/multi-modules-sample/module_b/module_b2/pom.xml new file mode 100644 index 00000000000..9ed7337e659 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_b/module_b2/pom.xml @@ -0,0 +1,14 @@ + + 4.0.0 + module_b2 + jar + Sub-module B2 + + + com.sonarsource.it.samples + module_b + 1.0-SNAPSHOT + + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_b/module_b2/src/main/java/com/sonar/it/samples/modules/b2/HelloB2.java b/it/it-projects/shared/multi-modules-sample/module_b/module_b2/src/main/java/com/sonar/it/samples/modules/b2/HelloB2.java new file mode 100644 index 00000000000..20b8bb3876a --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_b/module_b2/src/main/java/com/sonar/it/samples/modules/b2/HelloB2.java @@ -0,0 +1,12 @@ +package com.sonar.it.samples.modules.b2; + +public class HelloB2 { + private int i; + private HelloB2() { + + } + + public void hello() { + System.out.println("hello" + " world"); + } +} \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/module_b/pom.xml b/it/it-projects/shared/multi-modules-sample/module_b/pom.xml new file mode 100644 index 00000000000..2259da3ef66 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/module_b/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + module_b + pom + Module B + + + com.sonarsource.it.samples + multi-modules-sample + 1.0-SNAPSHOT + + + module_b1 + module_b2 + + \ No newline at end of file diff --git a/it/it-projects/shared/multi-modules-sample/pom.xml b/it/it-projects/shared/multi-modules-sample/pom.xml new file mode 100644 index 00000000000..21db9df608a --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/pom.xml @@ -0,0 +1,28 @@ + + 4.0.0 + com.sonarsource.it.samples + multi-modules-sample + 1.0-SNAPSHOT + pom + Sonar :: Integration Tests :: Multi-modules Sample + + + module_a + module_b + + + + + junit + junit + 3.8.1 + test + + + + + + java + + diff --git a/it/it-projects/shared/multi-modules-sample/sonar-project.properties b/it/it-projects/shared/multi-modules-sample/sonar-project.properties new file mode 100644 index 00000000000..9e2528c95b9 --- /dev/null +++ b/it/it-projects/shared/multi-modules-sample/sonar-project.properties @@ -0,0 +1,16 @@ +sonar.projectKey=multi-modules-sample +sonar.projectName=Multi-modules Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/java +sonar.language=java + +sonar.modules=module_a,module_b +module_a.sonar.projectName=Module A +module_a.sonar.modules=module_a1,module_a2 +module_a.module_a1.sonar.projectName=Sub-module A1 +module_a.module_a2.sonar.projectName=Sub-module A2 +module_b.sonar.projectName=Module B +module_b.sonar.modules=module_b1,module_b2 +module_b.module_b1.sonar.projectName=Sub-module B1 +module_b.module_b2.sonar.projectName=Sub-module B2 + diff --git a/it/it-projects/shared/xoo-history-v1/sonar-project.properties b/it/it-projects/shared/xoo-history-v1/sonar-project.properties new file mode 100644 index 00000000000..e01f062e51b --- /dev/null +++ b/it/it-projects/shared/xoo-history-v1/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo new file mode 100644 index 00000000000..2b0288fc971 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo.measures b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/ClassToModify.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo new file mode 100644 index 00000000000..2b0288fc971 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo.measures b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/shared/xoo-history-v1/src/main/xoo/sample/UnchangedClass.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/shared/xoo-history-v2/sonar-project.properties b/it/it-projects/shared/xoo-history-v2/sonar-project.properties new file mode 100644 index 00000000000..e01f062e51b --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo new file mode 100644 index 00000000000..b0fd1087030 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassAdded { + + public ClassAdded(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures new file mode 100644 index 00000000000..66ba834e1ef --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassAdded.xoo.measures @@ -0,0 +1,3 @@ +ncloc:12 +classes:1 + diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo new file mode 100644 index 00000000000..393111bbab0 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo @@ -0,0 +1,16 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + public String addedMethod() { + return "This method was added in v2"; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures new file mode 100644 index 00000000000..71d60758637 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/ClassToModify.xoo.measures @@ -0,0 +1,3 @@ +ncloc:16 +classes:1 + diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo new file mode 100644 index 00000000000..2b0288fc971 --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo @@ -0,0 +1,12 @@ +package sample; + +public class ClassToModify { + + public ClassToModify(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures new file mode 100644 index 00000000000..7812e4167fb --- /dev/null +++ b/it/it-projects/shared/xoo-history-v2/src/main/xoo/sample/UnchangedClass.xoo.measures @@ -0,0 +1,2 @@ +ncloc:12 +classes:1 diff --git a/it/it-projects/shared/xoo-sample-with-tests/sonar-project.properties b/it/it-projects/shared/xoo-sample-with-tests/sonar-project.properties new file mode 100644 index 00000000000..0f2415d0320 --- /dev/null +++ b/it/it-projects/shared/xoo-sample-with-tests/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=sample-with-tests +sonar.projectName=Sample with tests +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.tests=src/test/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo b/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo.measures new file mode 100644 index 00000000000..c427258db4e --- /dev/null +++ b/it/it-projects/shared/xoo-sample-with-tests/src/main/xoo/sample/Sample.xoo.measures @@ -0,0 +1,5 @@ +ncloc:13 +#Used by dashboard/widgets tests +complexity_in_classes:3 +classes:1 +comment_lines:0 diff --git a/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo b/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo new file mode 100644 index 00000000000..1392fc64ebf --- /dev/null +++ b/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo @@ -0,0 +1,21 @@ +package sample; + +import org.hamcrest.CoreMatchers; +import org.junit.Test; + +import static org.junit.Assert.assertThat; + +public class SampleTest { + + @Test + public void should_return_i() { + Sample sample = new Sample(1); + assertThat(sample.getI(), CoreMatchers.is(1)); + } + + @Test + public void should_return_to_string() { + assertThat(new Sample(1).toString(), CoreMatchers.is("1")); + } + +} diff --git a/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo.measures b/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo.measures new file mode 100644 index 00000000000..5a3f14e5962 --- /dev/null +++ b/it/it-projects/shared/xoo-sample-with-tests/src/test/xoo/sample/SampleTest.xoo.measures @@ -0,0 +1,6 @@ +ncloc:22 +tests:2 +test_execution_time:1 +skipped_tests:0 +test_errors:0 +test_failures:0 \ No newline at end of file diff --git a/it/it-projects/shared/xoo-two-letters-named/sonar-project.properties b/it/it-projects/shared/xoo-two-letters-named/sonar-project.properties new file mode 100644 index 00000000000..c0ebb39302f --- /dev/null +++ b/it/it-projects/shared/xoo-two-letters-named/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=xo +sonar.projectName=xo +sonar.projectVersion=1.0-SNAPSHOT +sonar.sources=src/main/xoo +sonar.language=xoo \ No newline at end of file diff --git a/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo b/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo new file mode 100644 index 00000000000..b1210973dd9 --- /dev/null +++ b/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo @@ -0,0 +1,12 @@ +package sample; + +public class Sample { + + public Sample(int i) { + int j = i++; + } + + private String myMethod() { + return "hello"; + } +} diff --git a/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo.measures new file mode 100644 index 00000000000..56acf8077d6 --- /dev/null +++ b/it/it-projects/shared/xoo-two-letters-named/src/main/xoo/sample/Sample.xoo.measures @@ -0,0 +1 @@ +ncloc:9 -- cgit v1.2.3