diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2016-03-17 17:05:56 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2016-03-18 09:35:05 +0100 |
commit | cfcbe278f7ced12599d898d50f3fe68bfbf95155 (patch) | |
tree | 5b4116ad08a8ba87ffc5bf9f159a431b9609b48f /sonar-scanner-engine/src/test/resources | |
parent | 38ce80934961773a9a35ec0401994b3d726597dc (diff) | |
download | sonarqube-cfcbe278f7ced12599d898d50f3fe68bfbf95155.tar.gz sonarqube-cfcbe278f7ced12599d898d50f3fe68bfbf95155.zip |
Rename batch into scanner
Diffstat (limited to 'sonar-scanner-engine/src/test/resources')
125 files changed, 1924 insertions, 0 deletions
diff --git a/sonar-scanner-engine/src/test/resources/logback-test.xml b/sonar-scanner-engine/src/test/resources/logback-test.xml new file mode 100644 index 00000000000..da6be3344a2 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/logback-test.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<configuration debug="false"> + + <!-- + ONLY FOR UNIT TESTS + --> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} %-5level - %msg%n</pattern> + </encoder> + </appender> + + <!-- BeanUtils generate to many DEBUG logs when sonar.verbose is set --> + <logger name="org.apache.commons.beanutils.converters"> + <level value="WARN"/> + </logger> + + <!-- sonar.showSql --> + <!-- see also org.sonar.db.MyBatis#configureLogback() --> + <logger name="org.mybatis"> + <level value="WARN"/> + </logger> + <logger name="org.apache.ibatis"> + <level value="WARN"/> + </logger> + <logger name="java.sql"> + <level value="WARN"/> + </logger> + <logger name="java.sql.ResultSet"> + <level value="WARN"/> + </logger> + <logger name="PERSISTIT"> + <level value="WARN"/> + </logger> + + <root> + <level value="INFO"/> + <appender-ref ref="STDOUT"/> + </root> + +</configuration> diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..74d29a4fa08 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a1/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..42039538a92 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_a/module_a2/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/sonar-project.properties new file mode 100644 index 00000000000..c2b00ede37c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample-not-associated/sonar-project.properties @@ -0,0 +1,31 @@ +# 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 + +module_a.sonar.projectKey=module_a +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.projectKey=module_b +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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/.sonar/sonar-report.json b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/.sonar/sonar-report.json new file mode 100644 index 00000000000..581142ee53c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/.sonar/sonar-report.json @@ -0,0 +1 @@ +{"version":"5.1-SNAPSHOT","issues":[{"key":"0ae8428f-42a6-4b44-befc-512f1846fdad","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":1,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"215429f4-fa2e-4611-a75b-abb4330ea36b","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":4,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"2b5d88b5-acc5-4761-bf47-3d6d46435c59","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":10,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"50fb32b3-61af-4efa-b234-5a5b048d72a1","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":16,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"52911422-9c22-4a40-982f-c7fa779e3b2c","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":2,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"5b0da657-2183-42ae-b0f9-595a0f59de17","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":15,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"70bac047-8559-4c72-bc2d-7584df7e4a0b","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":12,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"8843a921-b9bd-4837-ae0b-423d01b2476d","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":14,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"b227df4a-78e1-4624-9f48-589000d26fe9","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":8,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"b6f8a23f-de5a-4ec2-a549-ace73f0e0667","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":9,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"c7aef709-5210-4ff2-a237-be915ad611bb","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":13,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"c86663e2-6b98-4e9f-80c3-3cdea013f816","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":11,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"cddb488f-37ba-42a6-9f2a-09090c2f1c8e","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":3,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"e1d513d2-b165-41a5-9874-b0dc01fef619","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":6,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"e49d6d6e-3e2d-425b-b531-fe761757b773","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":5,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"},{"key":"f2ba9cdb-7efe-413f-981c-e6421861db46","component":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","line":7,"message":"This issue is generated on each line","severity":"MAJOR","rule":"xoo:OneIssuePerLine","status":"OPEN","isNew":false,"creationDate":"2013-05-01T00:00:00+0200"}],"components":[{"key":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1"},{"key":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","path":"src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo","moduleKey":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1","status":"SAME"},{"key":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1:src/main/xoo/com/sonar/it/samples/modules/a1","path":"src/main/xoo/com/sonar/it/samples/modules/a1","moduleKey":"com.sonarsource.it.samples:multi-modules-sample:module_a:module_a1"}],"rules":[{"key":"xoo:OneIssuePerLine","rule":"OneIssuePerLine","repository":"xoo","name":"One Issue Per Line"}],"users":[]}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo new file mode 100644 index 00000000000..74d29a4fa08 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a1/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo new file mode 100644 index 00000000000..42039538a92 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_a/module_a2/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/sonar-project.properties new file mode 100644 index 00000000000..b07be6f3e6f --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/multi-modules-sample/sonar-project.properties @@ -0,0 +1,31 @@ +# 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 + +module_a.sonar.projectKey=module_a +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.projectKey=module_b +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/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/sonar-project.properties new file mode 100644 index 00000000000..0c8e5dc5354 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=sample-multiline +sonar.projectName=Sample Multiline +sonar.projectVersion=0.1-SNAPSHOT +sonar.sources=xources diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiline.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiline.xoo new file mode 100644 index 00000000000..6e8a35f20a5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiline.xoo @@ -0,0 +1,9 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + {xoo-start-issue:1}System.out + .println("Hello"){xoo-end-issue:1}; + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiple.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiple.xoo new file mode 100644 index 00000000000..b6b1b8369a4 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Multiple.xoo @@ -0,0 +1,9 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + {xoo-start-issue:1}System.out.println("Hello"){xoo-end-issue:1}; + {xoo-start-flow:1:1:1}System.out.println("World"){xoo-end-flow:1:1:1}; + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Single.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Single.xoo new file mode 100644 index 00000000000..fc664425a99 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/Single.xoo @@ -0,0 +1,8 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + {xoo-start-issue:1}System.out.println("Hello"){xoo-end-issue:1}; + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/WithFlow.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/WithFlow.xoo new file mode 100644 index 00000000000..9dc4685fe84 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-multiline/xources/hello/WithFlow.xoo @@ -0,0 +1,14 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + {xoo-start-flow:1:1:1}if (true){xoo-end-flow:1:1:1} { + {xoo-start-flow:1:1:2}if (true){xoo-end-flow:1:1:2} { + {xoo-start-issue:1}if (true){xoo-end-issue:1} { + System.out.println("Hello"); + } + } + } + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/sonar-project.properties new file mode 100644 index 00000000000..58f27e81f61 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=sample-with-empty-file +sonar.projectName=Sample With Empty +sonar.projectVersion=0.1-SNAPSHOT +sonar.sources=xources +sonar.language=xoo diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/Empty.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/Empty.xoo new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/Empty.xoo diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/HelloJava.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/HelloJava.xoo new file mode 100644 index 00000000000..1d9c60d56b7 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-empty-file/xources/hello/HelloJava.xoo @@ -0,0 +1,8 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + System.out.println("Hello"); + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/.gitignore b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/.gitignore new file mode 100644 index 00000000000..ecbefd4f19d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/.gitignore @@ -0,0 +1 @@ +.sonar diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/sonar-project.properties new file mode 100644 index 00000000000..8810e376701 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=0.1-SNAPSHOT +sonar.sources=xources +sonar.tests=testx +sonar.language=xoo diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/testx b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/testx new file mode 120000 index 00000000000..7385ebd51cf --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/testx @@ -0,0 +1 @@ +../sample/testx/
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/xources b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/xources new file mode 120000 index 00000000000..15dca9d90d2 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample-with-symlink/xources @@ -0,0 +1 @@ +../sample/xources/
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/sonar-project.properties b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/sonar-project.properties new file mode 100644 index 00000000000..8810e376701 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=sample +sonar.projectName=Sample +sonar.projectVersion=0.1-SNAPSHOT +sonar.sources=xources +sonar.tests=testx +sonar.language=xoo diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo new file mode 100644 index 00000000000..8c0967e496f --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo @@ -0,0 +1,11 @@ +package org.sonar.tests; + +import org.junit.Test; + +public class ClassOneTest { + + @Test + public void nothing() { + + } +} diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.measures b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.measures new file mode 100644 index 00000000000..23b08dc0e0e --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.measures @@ -0,0 +1,7 @@ +lines:11 +ncloc:7 +tests:1 +test_execution_time:1 +skipped_tests:0 +test_errors:0 +test_failures:0 diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.scm b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.scm new file mode 100644 index 00000000000..2cec35b8a72 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/testx/ClassOneTest.xoo.scm @@ -0,0 +1,11 @@ +1,user1,2013-01-04 +1,user1,2013-01-04 +1,user1,2013-01-04 +1,user1,2013-01-04 +2,user2,2013-01-05 +2,user2,2013-01-05 +3,user3,2013-01-06 +4,user4,2013-01-07 +4,user4,2013-01-07 +4,user4,2013-01-07 +4,user4,2013-01-07
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo new file mode 100644 index 00000000000..1d9c60d56b7 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo @@ -0,0 +1,8 @@ +package hello; + +public class HelloJava { + + public static void main(String[] args) { + System.out.println("Hello"); + } +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.measures b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.measures new file mode 100644 index 00000000000..9eaf8ba2549 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.measures @@ -0,0 +1,2 @@ +ncloc:3 +complexity:1 diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.scm b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.scm new file mode 100644 index 00000000000..03a9de2f486 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/HelloJava.xoo.scm @@ -0,0 +1,8 @@ +1,user1,2013-01-04 +1,user1,2013-01-04 +1,user1,2013-01-04 +1,user1,2013-01-04 +2,user2,2013-01-05 +2,user2,2013-01-05 +3,user3,2013-01-06 +4,user4,2013-01-07
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo new file mode 100644 index 00000000000..53cb085156c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo @@ -0,0 +1,6 @@ + object HelloWorld { + def main(args: Array[String]) { + println("Hello, world of xoo!") + } + } +
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo.measures b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo.measures new file mode 100644 index 00000000000..d2c8386aed1 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/mediumtest/xoo/sample/xources/hello/helloscala.xoo.measures @@ -0,0 +1,2 @@ +ncloc:5 +complexity:2 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/bootstrap/BatchPluginJarExploderTest/sonar-checkstyle-plugin-2.8.jar b/sonar-scanner-engine/src/test/resources/org/sonar/batch/bootstrap/BatchPluginJarExploderTest/sonar-checkstyle-plugin-2.8.jar Binary files differnew file mode 100644 index 00000000000..f937399bec5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/bootstrap/BatchPluginJarExploderTest/sonar-checkstyle-plugin-2.8.jar diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/api_rules_list.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/api_rules_list.protobuf Binary files differnew file mode 100644 index 00000000000..1d417ce2880 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/api_rules_list.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_issues.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_issues.protobuf Binary files differnew file mode 100644 index 00000000000..8b610d8f73c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_issues.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_project.json b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_project.json new file mode 100644 index 00000000000..2887ce18d10 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_project.json @@ -0,0 +1,164 @@ +{ + "timestamp": 0, + "qprofilesByLanguage": { + "java": { + "key": "java-sonar-way-72608", + "name": "Sonar way", + "language": "java", + "rulesUpdatedAt": "2015-08-10T12:06:53+0200" + } + }, + "activeRules": [ + { + "repositoryKey": "common-java", + "ruleKey": "DuplicatedBlocks", + "name": "Source files should not have any duplicated blocks", + "severity": "MAJOR", + "language": "java", + "params": {} + }, + { + "repositoryKey": "common-java", + "ruleKey": "InsufficientBranchCoverage", + "name": "Branches should have sufficient coverage by unit tests", + "severity": "MAJOR", + "language": "java", + "params": { + "minimumBranchCoverageRatio": "65.0" + } + }, + { + "repositoryKey": "squid", + "ruleKey": "RightCurlyBraceStartLineCheck", + "name": "A close curly brace should be located at the beginning of a line", + "severity": "MINOR", + "internalKey": "RightCurlyBraceStartLineCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "UselessParenthesesCheck", + "name": "Useless parentheses around expressions should be removed to prevent any misunderstanding", + "severity": "MAJOR", + "internalKey": "UselessParenthesesCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "ObjectFinalizeCheck", + "name": "The Object.finalize() method should not be called", + "severity": "CRITICAL", + "internalKey": "ObjectFinalizeCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "ObjectFinalizeOverridenCheck", + "name": "The Object.finalize() method should not be overriden", + "severity": "CRITICAL", + "internalKey": "ObjectFinalizeOverridenCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "ObjectFinalizeOverridenCallsSuperFinalizeCheck", + "name": "super.finalize() should be called at the end of Object.finalize() implementations", + "severity": "BLOCKER", + "internalKey": "ObjectFinalizeOverridenCallsSuperFinalizeCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "ClassVariableVisibilityCheck", + "name": "Class variable fields should not have public accessibility", + "severity": "MAJOR", + "internalKey": "ClassVariableVisibilityCheck", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S2188", + "name": "JUnit test cases should call super methods", + "severity": "CRITICAL", + "internalKey": "S2188", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S2186", + "name": "JUnit assertions should not be used in \"run\" methods", + "severity": "CRITICAL", + "internalKey": "S2186", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S2187", + "name": "TestCases should contain tests", + "severity": "MAJOR", + "internalKey": "S2187", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S2391", + "name": "JUnit framework methods should be declared properly", + "severity": "CRITICAL", + "internalKey": "S2391", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S2325", + "name": "\"private\" methods that don\u0027t access instance data should be \"static\"", + "severity": "MINOR", + "internalKey": "S2325", + "language": "java", + "params": {} + }, + { + "repositoryKey": "squid", + "ruleKey": "S1166", + "name": "Exception handlers should preserve the original exception", + "severity": "CRITICAL", + "internalKey": "S1166", + "language": "java", + "params": { + "exceptions": "java.lang.InterruptedException, java.lang.NumberFormatException, java.text.ParseException, java.net.MalformedURLException" + } + }, + { + "repositoryKey": "squid", + "ruleKey": "S2970", + "name": "Assertions should be complete", + "severity": "CRITICAL", + "internalKey": "S2970", + "language": "java", + "params": {} + } + + ], + "settingsByModule": {}, + "fileDataByModuleAndPath": { + "org.codehaus.sonar-plugins:sonar-scm-git-plugin": { + "src/test/java/org/sonar/plugins/scm/git/JGitBlameCommandTest.java": { + "needBlame": true + }, + "src/main/java/org/sonar/plugins/scm/git/GitScmProvider.java": { + "hash": "90082117d0dc0f1189ab7e4990a20667", + "needBlame": true + } + } + }, + "lastAnalysisDate": "2015-08-10T13:20:09+0200" +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_users.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_users.protobuf new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cache/ProjectCacheSynchronizerTest/batch_users.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/cpd/ManyStatements.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cpd/ManyStatements.java new file mode 100644 index 00000000000..ed2297068e4 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/cpd/ManyStatements.java @@ -0,0 +1,11 @@ +package org.foo; + +public class ManyStatements { + + void foo() { + int A1 = 0; int B = 0; int C = 0; int D = 0; int E = 0; int F = 0; int G = 0; int H = 0; int I = 0; int J = 0; int K = 0; + int A2 = 0; int B = 0; int C = 0; int D = 0; int E = 0; int F = 0; int G = 0; int H = 0; int I = 0; int J = 0; int K = 0; + int A1 = 0; int B = 0; int C = 0; int D = 0; int E = 0; int F = 0; int G = 0; int H = 0; int I = 0; int J = 0; int K = 0; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-mess.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-mess.txt new file mode 100644 index 00000000000..48d30c92f97 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-mess.txt @@ -0,0 +1,37 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // FOO-OFF + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + // SONAR-ON + for (int index = from; index <= to; index++) { + lines.add(index); + } + // FOO-ON + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-twice.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-twice.txt new file mode 100644 index 00000000000..9ae63dc57f9 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-twice.txt @@ -0,0 +1,37 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + // FOO-OFF + for (int index = from; index <= to; index++) { + lines.add(index); + } + // FOO-ON + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-unfinished.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-unfinished.txt new file mode 100644 index 00000000000..dd7656180ab --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-unfinished.txt @@ -0,0 +1,34 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-wrong-order.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-wrong-order.txt new file mode 100644 index 00000000000..7cac0b98aed --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp-wrong-order.txt @@ -0,0 +1,35 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-ON + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-OFF + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp.txt new file mode 100644 index 00000000000..002169fe031 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-double-regexp.txt @@ -0,0 +1,35 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + // SONAR-OFF + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-no-regexp.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-no-regexp.txt new file mode 100644 index 00000000000..f18fa5b90ad --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-no-regexp.txt @@ -0,0 +1,33 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt new file mode 100644 index 00000000000..e09ecd7a323 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp-and-double-regexp.txt @@ -0,0 +1,36 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + + // SONAR-OFF + +import java.util.Set; + +/** + * @SONAR-IGNORE-ALL + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + // SONAR-ON + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp.txt new file mode 100644 index 00000000000..ef135ebc50c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/issue/ignore/scanner/IssueExclusionsRegexpScannerTest/file-with-single-regexp.txt @@ -0,0 +1,33 @@ +package org.sonar.plugins.switchoffviolations.pattern; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * @SONAR-IGNORE-ALL + */ +public class LineRange { + int from, to; + + public LineRange(int from, int to) { + if (to < from) { + throw new IllegalArgumentException("Line range is not valid: " + from + " must be greater than " + to); + } + this.from = from; + this.to = to; + } + + public boolean in(int lineId) { + return from <= lineId && lineId <= to; + } + + public Set<Integer> toLines() { + Set<Integer> lines = Sets.newLinkedHashSet(); + for (int index = from; index <= to; index++) { + lines.add(index); + } + return lines; + } + +}
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest/project.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest/project.protobuf Binary files differnew file mode 100644 index 00000000000..ce579fdbd5e --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest/project.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultQualityProfileLoaderTest/quality_profile_search_default b/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultQualityProfileLoaderTest/quality_profile_search_default Binary files differnew file mode 100644 index 00000000000..6780d7338a1 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/repository/DefaultQualityProfileLoaderTest/quality_profile_search_default diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf Binary files differnew file mode 100644 index 00000000000..5544968df4b --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search1.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf Binary files differnew file mode 100644 index 00000000000..a23bd1d5d81 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultActiveRulesLoaderTest/active_rule_search2.protobuf diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultRulesLoader/response.protobuf b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultRulesLoader/response.protobuf new file mode 100644 index 00000000000..3c24dd83d29 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/DefaultRulesLoader/response.protobuf @@ -0,0 +1,637 @@ + +i +common-javaInsufficientCommentDensity">Source files should have a sufficient density of comment lines +S +common-javaDuplicatedBlocks"2Source files should not have any duplicated blocks +U +common-javaSkippedUnitTests"4Skipped unit tests should be either removed or fixed +\ +common-javaInsufficientLineCoverage"3Lines should have sufficient coverage by unit tests +A +common-javaFailedUnitTests"!Failed unit tests should be fixed +a +common-javaInsufficientBranchCoverage"6Branches should have sufficient coverage by unit tests +“ +squidUselessParenthesesCheckUselessParenthesesCheck"XUseless parentheses around expressions should be removed to prevent any misunderstanding +Z +squidS2134S2134"CClasses extending java.lang.Thread should override the "run" method +; +squidS138S138"&Methods should not have too many lines +G +squidS2133S2133"0Objects should not be created only to "getClass" +M +squidS1294S1294"6The Array.equals(Object obj) method should not be used +R +squidS2131S2131";Primitives should not be boxed just for "String" conversion +` +squidS135S135"KLoops should not contain more than a single "break" or "continue" statement +< +squidS1150S1150"%Enumeration should not be implemented +K +squidS1151S1151"4"switch case" clauses should not have too many lines +M +squidS1939S1939"6Extensions and implementations should not be redundant +E +squidS2039S2039".Member variable visibility should be specified +L +squidNoSonarNoSonar"1"NOSONAR" should not be used to switch off issues +> +squidS2232S2232"'"ResultSet.isLast()" should not be used +f +squidS1943S1943"OClasses and methods that rely on the default system encoding should not be used +m +squidS1158S1158"VPrimitive wrappers should not be instantiated only for "toString" or "compareTo" calls +H +squidS2230S2230"1Non-public methods should not be "@Transactional" +t +squidS1157S1157"]Case insensitive string comparisons should be made without intermediate upper or lower casing +P +squidS1155S1155"9Collection.isEmpty() should be used to test for emptiness +s +squidS2236S2236"\Methods "wait(...)", "notify()" and "notifyAll()" should never be called on Thread instances +b +squidS1948S1948"KFields in a "Serializable" class should either be transient or serializable +J +squidS1153S1153"3String.valueOf() should not be appended to a String +H +squidS2235S2235"1IllegalMonitorStateException should not be caught +b +squidS1764S1764"KIdentical expressions should not be used on both sides of a binary operator +P +squidS2130S2130"9Parsing should be used to convert "Strings" to primitives +s +squidUndocumentedApiUndocumentedApi"HPublic types, methods and fields (API) should be documented with Javadoc += +squidS2333S2333"&Redundant modifiers should not be used +o +squidTrailingCommentCheckTrailingCommentCheck":Comments should not be located at the end of lines of code +m +squidMaximumInheritanceDepthMaximumInheritanceDepth"2Inheritance tree of classes should not be too deep +< +squidS1940S1940"%Boolean checks should not be inverted +L +squidS1699S1699"5Constructors should only call non-overridable methods +T +squidS128S128"?Switch cases should end with an unconditional "break" statement +M +squidS2127S2127"6"Double.longBitsToDouble" should not be used for "int" +X +squidCallToDeprecatedMethodCallToDeprecatedMethod"Avoid use of deprecated methods +] +squidS888S888"HRelational operators should be used in "for" loop termination conditions +A +squidS2123S2123"*Values should not be uselessly incremented +S +squidS2122S2122"<"ScheduledThreadPoolExecutor" should not have 0 core threads +P +squidS1160S1160"9Public methods should throw at most one checked exception + +squidS1161S1161"x"@Override" annotation should be used on any method overriding (since Java 5) or implementing (since Java 6) another one +W +squidS1694S1694"@An abstract class should have both abstract and concrete methods += +squidS1162S1162"&Checked Exception should not be thrown +K +squidS00101S00101"2Class names should comply with a naming convention +M +squidS1695S1695"6"NullPointerException" should not be explicitly thrown +L +squidS00100S00100"3Method names should comply with a naming convention +B +squidS1696S1696"+"NullPointerException" should not be caught +n +squidS1697S1697"WShort-circuit logic should be used to prevent null pointer dereferences in conditionals +A +squidS1698S1698"*Objects should be compared with "equals()" +V +squidS1168S1168"?Empty arrays and collections should be returned instead of null +r +squidStringEqualityComparisonCheckStringEqualityComparisonCheck"+Strings should be compared using "equals()" +/ +squidS2222S2222"Locks should be released +[ +squidHiddenFieldCheckHiddenFieldCheck".Local variables should not shadow class fields +? +squidS2326S2326"(Unused type parameters should be removed +H +squidS1163S1163"1Exceptions should not be thrown in finally blocks +P +squidS2225S2225"9"toString()" and "clone()" methods should not return null +P +squidS1166S1166"9Exception handlers should preserve the original exception +< +squidS1165S1165"%Exception classes should be immutable +I +squidS2226S2226"2Servlets should never have mutable instance fields +S +squidArchitecturalConstraintArchitecturalConstraint"Architectural constraint +u +squidS134S134"`Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply +[ +squidS2325S2325"D"private" methods that don't access instance data should be "static" +J +squidS2156S2156"3"final" classes should not have "protected" members +z +squidS2154S2154"cDissimilar primitive wrappers should not be used with the ternary operator without explicit casting +M +squidS2153S2153"6Boxing and unboxing should not be immediately reversed +? +squidS2159S2159"(Silly equality checks should not be made +< +squidS2157S2157"%"Cloneables" should implement "clone" +A +squidS1172S1172"*Unused method parameters should be removed +R +squidS1479S1479";"switch" statements should not have too many "case" clauses + +squidS1170S1170"jPublic constants and fields initialized at declaration should be "static final" rather than merely "final" +D +squidS1171S1171"-Only static class initializers should be used +] +squidS1175S1175"FThe signature of "finalize()" should match that of "Object.finalize()" +b +squidS1174S1174"K"Object.finalize()" should remain protected (versus public) when overriding +A +squidS2151S2151"*"runFinalizersOnExit" should not be called +f +squidCallToFileDeleteOnExitMethodCallToFileDeleteOnExitMethod"!"deleteOnExit" should not be used +Z +squidLabelsShouldNotBeUsedCheckLabelsShouldNotBeUsedCheck"Labels should not be used +e +squidS1488S1488"NLocal Variables should not be declared and then immediately returned or thrown +Z +squidS3008S3008"CStatic non-final field names should comply with a naming convention +{ +squidSwitchLastCaseIsDefaultCheckSwitchLastCaseIsDefaultCheck"6"switch" statements should end with a "default" clause +Ë +squid,RightCurlyBraceDifferentLineAsNextBlockCheck,RightCurlyBraceDifferentLineAsNextBlockCheck"fClose curly brace and the next "else", "catch" and "finally" keywords should be on two different lines +d +squidModifiersOrderCheckModifiersOrderCheck"1Modifiers should be declared in the correct order +? +squidS1181S1181"(Throwable and Error should not be caught +9 +squidS1905S1905""Redundant casts should not be used +c +squidS1182S1182"LClasses that override "clone" should be "Cloneable" and call "super.clone()" +j +squidS2201S2201"SReturn values should not be ignored when function calls don't have any side effects +2 +squidS1186S1186"Methods should not be empty += +squidS1872S1872"&Classes should not be compared by name +R +squidS2438S2438";"Threads" should not be used where "Runnables" are expected +u +squidS1871S1871"^Two branches in the same conditional structure should not have exactly the same implementation +l +squidS1185S1185"UOverriding methods should do more than simply call the same method in the super class +S +squidS1188S1188"<Lambdas and anonymous classes should not have too many lines +@ +squidS1873S1873")"static final" arrays should be "private" +\ +squidS2204S2204"E".equals()" should not be used to test the values of "Atomic" classes +C +squidS2437S2437",Silly bit operations should not be performed +T +squidS2200S2200"="compareTo" results should not be checked for specific values +R +squidUselessImportCheckUselessImportCheck"!Useless imports should be removed +E +squidS2209S2209"."static" members should be accessed statically +? +squidS1481S1481"(Unused local variables should be removed +€ +squidMissingDeprecatedCheckMissingDeprecatedCheck"GDeprecated elements should have both the annotation and the Javadoc tag +: +squidS2208S2208"#Wildcard imports should not be used +> +squidS1774S1774"'The ternary operator should not be used +V +squidS2272S2272"?"Iterator.next()" methods should throw "NoSuchElementException" +‰ +squidS2273S2273"r"wait(...)", "notify()" and "notifyAll()" methods should only be called when a lock is obviously held on an object +a +squidLowerCaseLongSuffixCheckLowerCaseLongSuffixCheck"$Long suffix "L" should be upper case +C +squidS2786S2786",Nested "enum"s should not be declared static +J +squidS1118S1118"3Utility classes should not have public constructors +z +squidS2277S2277"cCryptographic RSA algorithms should always incorporate OAEP (Optimal Asymmetric Encryption Padding) +a +squidUnusedProtectedMethodUnusedProtectedMethod"*Unused protected methods should be removed +d +squidS2276S2276"M"wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held +d +squidS2275S2275"MPrintf-style format strings should not lead to unexpected behavior at runtime +k +squidS2274S2274"T"Object.wait(...)" and "Condition.await(...)" should be called inside a "while" loop +c +squidCommentedOutCodeLineCommentedOutCodeLine".Sections of code should not be "commented out" +^ +squidS2278S2278"GNeither DES (Data Encryption Standard) nor DESede (3DES) should be used +C +squidS2912S2912","indexOf" checks should use a start position +< +squidS1656S1656"%Variables should not be self-assigned +Q +squidS1659S1659":Multiple variables should not be declared on the same line +L +squidS1264S1264"5A "while" loop should be used instead of a "for" loop +Y +squidS1125S1125"BLiteral boolean values should not be used in condition expressions +k +squidS1126S1126"TReturn of boolean expressions should not be wrapped into an "if-then-else" statement + +squidClassVariableVisibilityCheckClassVariableVisibilityCheck":Class variable fields should not have public accessibility +H +squidS2250S2250"1"ConcurrentLinkedQueue.size()" should not be used +M +squidS1643S1643"6Strings should not be concatenated using '+' in a loop +` +squidS2251S2251"IA "for" loop update clause should move the counter in the right direction +Z +squidS1640S1640"CMaps with keys that are enum values should be replaced with EnumMap +E +squidS2118S2118".Non-serializable classes should not be written +B +squidS00112S00112")Generic exceptions should never be thrown +> +squidS2111S2111"'"BigDecimal(double)" should not be used +H +squidS2112S2112"1"URL.hashCode" and "URL.equals" should be avoided +? +squidS2110S2110"(Invalid "Date" values should not be used +X +squidS2116S2116"A"hashCode" and "toString" should not be called on array instances +J +squidS2391S2391"3JUnit framework methods should be declared properly +Y +squidS2114S2114"BCollections should not be passed as arguments to their own methods +? +squidS2259S2259"(Null pointers should not be dereferenced +d +squidS1132S1132"MStrings literals should be placed on the left side when checking for equality +D +squidS00107S00107"+Methods should not have too many parameters +c +squidS2258S2258"L"javax.crypto.NullCipher" should not be used for anything other than testing +C +squidS1133S1133",Deprecated code should be removed eventually +L +squidS2257S2257"5Only standard cryptographic algorithms should be used +G +squidS00108S00108".Nested blocks of code should not be left empty +5 +squidS00103S00103"Lines should not be too long +V +squidS2254S2254"?"HttpServletRequest.getRequestedSessionId()" should not be used +< +squidS2253S2253"%Disallowed methods should not be used +5 +squidS1134S1134""FIXME" tags should be handled +A +squidS00105S00105"(Tabulation characters should not be used +C +squidS2252S2252",Loop conditions should be true at least once +4 +squidS1135S1135""TODO" tags should be handled += +squidS00104S00104"$Files should not have too many lines +? +squidS00122S00122"&Statements should be on separate lines +M +squidS00120S00120"4Package names should comply with a naming convention +U +squidS2109S2109">Reflection should not be used to check non-runtime annotations +J +squidS00121S00121"1Control structures should always use curly braces +j +squidS2676S2676"SNeither "Math.abs" nor negation should be used on numbers that could be "MIN_VALUE" +I +squidS2677S2677"2"read" and "readLine" return values should be used +N +squidS2674S2674"7The value returned from a stream read should be checked +@ +squidS2675S2675")"readObject" should not be "synchronized" +V +squidCycleBetweenPackagesCycleBetweenPackages"!Avoid cycle between java packages +h +squidS1149S1149"QSynchronized classes Vector, Hashtable, Stack and StringBuffer should not be used +O +squidS1244S1244"8Floating point numbers should not be tested for equality +P +squidS2384S2384"9Mutable members should not be stored or returned directly +{ +squidLeftCurlyBraceEndLineCheckLeftCurlyBraceEndLineCheck":An open curly brace should be located at the end of a line +Q +squidS2387S2387":Child class members should not shadow parent class members +P +squidS2386S2386"9Interfaces should not have "public static" mutable fields +U +squidS2388S2388">Inner class calls to super class methods should be unambiguous +< +squidS1141S1141"%Try-catch blocks should not be nested +L +squidS1142S1142"5Methods should not contain too many return statements +T +squidS00119S00119";Type parameter names should comply with a naming convention +c +squidS2245S2245"LPseudorandom number generators (PRNGs) should not be used in secure contexts +O +squidS1143S1143"8"return" statements should not occur in "finally" blocks +T +squidS00118S00118";Abstract class names should comply with a naming convention +i +squidS00117S00117"PLocal variable and method parameter names should comply with a naming convention +] +squidS1145S1145"FUseless "if(true) {...}" and "if(false){...}" blocks should be removed +K +squidS00116S00116"2Field names should comply with a naming convention +N +squidS00115S00115"5Constant names should comply with a naming convention +… +squidLeftCurlyBraceStartLineCheckLeftCurlyBraceStartLineCheck"@An open curly brace should be located at the beginning of a line +8 +squidS1147S1147"!Exit methods should not be called +O +squidS00114S00114"6Interface names should comply with a naming convention +J +squidS1148S1148"3Throwable.printStackTrace(...) should not be called +J +squidS00113S00113"1Files should contain an empty new line at the end +] +squidS1215S1215"FExecution of the Garbage Collector should be triggered only by the JVM +T +squidS1217S1217"=Thread.run() and Runnable.run() should not be called directly +A +squidS2188S2188"*JUnit test cases should call super methods +M +squidS1219S1219"6"switch" statements should not contain non-case labels +K +squidS2186S2186"4JUnit assertions should not be used in "run" methods +5 +squidS2187S2187"TestCases should contain tests +i +squidS1210S1210"R"equals(Object obj)" should be overridden along with the "compareTo(T obj)" method +D +squidS1214S1214"-Constants should not be defined in interfaces +o +squidS1609S1609"X@FunctionalInterface annotation should be used to flag Single Abstract Method interfaces +l +squidS1213S1213"UThe members of an interface declaration or class should appear in a pre-defined order +d +squidObjectFinalizeCheckObjectFinalizeCheck"1The Object.finalize() method should not be called +< +squidS2089S2089"%HTTP referers should not be relied on +s +squidS1611S1611"\Parentheses should be removed from a single lambda input parameter when its type is inferred +J +squidS2681S2681"3Multiline blocks should be enclosed in curly braces +K +squidS1612S1612"4Replace lambdas with method references when possible +9 +squidS2185S2185""Silly math should not be performed +E +squidS2184S2184".Math operands should be cast before assignment +X +squidS1610S1610"AAbstract classes without fields should be converted to interfaces +_ +squidS2183S2183"HInts and longs should not be shifted by more than their number of bits-1 +8 +squid EmptyFile EmptyFile"Files should not be empty +N +squidS1228S1228"7Packages should have a javadoc file 'package-info.java' +Z +squidUnusedPrivateMethodUnusedPrivateMethod"'Unused private method should be removed +j +squidS1226S1226"SMethod parameters, caught exceptions and foreach variables should not be reassigned +P +squidS2197S2197"9Modulus results should not be checked for direct equality +ƒ +squidAssignmentInSubExpressionCheckAssignmentInSubExpressionCheck":Assignments should not be made from within sub-expressions +H +squidS1221S1221"1Methods should not be named "hashcode" or "equal" +E +squidS1220S1220".The default unnamed package should not be used +1 +squidS2092S2092"Cookies should be "secure" +2 +squidS2094S2094"Classes should not be empty +1 +squidS2095S2095"Resources should be closed +9 +squidS2096S2096"""main" should not "throw" anything +c +squidS1223S1223"LNon-constructor methods should not have the same name as the enclosing class +E +squidS2097S2097"."equals(Object obj)" should test argument type +K +squidS2696S2696"4Instance methods should not write to "static" fields +6 +squidS2699S2699"Tests should include assertions +? +squidS2698S2698"(JUnit assertions should include messages +D +squidS2693S2693"-Threads should not be started in constructors +J +squidS2692S2692"3"indexOf" checks should not be for positive numbers +f +squidS2695S2695"O"PreparedStatement" and "ResultSet" methods should be called with valid indices +c +squidS2694S2694"LInner classes which do not reference their owning classes should be "static" +I +squidS2885S2885"2"Calendars" and "DateFormats" should not be static +] +squidS2166S2166"FClasses named like "Exception" should extend "Exception" or a subclass +H +squidS2167S2167"1"compareTo" should not return "Integer.MIN_VALUE" += +squidS2164S2164"&Math should not be performed on floats +A +squidS2165S2165"*"finalize" should not set fields to "null" +s +squidS1994S1994"\"for" loop incrementers should modify the variable being tested in the loop's stop condition +x +squidRedundantThrowsDeclarationCheckRedundantThrowsDeclarationCheck"-Throws declarations should not be superfluous +S +squidS2162S2162"<"equals" methods should be symmetric and work for subclasses +J +squidS2160S2160"3Subclasses that add fields should override "equals" +J +squidS2175S2175"3Inappropriate "Collection" calls should not be made +o +squidForLoopCounterChangedCheckForLoopCounterChangedCheck"."for" loop stop conditions should be invariant +O +squidS2176S2176"8Class names should not shadow interfaces or superclasses +M +squidS2178S2178"6Short-circuit logic should be used in boolean contexts +T +squidS1700S1700"=A field should not duplicate the name of its containing class +Z +squidS1206S1206"C"equals(Object obj)" and "hashCode()" should be overridden in pairs +K +squidS1701S1701"4Fields and methods should not have conflicting names +S +squidS1201S1201"<Methods named "equals" should override Object.equals(Object) +p +squidS1200S1200"YClasses should not be coupled to too many other classes (Single Responsibility Principle) +` +squidClassCyclomaticComplexityClassCyclomaticComplexity"!Classes should not be too complex +f +squidS1602S1602"OLamdbas containing only one statement should not nest this statement in a block +_ +squidS1604S1604"HAnonymous inner classes containing only one method should become lambdas +J +squidS1309S1309"3The @SuppressWarnings annotation should not be used +K +squidS1607S1607"4Skipped unit tests should be either removed or fixed +P +squidS1301S1301"9"switch" statements should have at least 3 "case" clauses +1 +squidS2446S2446""notifyAll" should be used +r +squidS2445S2445"[Blocks synchronized on fields should not contain assignments of new objects to those fields +V +squidS2444S2444"?Lazy initialization of "static" fields should be "synchronized" +M +squidS1858S1858"6"toString()" should never be called on a String object +y +squidObjectFinalizeOverridenCheckObjectFinalizeOverridenCheck"4The Object.finalize() method should not be overriden +B +squidS2442S2442"+"Lock" objects should not be "synchronized" +V +squidS2441S2441"?Non-serializable objects should not be stored in "HttpSessions" +T +squidS2440S2440"=Classes with only "static" methods should not be instantiated +C +squidS1710S1710",Annotation repetitions should not be wrapped +] +squidS2583S2583"FConditions should not unconditionally evaluate to "TRUE" or to "FALSE" +d +squidS1850S1850"M"instanceof" operators that always return "true" or "false" should be removed +J +squidS2447S2447"3Null should not be returned from a "Boolean" method +F +squidS1310S1310"/"NOPMD" suppression comments should not be used +d +squidS864S864"OLimited dependence should be placed on operator precedence rules in expressions +; +squidS1313S1313"$IP addresses should not be hardcoded +d +squidS1312S1312"MLoggers should be "private static final" and should share a naming convention +š +squidS1319S1319"‚Declarations should use Java collection interfaces such as "List" rather than specific implementation classes such as "LinkedList" +W +squidS1318S1318"@"object == null" should be used instead of "object.equals(null)" +U +squidS1452S1452">Generic wildcard types should not be used in return parameters +F +squidS1451S1451"/Copyright and license headers should be defined +X +squidIndentationCheckIndentationCheck"+Source code should be indented consistently +_ +squidS2718S2718"H"DateUtils.truncate" from Apache Commons Lang library should not be used +O +squidS1315S1315"8"CHECKSTYLE:OFF" suppression comments should not be used +6 +squidS1314S1314"Octal values should not be used +e +squidS1317S1317"N"StringBuilder" and "StringBuffer" should not be instantiated with a character +Y +squidS1860S1860"BSynchronization should not be based on Strings or boxed primitives +Y +squidS1862S1862"BRelated "if/else if" statements should not have the same condition +[ +squidS1724S1724"DDeprecated classes and interfaces should not be extended/implemented +z +squidS881S881"eIncrement (++) and decrement (--) operators should not be mixed with other operators in an expression +8 +squidParsingErrorParsingError"Java parser failure +M +squidS1598S1598"6Package declaration should match source file directory +u +squidS2055S2055"^The non-serializable super class of a "Serializable" class must have a no-argument constructor +“ +squidS1596S1596"|Collections.emptyList(), emptyMap() and emptySet() should be used instead of Collections.EMPTY_LIST, EMPTY_MAP and EMPTY_SET +F +squidS2057S2057"/"Serializable" classes should have a version id +^ +squidS2059S2059"G"Serializable" inner classes of "Serializable" classes should be static +N +squidS2701S2701"7Literal boolean values should not be used in assertions +; +squidS2063S2063"$Comparators should be "Serializable" +Ã +squid'RightCurlyBraceSameLineAsNextBlockCheck'RightCurlyBraceSameLineAsNextBlockCheck"hClose curly brace and the next "else", "catch" and "finally" keywords should be located on the same line +V +squidS2061S2061"?Custom serialization method signatures should meet requirements +C +squidS1066S1066",Collapsible "if" statements should be merged +< +squidS1067S1067"%Expressions should not be too complex +_ +squidEmptyStatementUsageCheckEmptyStatementUsageCheck""Empty statements should be removed +b +squidMethodCyclomaticComplexityMethodCyclomaticComplexity"!Methods should not be too complex +6 +squidS1065S1065"Unused labels should be removed +> +squidS1068S1068"'Unused private fields should be removed +U +squidS2976S2976">"File.createTempFile" should not be used to create a directory +N +squidS2974S2974"7Classes without "public" constructors should be "final" +; +squidS2068S2068"$Credentials should not be hard-coded +4 +squidS2970S2970"Assertions should be complete +S +squidS2065S2065"<Fields in non-serializable classes should not be "transient" +b +squidS2066S2066"K"Serializable" inner classes of non-serializable classes should be "static" +U +squidS1197S1197">Array designators "[]" should be on the type, not the variable + +squidS1844S1844"j"Object.wait(...)" should never be called on objects that implement "java.util.concurrent.locks.Condition" +< +squidS1199S1199"%Nested code blocks should not be used +a +squidS1848S1848"JObjects should not be created to be dropped immediately without being used +K +squidS2301S2301"4Public methods should not contain selector arguments +M +squidS1849S1849"6"Iterator.hasNext()" should not call "Iterator.next()" +R +squidS2070S2070";SHA-1 and Message-Digest hash algorithms should not be used +‡ +squidRightCurlyBraceStartLineCheckRightCurlyBraceStartLineCheck"@A close curly brace should be located at the beginning of a line +] +squidS2864S2864"F"entrySet()" should be iterated when both the key and value are needed + +squidS1444S1444": +G +squidS1191S1191"0Classes from "sun.*" packages should not be used +B +squidS1190S1190"+Future keywords should not be used as names +^ +squidS1193S1193"GException types should not be tested using "instanceof" in catch blocks +G +squidS2076S2076"0Values passed to OS commands should be sanitized +H +squidS2077S2077"1Values passed to SQL commands should be sanitized +5 +squidS109S109" Magic numbers should not be used +? +squidS1192S1192"(String literals should not be duplicated +P +squidS106S106";Standard ouputs should not be used directly to log anything +c +squidS1195S1195"LArray designators "[]" should be located after the type in method signatures +H +squidS2078S2078"1Values passed to LDAP queries should be sanitized +º +squid.ObjectFinalizeOverridenCallsSuperFinalizeCheck.ObjectFinalizeOverridenCallsSuperFinalizeCheck"Qsuper.finalize() should be called at the end of Object.finalize() implementations +? +squidS1194S1194"("java.lang.Error" should not be extended
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/ModuleQProfilesTest/shared.xml b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/ModuleQProfilesTest/shared.xml new file mode 100644 index 00000000000..feb234f20e8 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/rule/ModuleQProfilesTest/shared.xml @@ -0,0 +1,19 @@ +<dataset> + + <rules_profiles id="1" name="Java One" language="java" parent_kee="[null]" kee="java-one" is_default="[false]" + created_at="2014-01-20" updated_at="2014-01-20" + rules_updated_at="2014-01-20T12:00:00+0000"/> + + <rules_profiles id="2" name="Java Two" language="java" parent_kee="[null]" kee="java-two" is_default="[false]" + created_at="2014-01-20" updated_at="2014-01-20" + rules_updated_at="2014-01-20T12:00:00+0000"/> + + <rules_profiles id="3" name="Php One" language="php" parent_kee="[null]" kee="php-one" is_default="[false]" + created_at="2014-01-20" updated_at="2014-01-20" + rules_updated_at="2014-01-20T12:00:00+0000"/> + + <rules_profiles id="4" name="Cobol One" language="cbl" parent_kee="[null]" kee="cobol-one" is_default="[false]" + created_at="2014-01-20" updated_at="2014-01-20" + rules_updated_at="2014-01-20T12:00:00+0000"/> + +</dataset> diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sonar-project.properties new file mode 100644 index 00000000000..7bace22a204 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sonar-project.properties @@ -0,0 +1 @@ +# Mandatory properties for module1 are all inferred from the module ID diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sources/Fake.java new file mode 100644 index 00000000000..9d445f04fc6 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module1/sources/Fake.java @@ -0,0 +1,5 @@ + +class Fake { + + +} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/newBaseDir/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/newBaseDir/src/Fake.java new file mode 100644 index 00000000000..22d579be381 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/newBaseDir/src/Fake.java @@ -0,0 +1 @@ +class Fake { } diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/sonar-project.properties new file mode 100644 index 00000000000..d25a9e9e1f5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/module2/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=com.foo.project.module2 +sonar.projectName=Foo Module 2 +# redefine some properties +sonar.projectBaseDir=newBaseDir +sonar.projectDescription=Description of Module 2 +sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/sonar-project.properties new file mode 100644 index 00000000000..4744284e7bf --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module-inherited/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,\ + module2 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sonar-project.properties new file mode 100644 index 00000000000..ec642a9443a --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=com.foo.project.module1 +sonar.projectName=Foo Module 1 +sonar.projectDescription=Description of Module 1 +sonar.sources=sources diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/newBaseDir/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/newBaseDir/src/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/newBaseDir/src/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/sonar-project.properties new file mode 100644 index 00000000000..d25a9e9e1f5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/module2/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=com.foo.project.module2 +sonar.projectName=Foo Module 2 +# redefine some properties +sonar.projectBaseDir=newBaseDir +sonar.projectDescription=Description of Module 2 +sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/sonar-project.properties new file mode 100644 index 00000000000..2f16886c91d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-definitions-in-each-module/sonar-project.properties @@ -0,0 +1,10 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,\ + module2 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/generated/any-file.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/generated/any-file.properties new file mode 100644 index 00000000000..c50d50b50f7 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/generated/any-file.properties @@ -0,0 +1,5 @@ +sonar.projectKey=com.foo.project.module1 +sonar.projectName=Foo Module 1 + +# and specify a different baseDir +sonar.projectBaseDir=.. diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/sonar-project.properties new file mode 100644 index 00000000000..c1640b15cba --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile-and-overwritten-basedir/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectConfigFile=any-folder/generated/any-file.properties diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/any-file.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/any-file.properties new file mode 100644 index 00000000000..460d3495a89 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/any-file.properties @@ -0,0 +1,2 @@ +sonar.projectKey=com.foo.project.module1 +sonar.projectName=Foo Module 1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/any-folder/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/sonar-project.properties new file mode 100644 index 00000000000..e246f8c2af8 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-configfile/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectConfigFile=any-folder/any-file.properties diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-unexisting-file/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-unexisting-file/sonar-project.properties new file mode 100644 index 00000000000..e246f8c2af8 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/DeprecatedProjectReactorBuilderTest/multi-module-with-unexisting-file/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectConfigFile=any-folder/any-file.properties diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module11/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module11/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module11/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module12/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module12/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module1/module12/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module2/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module2/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/module2/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/sonar-project.properties new file mode 100644 index 00000000000..e14567d26af --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/big-multi-module-definitions-all-in-root/sonar-project.properties @@ -0,0 +1,17 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes +sonar.profile=Foo + +sonar.modules=module1,module2 + + +module1.sonar.modules=module11,module12 + +module1.module11.property=My module11 property + diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/sonar-project.properties new file mode 100644 index 00000000000..53aacb54061 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=example +sonar.projectName=Example +sonar.projectVersion=1.0 + +sonar.modules=java-module,groovy-module + +java-module.sonar.language=java +java-module.sonar.projectBaseDir=. +java-module.sonar.sources=src/main/java + +groovy-module.sonar.language=groovy +groovy-module.sonar.projectBaseDir=. +groovy-module.sonar.sources=src/main/groovy diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/groovy/Fake.groovy b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/groovy/Fake.groovy new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/groovy/Fake.groovy diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/java/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/java/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-language-definitions-all-in-root/src/main/java/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module2/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module2/src/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/module2/src/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/sonar-project.properties new file mode 100644 index 00000000000..0f06d31466e --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-all-in-root/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,\ + module2 + +# Mandatory properties for module1 are all inferred from the module ID + +module2.sonar.projectKey=com.foo.project.module2 +module2.sonar.projectName=Foo Module 2 +# redefine some properties +module2.sonar.projectDescription=Description of Module 2 +module2.sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module2/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module2/src/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/module2/src/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/sonar-project.properties new file mode 100644 index 00000000000..6def8070d6f --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-moduleKey/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,\ + module2 + +# Mandatory properties for module1 are all inferred from the module ID + +module2.sonar.moduleKey=com.foo.project.module2 +module2.sonar.projectName=Foo Module 2 +# redefine some properties +module2.sonar.projectDescription=Description of Module 2 +module2.sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1.feature/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1.feature/src/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1.feature/src/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/sonar-project.properties new file mode 100644 index 00000000000..2a6221a3757 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-definitions-same-prefix/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,\ + module1.feature + +# Mandatory properties for module1 are all inferred from the module ID + +module1.feature.sonar.projectKey=com.foo.project.module1.feature +module1.feature.sonar.projectName=Foo Module 1 Feature +# redefine some properties +module1.feature.sonar.projectDescription=Description of Module 1 Feature +module1.feature.sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-duplicate-id/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-duplicate-id/sonar-project.properties new file mode 100644 index 00000000000..0a971805d13 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-duplicate-id/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1,module1 + +module1.sonar.sources=src diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/modules/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/sonar-project.properties new file mode 100644 index 00000000000..e63d3da926c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-repeated-id/sonar-project.properties @@ -0,0 +1,17 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectBaseDir=modules/module1 +module1.sonar.projectName=Foo Module 1 +module1.sonar.modules=module1 + +module1.module1.sonar.projectBaseDir=module1 +module1.module1.sonar.projectName=Foo Sub Module 1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/modules/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/modules/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/modules/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/sonar-project.properties new file mode 100644 index 00000000000..c572ef1f9e5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir-not-associated/sonar-project.properties @@ -0,0 +1,14 @@ +#sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectBaseDir=modules/module1 +module1.sonar.projectKey=com.foo.project.module1 +module1.sonar.projectName=Foo Module 1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/modules/module1/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/modules/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/modules/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/sonar-project.properties new file mode 100644 index 00000000000..615f5c77a7f --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-basedir/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectBaseDir=modules/module1 +module1.sonar.projectKey=com.foo.project.module1 +module1.sonar.projectName=Foo Module 1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/module1/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/module1/src/Fake.java new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/module1/src/Fake.java @@ -0,0 +1 @@ + diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/sonar-project.properties new file mode 100644 index 00000000000..09cb2208fcd --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-explicit-unexisting-test-dir/sonar-project.properties @@ -0,0 +1,9 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=src + +sonar.modules=module1 +module1.sonar.tests=tests diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-basedir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-basedir/sonar-project.properties new file mode 100644 index 00000000000..67fbf347c0e --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-basedir/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectKey=com.foo.project.module1 +module1.sonar.projectName=Foo Module 1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/module1/src/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/module1/src/Fake.java new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/module1/src/Fake.java @@ -0,0 +1 @@ + diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/sonar-project.properties new file mode 100644 index 00000000000..04ea08a89a1 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/multi-module-with-unexisting-source-dir/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=unexisting-source-dir + +sonar.modules=module1 diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetFile/foo.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetFile/foo.properties new file mode 100644 index 00000000000..8fbb104c92d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetFile/foo.properties @@ -0,0 +1,4 @@ +prop= foo, bar, \ +toto,\ +\ +tutu,
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetList/foo.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetList/foo.properties new file mode 100644 index 00000000000..8fbb104c92d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/shouldGetList/foo.properties @@ -0,0 +1,4 @@ +prop= foo, bar, \ +toto,\ +\ +tutu,
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-blank-source-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-blank-source-dir/sonar-project.properties new file mode 100644 index 00000000000..ba79992d5a0 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-blank-source-dir/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources= diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/build/report.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/build/report.txt new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/build/report.txt diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sonar-project.properties new file mode 100644 index 00000000000..35b33996ea7 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project +sonar.projectBuildDir=build + +sonar.sources=sources + diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sources/Fake.java new file mode 100644 index 00000000000..aee03e60b4a --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-build-dir/sources/Fake.java @@ -0,0 +1,3 @@ +package org.sonar.runner.batch.ProjectReactorBuilderTest.simple; + +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/lib/Fake.class b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/lib/Fake.class new file mode 100644 index 00000000000..bf2c3a09e07 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/lib/Fake.class @@ -0,0 +1,3 @@ +package org.sonar.runner.batch.ProjectReactorBuilderTest.simple + +Fake
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sonar-project.properties new file mode 100644 index 00000000000..0cada50b51f --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.libraries=lib diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sources/Fake.java new file mode 100644 index 00000000000..aee03e60b4a --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-lib-dir/sources/Fake.java @@ -0,0 +1,3 @@ +package org.sonar.runner.batch.ProjectReactorBuilderTest.simple; + +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-missing-source-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-missing-source-dir/sonar-project.properties new file mode 100644 index 00000000000..3a7a65335dc --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-missing-source-dir/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sonar-project.properties new file mode 100644 index 00000000000..55d1ddf0242 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.binaries=bin diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-binary/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sonar-project.properties new file mode 100644 index 00000000000..69ccd8d1411 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.libraries=libs/*.txt diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-lib/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-source-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-source-dir/sonar-project.properties new file mode 100644 index 00000000000..0b83b11f29c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-source-dir/sonar-project.properties @@ -0,0 +1,6 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=unexisting-source-dir diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sonar-project.properties new file mode 100644 index 00000000000..a4fac8e4ca6 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project-with-unexisting-test-dir/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib1.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib1.txt new file mode 100644 index 00000000000..81d4e95a0b6 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib1.txt @@ -0,0 +1 @@ +lib1
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib2.txt b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib2.txt new file mode 100644 index 00000000000..7dacac0fd9a --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/libs/lib2.txt @@ -0,0 +1 @@ +lib2
\ No newline at end of file diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sonar-project.properties b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sonar-project.properties new file mode 100644 index 00000000000..69ccd8d1411 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.libraries=libs/*.txt diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sources/Fake.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/ProjectReactorBuilderTest/simple-project/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report-without-resolved-issues.json b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report-without-resolved-issues.json new file mode 100644 index 00000000000..b5af45efe6c --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report-without-resolved-issues.json @@ -0,0 +1,28 @@ +{ + "version": "3.6", + "issues": [], + "components": [ + {"key": "struts"}, + { + "key": "struts-core", + "path": "core" + }, + { + "key": "struts-ui", + "path": "ui" + }, + { + "key": "struts:src/main/java/org/apache/struts/Action.java", + "path": "src/main/java/org/apache/struts/Action.java", + "moduleKey": "struts", + "status": "CHANGED" + }, + { + "key": "struts:src/main/java/org/apache/struts", + "path": "src/main/java/org/apache/struts", + "moduleKey": "struts" + } + ], + "rules": [], + "users": [] +} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json new file mode 100644 index 00000000000..a33e06342fa --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json @@ -0,0 +1,64 @@ +{ + "version": "3.6", + "issues": [ + { + "key": "200", + "component": "struts:src/main/java/org/apache/struts/Action.java", + "line": 1, + "startLine": 1, + "startOffset": 3, + "endLine": 2, + "endOffset": 4, + "message": "There are 2 cycles", + "severity": "MINOR", + "rule": "squid:AvoidCycles", + "status": "OPEN", + "isNew": false, + "assignee": "simon", + "effortToFix": 3.14, + "creationDate": "${json-unit.ignore}" + } + ], + "components": [ + { + "key": "struts" + }, + { + "key": "struts-core", + "path": "core" + }, + { + "key": "struts-ui", + "path": "ui" + }, + { + "key": "struts:src/main/java/org/apache/struts/Action.java", + "path": "src/main/java/org/apache/struts/Action.java", + "moduleKey": "struts", + "status": "CHANGED" + }, + { + "key": "struts:src/main/java/org/apache/struts", + "path": "src/main/java/org/apache/struts", + "moduleKey": "struts" + } + ], + "rules": [ + { + "key": "squid:AvoidCycles", + "rule": "AvoidCycles", + "repository": "squid", + "name": "Avoid Cycles" + } + ], + "users": [ + { + "login": "julien", + "name": "Julien" + }, + { + "login": "simon", + "name": "Simon" + } + ] +} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.java b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.java new file mode 100644 index 00000000000..c5cc9793730 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.java @@ -0,0 +1,12 @@ +/** + * Doc + */ +public class Person { + + private int first; + + @Deprecated + public void foo(int first, String last, Double middle) { + this.first = first; // First + } +} diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.js b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.js new file mode 100644 index 00000000000..fc36e5aa127 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/Person.js @@ -0,0 +1,8 @@ +/** + * Doc + */ +var Person = function(first, last, middle) { + this.first = first; // First + this.middle = ''; + this.last = 1; +}; diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/package.html b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/package.html new file mode 100644 index 00000000000..f2d90e627d6 --- /dev/null +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/source/CodeColorizersTest/package.html @@ -0,0 +1 @@ +<!-- $Header: /cvshome/build/org.osgi.service.log/src/org/osgi/service/log/package.html,v 1.3 2005/08/10 01:43:20 hargrave Exp $ -->
<BODY>
<P>The OSGi Log Service Package. Specification Version 1.3.
<p>Bundles wishing to use this package must list the package
in the Import-Package header of the bundle's manifest.
For example:
<pre>
Import-Package: org.osgi.service.log; version=1.3
</pre>
</BODY>
\ No newline at end of file |