From 33e455cf4f0128dceaa1c72be20afcfb978bf2e2 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Fri, 29 Jun 2018 15:32:56 +0200 Subject: [PATCH] Replace SonarJava by SonarJS in ITs to support SQ 7.3 --- it/projects/bad-source-dirs/src/Hello.java | 7 - it/projects/bad-source-dirs/src/Hello.js | 2 + it/projects/basedir-with-source/Hello.java | 7 - it/projects/basedir-with-source/Hello.js | 4 + it/projects/java-bytecode/build.xml | 32 - .../build/classes/HasFindbugsViolation.class | Bin 720 -> 0 bytes it/projects/java-bytecode/lib/deprecated.jar | Bin 909 -> 0 bytes .../java-bytecode/sonar-project.properties | 8 - .../src/HasFindbugsViolation.java | 13 - .../src/basic/Hello.java | 9 - .../src/basic/World.java | 8 - .../java-sample/sonar-project.properties | 7 - it/projects/java-sample/src/basic/Hello.java | 9 - it/projects/java-sample/src/basic/World.java | 8 - .../module1/src/Hello.java | 2 - .../module1/src/Hello.js | 2 + .../module2/src/Hello.java | 2 - .../module2/src/Hello.js | 2 + .../modules/module1/src/Hello.java | 2 - .../modules/module1/src/Hello.js | 2 + .../modules/module2/src/Hello.java | 2 - .../modules/module2/src/Hello.js | 2 + .../my module 1/src/Hello.java | 2 - .../my module 1/src/Hello.js | 2 + .../my module 2/src/Hello.java | 2 - .../my module 2/src/Hello.js | 2 + .../module1/src1/Hello.java | 2 - .../module1/src1/Hello.js | 2 + .../module2/src2/Hello.java | 2 - .../module2/src2/Hello.js | 2 + .../module1/src/Hello.java | 2 - .../unexisting-base-dir/module1/src/Hello.js | 2 + .../module2/src/Hello.java | 2 - .../unexisting-base-dir/module2/src/Hello.js | 2 + .../module1/src/Hello.java | 2 - .../module1/src/Hello.js | 2 + .../module2/src/Hello.java | 2 - .../module2/src/Hello.js | 2 + .../multi-language/sonar-project.properties | 14 - .../multi-language/src/main/java/Hello.java | 2 - .../multi-language/src/main/js/Hello.js | 3 - .../module1/src/Hello.java | 2 - .../module1/src/Hello.js | 2 + .../module2/src/Hello.java | 2 - .../module2/src/Hello.js | 2 + .../src/placeholder.txt | 2 +- .../module1/src/Hello.java | 2 - .../module1/src/Hello.js | 2 + .../module2/src/Hello.java | 2 - .../module2/src/Hello.js | 2 + .../override-working-dir/src/Hello.java | 7 - it/projects/override-working-dir/src/Hello.js | 2 + .../src/basic/Hello.js | 2 + .../src/basic/World.js | 2 + .../simple-sample/sonar-project.properties | 6 + it/projects/simple-sample/src/basic/Hello.js | 2 + it/projects/simple-sample/src/basic/World.js | 2 + .../using-deprecated-props/build/Hello.class | Bin 184 -> 0 bytes .../using-deprecated-props/lib/deprecated.jar | Bin 909 -> 0 bytes .../sonar-project.properties | 8 - .../using-deprecated-props/src/Hello.java | 2 - .../tests/HelloTest.java | 2 - .../scanner/it/DistributionTest.java | 11 +- .../scanner/it/MultimoduleTest.java | 17 - .../it/{JavaTest.java => ScannerTest.java} | 129 +--- .../scanner/it/SonarScannerTestSuite.java | 4 +- .../resources/requires-bytecode-profile.xml | 17 - it/src/test/resources/sonar-way-profile.xml | 691 ------------------ 68 files changed, 74 insertions(+), 1029 deletions(-) delete mode 100644 it/projects/bad-source-dirs/src/Hello.java create mode 100644 it/projects/bad-source-dirs/src/Hello.js delete mode 100644 it/projects/basedir-with-source/Hello.java create mode 100644 it/projects/basedir-with-source/Hello.js delete mode 100644 it/projects/java-bytecode/build.xml delete mode 100644 it/projects/java-bytecode/build/classes/HasFindbugsViolation.class delete mode 100644 it/projects/java-bytecode/lib/deprecated.jar delete mode 100644 it/projects/java-bytecode/sonar-project.properties delete mode 100644 it/projects/java-bytecode/src/HasFindbugsViolation.java delete mode 100644 it/projects/java-sample-no-properties/src/basic/Hello.java delete mode 100644 it/projects/java-sample-no-properties/src/basic/World.java delete mode 100644 it/projects/java-sample/sonar-project.properties delete mode 100644 it/projects/java-sample/src/basic/Hello.java delete mode 100644 it/projects/java-sample/src/basic/World.java delete mode 100644 it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.java create mode 100644 it/projects/multi-module/advanced/using-config-file-prop/module1/src/Hello.js delete mode 100644 it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.java create mode 100644 it/projects/multi-module/advanced/using-config-file-prop/module2/src/Hello.js delete mode 100644 it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.java create mode 100644 it/projects/multi-module/customization/deep-path-for-modules/modules/module1/src/Hello.js delete mode 100644 it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.java create mode 100644 it/projects/multi-module/customization/deep-path-for-modules/modules/module2/src/Hello.js delete mode 100644 it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.java create mode 100644 it/projects/multi-module/customization/module-path-with-space/my module 1/src/Hello.js delete mode 100644 it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.java create mode 100644 it/projects/multi-module/customization/module-path-with-space/my module 2/src/Hello.js delete mode 100644 it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.java create mode 100644 it/projects/multi-module/customization/overwriting-parent-properties/module1/src1/Hello.js delete mode 100644 it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.java create mode 100644 it/projects/multi-module/customization/overwriting-parent-properties/module2/src2/Hello.js delete mode 100644 it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.java create mode 100644 it/projects/multi-module/failures/unexisting-base-dir/module1/src/Hello.js delete mode 100644 it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.java create mode 100644 it/projects/multi-module/failures/unexisting-base-dir/module2/src/Hello.js delete mode 100644 it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.java create mode 100644 it/projects/multi-module/failures/unexisting-config-file/module1/src/Hello.js delete mode 100644 it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.java create mode 100644 it/projects/multi-module/failures/unexisting-config-file/module2/src/Hello.js delete mode 100644 it/projects/multi-module/multi-language/sonar-project.properties delete mode 100644 it/projects/multi-module/multi-language/src/main/java/Hello.java delete mode 100644 it/projects/multi-module/multi-language/src/main/js/Hello.js delete mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.java create mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-each-module/module1/src/Hello.js delete mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.java create mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-each-module/module2/src/Hello.js delete mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.java create mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-root/module1/src/Hello.js delete mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.java create mode 100644 it/projects/multi-module/simplest/simplest-with-props-on-root/module2/src/Hello.js delete mode 100644 it/projects/override-working-dir/src/Hello.java create mode 100644 it/projects/override-working-dir/src/Hello.js create mode 100644 it/projects/simple-sample-no-properties/src/basic/Hello.js create mode 100644 it/projects/simple-sample-no-properties/src/basic/World.js create mode 100644 it/projects/simple-sample/sonar-project.properties create mode 100644 it/projects/simple-sample/src/basic/Hello.js create mode 100644 it/projects/simple-sample/src/basic/World.js delete mode 100644 it/projects/using-deprecated-props/build/Hello.class delete mode 100644 it/projects/using-deprecated-props/lib/deprecated.jar delete mode 100644 it/projects/using-deprecated-props/sonar-project.properties delete mode 100644 it/projects/using-deprecated-props/src/Hello.java delete mode 100644 it/projects/using-deprecated-props/tests/HelloTest.java rename it/src/test/java/com/sonarsource/scanner/it/{JavaTest.java => ScannerTest.java} (52%) delete mode 100644 it/src/test/resources/requires-bytecode-profile.xml delete mode 100644 it/src/test/resources/sonar-way-profile.xml 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 f4823257fd9c8d56c0444a204e9d99feda7b3b04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 720 zcmZuv+iuf95Iq|wapRcOq_ni$!!-$rNQf5%;(<#9lA%aJk$BwLOS+ZqjeJ4nvp}dt zAn^fw6ymt8oFe)%J99j9X6B54|M~F?zysWK;9%3nmV+8LOLM`&MOjI6BT1BBi*WZ<&M}kC>-mn(1UCFvG8^k8oE7tIs!b$wZ4#1OMaEK(c3h4yHmM(& z_@RI^F+~~>EvdIotG-{(>f#JK0%u>SMXCastMKKXj2Dq|aRVJ2H(lJqZ5MaYchQDx zW8h+ly8`D<sC z8NH*JIVDvx=GJS6P5y-i>_wRrC9LcJe~7^pJs!^CeFg8yUFcc#DFE#%qY+=hw=q0` z_(G=!kG6RTQY8BBQ3ASHV?-6I;%Ce*i@l$yeK>%%kGj|Uj>eLw!*(T`1DowuPVjjZ m-+IOO=$Nnl70ux{*!x&nQk8!sxP!ximSeRmnhk!f;rw4Jos9$l diff --git a/it/projects/java-bytecode/lib/deprecated.jar b/it/projects/java-bytecode/lib/deprecated.jar deleted file mode 100644 index 65e3be99b1f377df6d76d2b1af01781a73c7f408..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 909 zcmWIWW@Zs#U|`^2m{4J92V^iXfe0YrWME*`(P_14uocjo-&AcHH$51tn3dHL#i`d%zu z#lkt`rQ{K5NzDwF>CZHOq^XHN6%QAizT}yhcEvN**O{M+J{B<|SzI*#id}Yl=j=B? z3*#6W7{nQ57+g{dic*skOHxx@D-v@Ha#Hn@a}tY-Lqj+jm^1SJ`+{(31vdjD%L`@( z1~8H8zt``ufxy3Yp28fh+q{?Z@#GwEILhO+YJm@{io@NxPgvFo?e>yAl5MDH_<_Mj zp-zu@}Sj6%<+tPd`&Q5>j>&ulI zr?&RFlhC}J*wmWUvw0U!o3(d!QRs)re_3izICLy^lgn8lJCQBU>Kn(lRK>E|qEGE_D)&7vf18gKcuBx0{v2Z+glFiAXF&l4 z4jjyttOC5LKWA!kX%=wazcQ)kj|i{thPJ46QF=gI8JR@D=>mJw0$Pm(;Asbx(9pG_ zCp3gUT_6*#6)D+)Ops%Sq-)F+BLO#{p>Y|IjTr>c^ur2CKWJ$O*?HJP6mB}hV_*Ws XG#nJZ0p6@^AayK2Cb^1}=66ZgvJ9Mg}&U%)HDJJ4Oa(4b3n{1{UZ1lvG9rexJ;| zRKL>Pq|~C2#H1Xc2v=}^X;E^jTPB#}k(!f}ua}irmdL}v!obSNzzP;&WDo#}>E|To zrR)1AWu+#UFeoxG0qp|;Mj!+#29j(*o-CNpz`&}toq=&9SehM3vH^u5N;!Zu69Xpz DMq?lR 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 65e3be99b1f377df6d76d2b1af01781a73c7f408..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 909 zcmWIWW@Zs#U|`^2m{4J92V^iXfe0YrWME*`(P_14uocjo-&AcHH$51tn3dHL#i`d%zu z#lkt`rQ{K5NzDwF>CZHOq^XHN6%QAizT}yhcEvN**O{M+J{B<|SzI*#id}Yl=j=B? z3*#6W7{nQ57+g{dic*skOHxx@D-v@Ha#Hn@a}tY-Lqj+jm^1SJ`+{(31vdjD%L`@( z1~8H8zt``ufxy3Yp28fh+q{?Z@#GwEILhO+YJm@{io@NxPgvFo?e>yAl5MDH_<_Mj zp-zu@}Sj6%<+tPd`&Q5>j>&ulI zr?&RFlhC}J*wmWUvw0U!o3(d!QRs)re_3izICLy^lgn8lJCQBU>Kn(lRK>E|qEGE_D)&7vf18gKcuBx0{v2Z+glFiAXF&l4 z4jjyttOC5LKWA!kX%=wazcQ)kj|i{thPJ46QF=gI8JR@D=>mJw0$Pm(;Asbx(9pG_ zCp3gUT_6*#6)D+)Ops%Sq-)F+BLO#{p>Y|IjTr>c^ur2CKWJ$O*?HJP6mB}hV_*Ws XG#nJZ0p6@^AayK2C 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"); - + public void basedir_contains_sources() { SonarScanner build = newScanner(new File("projects/basedir-with-source")); orchestrator.executeBuild(build); @@ -153,11 +60,7 @@ public class JavaTest extends ScannerTestCase { */ @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")) + SonarScanner build = newScanner(new File("projects/simple-sample")) .setProjectKey("SAMPLE"); orchestrator.executeBuild(build); @@ -211,7 +114,7 @@ public class JavaTest extends ScannerTestCase { */ @Test public void should_warn_when_analysis_is_platform_dependent() { - SonarScanner build = newScanner(new File("projects/java-sample")) + SonarScanner build = newScanner(new File("projects/simple-sample")) // ORCH-243 .setSourceEncoding(""); String log = orchestrator.executeBuild(build).getLogs(); @@ -230,7 +133,7 @@ public class JavaTest extends ScannerTestCase { 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")) + SonarScanner build = newScanner(new File("projects/simple-sample")) .setProperty("sonar.verbose", "true"); String logs = orchestrator.executeBuild(build).getLogs(); assertThat(logs).contains(expectedLog); @@ -238,11 +141,11 @@ public class JavaTest extends ScannerTestCase { @Test public void should_use_environment_props() { - SonarScanner build = newScanner(new File("projects/java-sample-no-properties")) + SonarScanner build = newScanner(new File("projects/simple-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.projectKey\" : \"sample\"," + + "\"sonar.projectName\" : \"Sample, with comma\"," + + "\"sonar.projectDescription\" : \"This is a sample\"," + "\"sonar.projectVersion\" : \"1.2.3\"," + "\"sonar.sources\" : \"src\" }"); orchestrator.executeBuild(build); @@ -250,7 +153,7 @@ public class JavaTest extends ScannerTestCase { @Test public void should_skip_analysis() { - SonarScanner build = newScanner(new File("projects/java-sample")) + SonarScanner build = newScanner(new File("projects/simple-sample")) .setProperty("sonar.host.url", "http://foo") .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{ \"sonar.scanner.skip\":\"true\" }"); @@ -260,7 +163,7 @@ public class JavaTest extends ScannerTestCase { @Test public void should_fail_if_unable_to_connect() { - SonarScanner build = newScanner(new File("projects/java-sample")) + SonarScanner build = newScanner(new File("projects/simple-sample")) .setProperty("sonar.host.url", "http://foo"); BuildResult result = orchestrator.executeBuildQuietly(build); @@ -275,18 +178,18 @@ public class JavaTest extends ScannerTestCase { 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()) + .setProperty("sonar.projectBaseDir", new File("projects/simple-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(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/java-sample")) + SonarScanner build = newScanner(new File("projects/simple-sample")) .setEnvironmentVariable("SONAR_SCANNER_OPTS", "-Xmx2m"); BuildResult executeBuild = orchestrator.executeBuildQuietly(build); assertThat(executeBuild.getStatus()).isNotEqualTo(0); @@ -294,7 +197,7 @@ public class JavaTest extends ScannerTestCase { assertThat(logs).satisfies(new Condition("Contain error message about OOM") { @Override public boolean matches(String value) { - return value.contains("java.lang.OutOfMemoryError") + 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 -- 2.39.5