From: Julien HENRY Date: Fri, 29 Jun 2018 13:32:56 +0000 (+0200) Subject: Replace SonarJava by SonarJS in ITs to support SQ 7.3 X-Git-Tag: 3.3.0.1492~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=33e455cf4f0128dceaa1c72be20afcfb978bf2e2;p=sonar-scanner-cli.git Replace SonarJava by SonarJS in ITs to support SQ 7.3 --- diff --git a/it/projects/bad-source-dirs/src/Hello.java b/it/projects/bad-source-dirs/src/Hello.java deleted file mode 100644 index 1291f40..0000000 --- a/it/projects/bad-source-dirs/src/Hello.java +++ /dev/null @@ -1,7 +0,0 @@ -public class Hello { - - public void hello() { - int i=356; - if (true) i=5658; - } -} diff --git a/it/projects/bad-source-dirs/src/Hello.js b/it/projects/bad-source-dirs/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/bad-source-dirs/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/basedir-with-source/Hello.java b/it/projects/basedir-with-source/Hello.java deleted file mode 100644 index 1291f40..0000000 --- a/it/projects/basedir-with-source/Hello.java +++ /dev/null @@ -1,7 +0,0 @@ -public class Hello { - - public void hello() { - int i=356; - if (true) i=5658; - } -} diff --git a/it/projects/basedir-with-source/Hello.js b/it/projects/basedir-with-source/Hello.js new file mode 100644 index 0000000..dffa936 --- /dev/null +++ b/it/projects/basedir-with-source/Hello.js @@ -0,0 +1,4 @@ +function hello() { + let i=356; + if (true) i=5658; +} diff --git a/it/projects/java-bytecode/build.xml b/it/projects/java-bytecode/build.xml deleted file mode 100644 index d24c2b8..0000000 --- a/it/projects/java-bytecode/build.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/it/projects/java-bytecode/build/classes/HasFindbugsViolation.class b/it/projects/java-bytecode/build/classes/HasFindbugsViolation.class deleted file mode 100644 index f482325..0000000 Binary files a/it/projects/java-bytecode/build/classes/HasFindbugsViolation.class and /dev/null differ diff --git a/it/projects/java-bytecode/lib/deprecated.jar b/it/projects/java-bytecode/lib/deprecated.jar deleted file mode 100644 index 65e3be9..0000000 Binary files a/it/projects/java-bytecode/lib/deprecated.jar and /dev/null differ diff --git a/it/projects/java-bytecode/sonar-project.properties b/it/projects/java-bytecode/sonar-project.properties deleted file mode 100644 index 2c6dcdf..0000000 --- a/it/projects/java-bytecode/sonar-project.properties +++ /dev/null @@ -1,8 +0,0 @@ -# Note that the format of project key is still groupId:artifactId in order to support test with sonar 2.6. -sonar.projectKey=java:bytecode -sonar.projectName=Java Bytecode Sample -sonar.projectVersion=1.0 - -sonar.sources=src -sonar.java.binaries=build/classes -sonar.java.libraries=lib/*.jar diff --git a/it/projects/java-bytecode/src/HasFindbugsViolation.java b/it/projects/java-bytecode/src/HasFindbugsViolation.java deleted file mode 100644 index c68f54f..0000000 --- a/it/projects/java-bytecode/src/HasFindbugsViolation.java +++ /dev/null @@ -1,13 +0,0 @@ -public class HasFindbugsViolation { - - private String field; - - public void use() { - new DeprecatedExample().deprecatedMethod(); // violation of squid rule: CallToDeprecatedMethod - System.exit(33); // violation on findbugs rule: DM_EXIT - } - - public void useFieldForLcom4() { - System.out.println(field); - } -} diff --git a/it/projects/java-sample-no-properties/src/basic/Hello.java b/it/projects/java-sample-no-properties/src/basic/Hello.java deleted file mode 100644 index b9db5a0..0000000 --- a/it/projects/java-sample-no-properties/src/basic/Hello.java +++ /dev/null @@ -1,9 +0,0 @@ -package basic; - -public class Hello { - - public void hello() { - int i=356; - if (true) i=5658; - } -} diff --git a/it/projects/java-sample-no-properties/src/basic/World.java b/it/projects/java-sample-no-properties/src/basic/World.java deleted file mode 100644 index c65d91c..0000000 --- a/it/projects/java-sample-no-properties/src/basic/World.java +++ /dev/null @@ -1,8 +0,0 @@ -package basic; - -public final class World { - - public void world() { - System.out.println("hello world"); - } -} diff --git a/it/projects/java-sample/sonar-project.properties b/it/projects/java-sample/sonar-project.properties deleted file mode 100644 index 0414efd..0000000 --- a/it/projects/java-sample/sonar-project.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Note that the format of project key is still groupId:artifactId in order to support test with sonar 2.6. -sonar.projectKey=java:sample -sonar.projectName=Java Sample, with comma -sonar.projectDescription=This is a Java sample -sonar.projectVersion=1.2.3 - -sonar.sources=src diff --git a/it/projects/java-sample/src/basic/Hello.java b/it/projects/java-sample/src/basic/Hello.java deleted file mode 100644 index b9db5a0..0000000 --- a/it/projects/java-sample/src/basic/Hello.java +++ /dev/null @@ -1,9 +0,0 @@ -package basic; - -public class Hello { - - public void hello() { - int i=356; - if (true) i=5658; - } -} diff --git a/it/projects/java-sample/src/basic/World.java b/it/projects/java-sample/src/basic/World.java deleted file mode 100644 index c65d91c..0000000 --- a/it/projects/java-sample/src/basic/World.java +++ /dev/null @@ -1,8 +0,0 @@ -package basic; - -public final class World { - - public void world() { - System.out.println("hello world"); - } -} diff --git a/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.java b/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.js b/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.java b/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.js b/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.java b/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.js b/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.java b/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.js b/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.java b/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.js b/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.java b/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.js b/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.java b/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.js b/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.java b/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.js b/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.java b/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.js b/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.java b/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.js b/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.java b/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.js b/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.java b/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.js b/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/multi-language/sonar-project.properties b/it/projects/multi-module/multi-language/sonar-project.properties deleted file mode 100644 index 3598e57..0000000 --- a/it/projects/multi-module/multi-language/sonar-project.properties +++ /dev/null @@ -1,14 +0,0 @@ -sonar.projectKey=multi-language -sonar.projectName=Simplest multi-language project -sonar.projectVersion=1.2.3 - - -sonar.modules=java-module,js-module - -java-module.sonar.language=java -java-module.sonar.projectBaseDir=. -java-module.sonar.sources=src/main/java - -js-module.sonar.language=js -js-module.sonar.projectBaseDir=. -js-module.sonar.sources=src/main/js diff --git a/it/projects/multi-module/multi-language/src/main/java/Hello.java b/it/projects/multi-module/multi-language/src/main/java/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/multi-language/src/main/java/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/multi-language/src/main/js/Hello.js b/it/projects/multi-module/multi-language/src/main/js/Hello.js deleted file mode 100644 index 2096104..0000000 --- a/it/projects/multi-module/multi-language/src/main/js/Hello.js +++ /dev/null @@ -1,3 +0,0 @@ -function hello() { - alert("Hello World"); -} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.java b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.js b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.java b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.js b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/src/placeholder.txt b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/src/placeholder.txt index 1a5bdeb..816adb4 100644 --- a/it/projects/multi-module/simplest/simplest-with-props-on-each-module/src/placeholder.txt +++ b/it/projects/multi-module/simplest/simplest-with-props-on-each-module/src/placeholder.txt @@ -1 +1 @@ -The root module contains a src folder but it will not be analysed (SONARPLUGINS-2295) and a warning will be displayed. \ No newline at end of file +The root module contains a src folder \ No newline at end of file diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.java b/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.js b/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.java b/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.js b/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/override-working-dir/src/Hello.java b/it/projects/override-working-dir/src/Hello.java deleted file mode 100644 index 1291f40..0000000 --- a/it/projects/override-working-dir/src/Hello.java +++ /dev/null @@ -1,7 +0,0 @@ -public class Hello { - - public void hello() { - int i=356; - if (true) i=5658; - } -} diff --git a/it/projects/override-working-dir/src/Hello.js b/it/projects/override-working-dir/src/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/override-working-dir/src/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/simple-sample-no-properties/src/basic/Hello.js b/it/projects/simple-sample-no-properties/src/basic/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/simple-sample-no-properties/src/basic/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/simple-sample-no-properties/src/basic/World.js b/it/projects/simple-sample-no-properties/src/basic/World.js new file mode 100644 index 0000000..1ea849a --- /dev/null +++ b/it/projects/simple-sample-no-properties/src/basic/World.js @@ -0,0 +1,2 @@ +function world() { +} diff --git a/it/projects/simple-sample/sonar-project.properties b/it/projects/simple-sample/sonar-project.properties new file mode 100644 index 0000000..38481b7 --- /dev/null +++ b/it/projects/simple-sample/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=sample +sonar.projectName=Sample, with comma +sonar.projectDescription=This is a sample +sonar.projectVersion=1.2.3 + +sonar.sources=src diff --git a/it/projects/simple-sample/src/basic/Hello.js b/it/projects/simple-sample/src/basic/Hello.js new file mode 100644 index 0000000..fd35455 --- /dev/null +++ b/it/projects/simple-sample/src/basic/Hello.js @@ -0,0 +1,2 @@ +function hello() { +} diff --git a/it/projects/simple-sample/src/basic/World.js b/it/projects/simple-sample/src/basic/World.js new file mode 100644 index 0000000..1ea849a --- /dev/null +++ b/it/projects/simple-sample/src/basic/World.js @@ -0,0 +1,2 @@ +function world() { +} diff --git a/it/projects/using-deprecated-props/build/Hello.class b/it/projects/using-deprecated-props/build/Hello.class deleted file mode 100644 index 48df723..0000000 Binary files a/it/projects/using-deprecated-props/build/Hello.class and /dev/null differ diff --git a/it/projects/using-deprecated-props/lib/deprecated.jar b/it/projects/using-deprecated-props/lib/deprecated.jar deleted file mode 100644 index 65e3be9..0000000 Binary files a/it/projects/using-deprecated-props/lib/deprecated.jar and /dev/null differ diff --git a/it/projects/using-deprecated-props/sonar-project.properties b/it/projects/using-deprecated-props/sonar-project.properties deleted file mode 100644 index 628eaf7..0000000 --- a/it/projects/using-deprecated-props/sonar-project.properties +++ /dev/null @@ -1,8 +0,0 @@ -sonar.projectKey=using-deprecated-props -sonar.projectName=Deprecated Props -sonar.projectVersion=1.2.3 - -sources=src -tests=tests -binaries=build -libraries=lib/*.jar diff --git a/it/projects/using-deprecated-props/src/Hello.java b/it/projects/using-deprecated-props/src/Hello.java deleted file mode 100644 index 8a94806..0000000 --- a/it/projects/using-deprecated-props/src/Hello.java +++ /dev/null @@ -1,2 +0,0 @@ -public class Hello { -} diff --git a/it/projects/using-deprecated-props/tests/HelloTest.java b/it/projects/using-deprecated-props/tests/HelloTest.java deleted file mode 100644 index 7cb87ed..0000000 --- a/it/projects/using-deprecated-props/tests/HelloTest.java +++ /dev/null @@ -1,2 +0,0 @@ -public class HelloTest { -} diff --git a/it/src/test/java/com/sonarsource/scanner/it/DistributionTest.java b/it/src/test/java/com/sonarsource/scanner/it/DistributionTest.java index 858e208..66b87b5 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/DistributionTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/DistributionTest.java @@ -21,7 +21,6 @@ package com.sonarsource.scanner.it; import com.sonar.orchestrator.build.BuildFailureException; import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.locator.ResourceLocation; import java.io.File; import java.io.IOException; import java.util.Map; @@ -41,10 +40,7 @@ public class DistributionTest extends ScannerTestCase { @Test public void should_succeed_with_self_contained_jre_despite_rubbish_java_home() throws IOException, InterruptedException { - String projectKey = "java:basedir-with-source"; - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject(projectKey, "Basedir with source"); - orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way"); + String projectKey = "basedir-with-source"; File projectDir = new File("projects/basedir-with-source"); SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey) @@ -59,10 +55,7 @@ public class DistributionTest extends ScannerTestCase { @Test(expected = BuildFailureException.class) public void should_fail_without_self_contained_jre_when_rubbish_java_home() throws IOException, InterruptedException { - String projectKey = "java:basedir-with-source"; - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject(projectKey, "Basedir with source"); - orchestrator.getServer().associateProjectToQualityProfile(projectKey, "java", "sonar-way"); + String projectKey = "basedir-with-source"; File projectDir = new File("projects/basedir-with-source"); SonarScanner build = newScanner(projectDir, "sonar.projectKey", projectKey) diff --git a/it/src/test/java/com/sonarsource/scanner/it/JavaTest.java b/it/src/test/java/com/sonarsource/scanner/it/JavaTest.java deleted file mode 100644 index f950751..0000000 --- a/it/src/test/java/com/sonarsource/scanner/it/JavaTest.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * SonarSource :: IT :: SonarQube Scanner - * Copyright (C) 2009-2018 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program 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. - * - * This program 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 this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package com.sonarsource.scanner.it; - -import com.sonar.orchestrator.build.BuildResult; -import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.locator.ResourceLocation; -import java.io.File; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.fest.assertions.Condition; -import org.junit.After; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.sonar.wsclient.issue.Issue; -import org.sonar.wsclient.issue.IssueQuery; -import org.sonarqube.ws.WsComponents.Component; -import org.sonarqube.ws.WsMeasures.Measure; - -import static java.lang.Integer.parseInt; -import static org.fest.assertions.Assertions.assertThat; - -public class JavaTest extends ScannerTestCase { - - @Rule - public TemporaryFolder temp = new TemporaryFolder(); - - @After - public void cleanup() { - orchestrator.resetData(); - } - - /** - * No bytecode, only sources - */ - @Test - public void scan_java_sources() { - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject("java:sample", "Java Sample, with comma"); - orchestrator.getServer().associateProjectToQualityProfile("java:sample", "java", "sonar-way"); - - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.verbose", "true"); - // SONARPLUGINS-3061 - // Add a trailing slash - build.setProperty("sonar.host.url", orchestrator.getServer().getUrl() + "/"); - orchestrator.executeBuild(build); - - Component project = getComponent("java:sample"); - assertThat(project.getName()).isEqualTo("Java Sample, with comma"); - assertThat(project.getDescription()).isEqualTo("This is a Java sample"); - - Map projectMeasures = getMeasures("java:sample", "files", "ncloc", "classes", "violations"); - // SONARPLUGINS-2399 - assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(2); - assertThat(parseInt(projectMeasures.get("classes").getValue())).isEqualTo(2); - assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(10); - assertThat(parseInt(projectMeasures.get("violations").getValue())).isGreaterThan(0); - - Component file = getComponent("java:sample:src/basic/Hello.java"); - assertThat(file.getName()).isEqualTo("Hello.java"); - - Map fileMeasures = getMeasures("java:sample:src/basic/Hello.java", "files", "ncloc", "classes", "violations"); - assertThat(parseInt(fileMeasures.get("ncloc").getValue())).isEqualTo(7); - assertThat(parseInt(fileMeasures.get("violations").getValue())).isGreaterThan(0); - } - - /** - * Only tests, no sources - */ - @Test - public void scan_java_tests() { - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject("java:sampletest", "Java Sample"); - orchestrator.getServer().associateProjectToQualityProfile("java:sampletest", "java", "sonar-way"); - - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.projectKey", "java:sampletest") - .setProperty("sonar.tests", "src") - .setProperty("sonar.sources", ""); - orchestrator.executeBuild(build); - - Component file = getComponent("java:sampletest:src/basic/Hello.java"); - assertThat(file.getName()).isEqualTo("Hello.java"); - assertThat(file.getQualifier()).isEqualTo("UTS"); - } - - @Test - public void scan_java_sources_and_bytecode() { - orchestrator.getServer().restoreProfile(ResourceLocation.create("/requires-bytecode-profile.xml")); - orchestrator.getServer().provisionProject("java:bytecode", "Java Bytecode Sample"); - orchestrator.getServer().associateProjectToQualityProfile("java:bytecode", "java", "requires-bytecode"); - - SonarScanner build = newScanner(new File("projects/java-bytecode")); - orchestrator.executeBuild(build); - - Component project = getComponent("java:bytecode"); - assertThat(project.getName()).isEqualTo("Java Bytecode Sample"); - - Map projectMeasures = getMeasures("java:bytecode", "violations"); - // the squid rules enabled in sonar-way-profile do not exist in SQ 3.0 - assertThat(parseInt(projectMeasures.get("violations").getValue())).isGreaterThan(0); - - assertThat(getMeasureAsInteger("java:bytecode:src/HasFindbugsViolation.java", "violations")).isGreaterThan(0); - - // findbugs is executed on bytecode - List issues = orchestrator.getServer().wsClient().issueClient().find(IssueQuery.create().componentRoots("java:bytecode").rules("squid:S1147")).list(); - assertThat(issues).hasSize(1); - assertThat(issues.get(0).ruleKey()).isEqualTo("squid:S1147"); - - // Squid performs analysis of dependencies - issues = orchestrator.getServer().wsClient().issueClient().find(IssueQuery.create().componentRoots("java:bytecode").rules("squid:CallToDeprecatedMethod")).list(); - assertThat(issues).hasSize(1); - assertThat(issues.get(0).ruleKey()).isEqualTo("squid:CallToDeprecatedMethod"); - } - - @Test - public void basedir_contains_java_sources() { - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject("java:basedir-with-source", "Basedir with source"); - orchestrator.getServer().associateProjectToQualityProfile("java:basedir-with-source", "java", "sonar-way"); - - SonarScanner build = newScanner(new File("projects/basedir-with-source")); - orchestrator.executeBuild(build); - - Map projectMeasures = getMeasures("java:basedir-with-source", "files", "ncloc"); - assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(1); - assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); - } - - /** - * Replace the maven format groupId:artifactId by a single key - */ - @Test - public void should_support_simple_project_keys() { - orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); - orchestrator.getServer().provisionProject("SAMPLE", "Java Sample, with comma"); - orchestrator.getServer().associateProjectToQualityProfile("SAMPLE", "java", "sonar-way"); - - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProjectKey("SAMPLE"); - orchestrator.executeBuild(build); - - Map projectMeasures = getMeasures("SAMPLE", "files", "ncloc"); - assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(2); - assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); - } - - /** - * SONARPLUGINS-1230 - */ - @Test - public void should_override_working_dir_with_relative_path() { - SonarScanner build = newScanner(new File("projects/override-working-dir")) - .setProperty("sonar.working.directory", ".overridden-relative-sonar"); - orchestrator.executeBuild(build); - - assertThat(new File("projects/override-working-dir/.sonar")).doesNotExist(); - assertThat(new File("projects/override-working-dir/.overridden-relative-sonar")).exists().isDirectory(); - } - - /** - * SONARPLUGINS-1230 - */ - @Test - public void should_override_working_dir_with_absolute_path() { - File projectHome = new File("projects/override-working-dir"); - SonarScanner build = newScanner(projectHome) - .setProperty("sonar.working.directory", new File(projectHome, ".overridden-absolute-sonar").getAbsolutePath()); - orchestrator.executeBuild(build); - - assertThat(new File("projects/override-working-dir/.sonar")).doesNotExist(); - assertThat(new File("projects/override-working-dir/.overridden-absolute-sonar")).exists().isDirectory(); - } - - /** - * SONARPLUGINS-1856 - */ - @Test - public void should_fail_if_source_dir_does_not_exist() { - SonarScanner build = newScanner(new File("projects/bad-source-dirs")); - - BuildResult result = orchestrator.executeBuildQuietly(build); - assertThat(result.getStatus()).isNotEqualTo(0); - // with the following message - assertThat(result.getLogs()).contains("Invalid value of sonar.sources for bad-source-dirs"); - } - - /** - * SONARPLUGINS-2256 - */ - @Test - public void should_warn_when_analysis_is_platform_dependent() { - SonarScanner build = newScanner(new File("projects/java-sample")) - // ORCH-243 - .setSourceEncoding(""); - String log = orchestrator.executeBuild(build).getLogs(); - - // Note: we can't really check the locale value and the charset because the ones used during the Sonar analysis may not be the ones - // used to launch the tests. But we can check that the analysis is platform dependent (i.e. "sonar.sourceEncoding" hasn't been set). - assertThat(log).contains("Default locale:"); - assertThat(log).contains(", source code encoding:"); - assertThat(log).contains("(analysis is platform dependent)"); - } - - /** - * SONARUNNER-153 - */ - @Test - public void should_enable_verbose() { - // this line should appear in all versions (LTS-DEV) in debug only - String expectedLog = "Available languages:"; - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.verbose", "true"); - String logs = orchestrator.executeBuild(build).getLogs(); - assertThat(logs).contains(expectedLog); - } - - @Test - public void should_use_environment_props() { - SonarScanner build = newScanner(new File("projects/java-sample-no-properties")) - .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{" - + "\"sonar.projectKey\" : \"java:sample\"," + - "\"sonar.projectName\" : \"Java Sample, with comma\"," + - "\"sonar.projectDescription\" : \"This is a Java sample\"," + - "\"sonar.projectVersion\" : \"1.2.3\"," + - "\"sonar.sources\" : \"src\" }"); - orchestrator.executeBuild(build); - } - - @Test - public void should_skip_analysis() { - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.host.url", "http://foo") - .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{ \"sonar.scanner.skip\":\"true\" }"); - - BuildResult result = orchestrator.executeBuild(build); - assertThat(result.getLogs()).contains("SonarQube Scanner analysis skipped"); - } - - @Test - public void should_fail_if_unable_to_connect() { - SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.host.url", "http://foo"); - - BuildResult result = orchestrator.executeBuildQuietly(build); - // expect build failure - assertThat(result.getStatus()).isNotEqualTo(0); - // with the following message - assertThat(result.getLogs()).contains("SonarQube server [http://foo] can not be reached"); - } - - // SONARPLUGINS-3574 - @Test - public void run_from_external_location() throws IOException { - File tempDir = temp.newFolder(); - SonarScanner build = newScanner(tempDir) - .setProperty("sonar.projectBaseDir", new File("projects/java-sample").getAbsolutePath()) - .addArguments("-e"); - orchestrator.executeBuild(build); - - assertThat(getComponent("java:sample").getDescription()).isEqualTo("This is a Java sample"); - Map projectMeasures = getMeasures("java:sample", "files", "ncloc", "classes", "violations"); - assertThat(projectMeasures.values().stream().filter(measure -> measure.getValue() != null).collect(Collectors.toList())).hasSize(4); - } - - @Test - public void verify_env_variable() { - SonarScanner build = newScanner(new File("projects/java-sample")) - .setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx2m"); - BuildResult executeBuild = orchestrator.executeBuildQuietly(build); - assertThat(executeBuild.getStatus()).isNotEqualTo(0); - String logs = executeBuild.getLogs(); - assertThat(logs).satisfies(new Condition("Contain error message about OOM") { - @Override - public boolean matches(String value) { - return value.contains("java.lang.OutOfMemoryError") - || value.contains("GC overhead limit exceeded") || value.contains("Java heap space"); - } - }); - } - -} diff --git a/it/src/test/java/com/sonarsource/scanner/it/MultimoduleTest.java b/it/src/test/java/com/sonarsource/scanner/it/MultimoduleTest.java index ea988a4..b2b02e1 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/MultimoduleTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/MultimoduleTest.java @@ -60,23 +60,6 @@ public class MultimoduleTest extends ScannerTestCase { assertThat(new File("projects/multi-module/simplest/simplest-with-props-on-root/module2/.scannerwork")).doesNotExist(); } - /** - * SONARPLUGINS-2421 - */ - @Test - public void test_multi_language_with_same_projectdir() { - SonarScanner build = newScanner(new File("projects/multi-module/multi-language")); - - orchestrator.executeBuild(build); - - assertThat(getComponent("multi-language").getName()).isEqualTo("Simplest multi-language project"); - - // Verify that we have the modules - assertThat(getComponent("multi-language:java-module").getName()).isEqualTo("java-module"); - - assertThat(getComponent("multi-language:js-module").getName()).isEqualTo("js-module"); - } - /** * SONARPLUGINS-2202 */ diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java new file mode 100644 index 0000000..b4c1273 --- /dev/null +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -0,0 +1,206 @@ +/* + * SonarSource :: IT :: SonarQube Scanner + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package com.sonarsource.scanner.it; + +import com.sonar.orchestrator.build.BuildResult; +import com.sonar.orchestrator.build.SonarScanner; +import java.io.File; +import java.io.IOException; +import java.util.Map; +import java.util.stream.Collectors; +import org.fest.assertions.Condition; +import org.junit.After; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.sonarqube.ws.WsMeasures.Measure; + +import static java.lang.Integer.parseInt; +import static org.fest.assertions.Assertions.assertThat; + +public class ScannerTest extends ScannerTestCase { + + @Rule + public TemporaryFolder temp = new TemporaryFolder(); + + @After + public void cleanup() { + orchestrator.resetData(); + } + + @Test + public void basedir_contains_sources() { + SonarScanner build = newScanner(new File("projects/basedir-with-source")); + orchestrator.executeBuild(build); + + Map projectMeasures = getMeasures("java:basedir-with-source", "files", "ncloc"); + assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(1); + assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); + } + + /** + * Replace the maven format groupId:artifactId by a single key + */ + @Test + public void should_support_simple_project_keys() { + SonarScanner build = newScanner(new File("projects/simple-sample")) + .setProjectKey("SAMPLE"); + orchestrator.executeBuild(build); + + Map projectMeasures = getMeasures("SAMPLE", "files", "ncloc"); + assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(2); + assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); + } + + /** + * SONARPLUGINS-1230 + */ + @Test + public void should_override_working_dir_with_relative_path() { + SonarScanner build = newScanner(new File("projects/override-working-dir")) + .setProperty("sonar.working.directory", ".overridden-relative-sonar"); + orchestrator.executeBuild(build); + + assertThat(new File("projects/override-working-dir/.sonar")).doesNotExist(); + assertThat(new File("projects/override-working-dir/.overridden-relative-sonar")).exists().isDirectory(); + } + + /** + * SONARPLUGINS-1230 + */ + @Test + public void should_override_working_dir_with_absolute_path() { + File projectHome = new File("projects/override-working-dir"); + SonarScanner build = newScanner(projectHome) + .setProperty("sonar.working.directory", new File(projectHome, ".overridden-absolute-sonar").getAbsolutePath()); + orchestrator.executeBuild(build); + + assertThat(new File("projects/override-working-dir/.sonar")).doesNotExist(); + assertThat(new File("projects/override-working-dir/.overridden-absolute-sonar")).exists().isDirectory(); + } + + /** + * SONARPLUGINS-1856 + */ + @Test + public void should_fail_if_source_dir_does_not_exist() { + SonarScanner build = newScanner(new File("projects/bad-source-dirs")); + + BuildResult result = orchestrator.executeBuildQuietly(build); + assertThat(result.getStatus()).isNotEqualTo(0); + // with the following message + assertThat(result.getLogs()).contains("Invalid value of sonar.sources for bad-source-dirs"); + } + + /** + * SONARPLUGINS-2256 + */ + @Test + public void should_warn_when_analysis_is_platform_dependent() { + SonarScanner build = newScanner(new File("projects/simple-sample")) + // ORCH-243 + .setSourceEncoding(""); + String log = orchestrator.executeBuild(build).getLogs(); + + // Note: we can't really check the locale value and the charset because the ones used during the Sonar analysis may not be the ones + // used to launch the tests. But we can check that the analysis is platform dependent (i.e. "sonar.sourceEncoding" hasn't been set). + assertThat(log).contains("Default locale:"); + assertThat(log).contains(", source code encoding:"); + assertThat(log).contains("(analysis is platform dependent)"); + } + + /** + * SONARUNNER-153 + */ + @Test + public void should_enable_verbose() { + // this line should appear in all versions (LTS-DEV) in debug only + String expectedLog = "Available languages:"; + SonarScanner build = newScanner(new File("projects/simple-sample")) + .setProperty("sonar.verbose", "true"); + String logs = orchestrator.executeBuild(build).getLogs(); + assertThat(logs).contains(expectedLog); + } + + @Test + public void should_use_environment_props() { + SonarScanner build = newScanner(new File("projects/simple-sample-no-properties")) + .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{" + + "\"sonar.projectKey\" : \"sample\"," + + "\"sonar.projectName\" : \"Sample, with comma\"," + + "\"sonar.projectDescription\" : \"This is a sample\"," + + "\"sonar.projectVersion\" : \"1.2.3\"," + + "\"sonar.sources\" : \"src\" }"); + orchestrator.executeBuild(build); + } + + @Test + public void should_skip_analysis() { + SonarScanner build = newScanner(new File("projects/simple-sample")) + .setProperty("sonar.host.url", "http://foo") + .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{ \"sonar.scanner.skip\":\"true\" }"); + + BuildResult result = orchestrator.executeBuild(build); + assertThat(result.getLogs()).contains("SonarQube Scanner analysis skipped"); + } + + @Test + public void should_fail_if_unable_to_connect() { + SonarScanner build = newScanner(new File("projects/simple-sample")) + .setProperty("sonar.host.url", "http://foo"); + + BuildResult result = orchestrator.executeBuildQuietly(build); + // expect build failure + assertThat(result.getStatus()).isNotEqualTo(0); + // with the following message + assertThat(result.getLogs()).contains("SonarQube server [http://foo] can not be reached"); + } + + // SONARPLUGINS-3574 + @Test + public void run_from_external_location() throws IOException { + File tempDir = temp.newFolder(); + SonarScanner build = newScanner(tempDir) + .setProperty("sonar.projectBaseDir", new File("projects/simple-sample").getAbsolutePath()) + .addArguments("-e"); + orchestrator.executeBuild(build); + + assertThat(getComponent("sample").getDescription()).isEqualTo("This is a sample"); + Map projectMeasures = getMeasures("sample", "files", "ncloc", "classes", "violations"); + assertThat(projectMeasures.values().stream().filter(measure -> measure.getValue() != null).collect(Collectors.toList())).hasSize(4); + } + + @Test + public void verify_env_variable() { + SonarScanner build = newScanner(new File("projects/simple-sample")) + .setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx2m"); + BuildResult executeBuild = orchestrator.executeBuildQuietly(build); + assertThat(executeBuild.getStatus()).isNotEqualTo(0); + String logs = executeBuild.getLogs(); + assertThat(logs).satisfies(new Condition("Contain error message about OOM") { + @Override + public boolean matches(String value) { + return value.contains("java.lang.OutOfMemoryError") + || value.contains("GC overhead limit exceeded") || value.contains("Java heap space"); + } + }); + } + +} diff --git a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java index a100493..cc4a16e 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java +++ b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java @@ -26,13 +26,11 @@ import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) -@SuiteClasses({JavaTest.class, MultimoduleTest.class, DistributionTest.class}) +@SuiteClasses({ScannerTest.class, MultimoduleTest.class, DistributionTest.class}) public class SonarScannerTestSuite { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setOrchestratorProperty("javaVersion", "4.11") - .addPlugin("java") .setOrchestratorProperty("javascriptVersion", "LATEST_RELEASE") .addPlugin("javascript") .build(); diff --git a/it/src/test/resources/requires-bytecode-profile.xml b/it/src/test/resources/requires-bytecode-profile.xml deleted file mode 100644 index 0e91e52..0000000 --- a/it/src/test/resources/requires-bytecode-profile.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - requires-bytecode - java - - - squid - CallToDeprecatedMethod - MINOR - - - squid - S1147 - MAJOR - - - \ No newline at end of file diff --git a/it/src/test/resources/sonar-way-profile.xml b/it/src/test/resources/sonar-way-profile.xml deleted file mode 100644 index a5b203d..0000000 --- a/it/src/test/resources/sonar-way-profile.xml +++ /dev/null @@ -1,691 +0,0 @@ - - - sonar-way - java - - - common-java - DuplicatedBlocks - MAJOR - - - common-java - InsufficientBranchCoverage - MAJOR - - - minimumBranchCoverageRatio - 65.0 - - - - - squid - S00105 - MINOR - - - squid - MethodCyclomaticComplexity - MAJOR - - - max - 10 - - - - - squid - ClassCyclomaticComplexity - MAJOR - - - max - 200 - - - - - squid - CommentedOutCodeLine - MAJOR - - - squid - S00108 - MAJOR - - - squid - S00107 - MAJOR - - - maximumMethodParameters - 7 - - - - - squid - S00112 - MAJOR - - - squid - S00100 - MAJOR - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - squid - S00101 - MAJOR - - - format - ^[A-Z][a-zA-Z0-9]*$ - - - - - squid - S00114 - MAJOR - - - format - ^[A-Z][a-zA-Z0-9]*$ - - - - - squid - S00115 - MAJOR - - - format - ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ - - - - - squid - S00116 - MAJOR - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - squid - S00117 - MAJOR - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - squid - S00119 - MAJOR - - - format - ^[A-Z]$ - - - - - squid - S00120 - MAJOR - - - format - ^[a-z]+(\.[a-z][a-z0-9]*)*$ - - - - - squid - S00121 - MAJOR - - - squid - S00122 - MAJOR - - - squid - RightCurlyBraceSameLineAsNextBlockCheck - MAJOR - - - squid - RightCurlyBraceStartLineCheck - MAJOR - - - squid - LeftCurlyBraceEndLineCheck - MAJOR - - - squid - UselessParenthesesCheck - MAJOR - - - squid - ObjectFinalizeCheck - CRITICAL - - - squid - ObjectFinalizeOverridenCheck - CRITICAL - - - squid - ObjectFinalizeOverridenCallsSuperFinalizeCheck - BLOCKER - - - squid - ClassVariableVisibilityCheck - MAJOR - - - squid - ForLoopCounterChangedCheck - MAJOR - - - squid - LabelsShouldNotBeUsedCheck - MAJOR - - - squid - SwitchLastCaseIsDefaultCheck - MAJOR - - - squid - EmptyStatementUsageCheck - MAJOR - - - squid - ModifiersOrderCheck - MINOR - - - squid - AssignmentInSubExpressionCheck - MAJOR - - - squid - StringEqualityComparisonCheck - CRITICAL - - - squid - TrailingCommentCheck - MINOR - - - legalCommentPattern - ^\s*+[^\s]++$ - - - - - squid - UselessImportCheck - MINOR - - - squid - LowerCaseLongSuffixCheck - MAJOR - - - squid - MissingDeprecatedCheck - MAJOR - - - squid - HiddenFieldCheck - MAJOR - - - squid - S1133 - INFO - - - squid - S1134 - MAJOR - - - squid - S1135 - INFO - - - squid - S1118 - MAJOR - - - squid - S1132 - MAJOR - - - squid - S1126 - MAJOR - - - squid - S1125 - MINOR - - - squid - S1067 - MAJOR - - - max - 3 - - - - - squid - S1141 - MAJOR - - - squid - S1147 - CRITICAL - - - squid - S1143 - BLOCKER - - - squid - S1145 - MAJOR - - - squid - S1157 - MAJOR - - - squid - S1155 - MAJOR - - - squid - S1149 - MAJOR - - - squid - S1171 - MAJOR - - - squid - S1168 - MAJOR - - - squid - S1170 - MAJOR - - - squid - S1163 - MAJOR - - - squid - S106 - MAJOR - - - squid - S1165 - MAJOR - - - squid - S1066 - MAJOR - - - squid - S134 - MINOR - - - max - 3 - - - - - squid - S1181 - BLOCKER - - - squid - S1150 - MAJOR - - - squid - S1182 - MAJOR - - - squid - S1151 - MAJOR - - - max - 5 - - - - - squid - S128 - CRITICAL - - - squid - S1166 - MAJOR - - - squid - S1190 - MAJOR - - - squid - S1188 - MAJOR - - - max - 20 - - - - - squid - S1191 - MAJOR - - - - squid - S135 - MAJOR - - - squid - S1186 - MAJOR - - - squid - S1185 - MINOR - - - squid - S1174 - MAJOR - - - squid - S1175 - MAJOR - - - squid - S1153 - MINOR - - - squid - S1148 - CRITICAL - - - squid - S1195 - MINOR - - - squid - S1194 - MAJOR - - - squid - S1193 - MAJOR - - - squid - S1192 - MINOR - - - squid - S1158 - MAJOR - - - squid - S1215 - CRITICAL - - - squid - S1197 - MINOR - - - squid - S1220 - MAJOR - - - squid - S1221 - CRITICAL - - - squid - S1199 - MAJOR - - - squid - S1214 - MINOR - - - squid - S1201 - CRITICAL - - - squid - S1210 - CRITICAL - - - squid - S1206 - BLOCKER - - - squid - S1219 - CRITICAL - - - squid - S1301 - MINOR - - - squid - S1314 - MAJOR - - - squid - S1226 - MAJOR - - - squid - S1313 - MAJOR - - - squid - S1312 - MAJOR - - - format - LOG(?:GER)? - - - - - squid - S1318 - CRITICAL - - - squid - S1223 - MAJOR - - - squid - S1319 - MAJOR - - - squid - S1231 - MINOR - - - squid - S1444 - MAJOR - - - squid - S1452 - MAJOR - - - squid - S1481 - MAJOR - - - squid - S1068 - MAJOR - - - squid - S1317 - MAJOR - - - squid - S1596 - MAJOR - - - squid - UnusedPrivateMethod - MAJOR - - - squid - RedundantThrowsDeclarationCheck - MINOR - - - squid - S1160 - MAJOR - - - squid - S1217 - CRITICAL - - - squid - S1488 - MINOR - - - squid - S1602 - MAJOR - - - squid - S1611 - MINOR - - - \ No newline at end of file