From c8bb686cbee8e1dce3312ef253db76e7c0e3c0c7 Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Mon, 29 Sep 2014 15:59:33 +0200 Subject: Release 4.5 --- sonar-batch-protocol/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sonar-batch-protocol') diff --git a/sonar-batch-protocol/pom.xml b/sonar-batch-protocol/pom.xml index 35cc8af069a..e1ad1ede7b7 100644 --- a/sonar-batch-protocol/pom.xml +++ b/sonar-batch-protocol/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5-SNAPSHOT + 4.5 sonar-batch-protocol -- cgit v1.2.3 From c837d7859afd7a22d15c55f9c33dee2c18f6506f Mon Sep 17 00:00:00 2001 From: Eric Hartmann Date: Mon, 29 Sep 2014 18:10:58 +0200 Subject: Update version to 4.5.1-SNAPSHOT --- plugins/sonar-core-plugin/pom.xml | 2 +- plugins/sonar-cpd-plugin/pom.xml | 2 +- plugins/sonar-dbcleaner-plugin/pom.xml | 2 +- plugins/sonar-design-plugin/pom.xml | 2 +- plugins/sonar-email-notifications-plugin/pom.xml | 2 +- plugins/sonar-l10n-en-plugin/pom.xml | 2 +- plugins/sonar-xoo-plugin/pom.xml | 2 +- pom.xml | 2 +- server/pom.xml | 2 +- server/sonar-process-monitor/pom.xml | 2 +- server/sonar-process/pom.xml | 2 +- server/sonar-search/pom.xml | 2 +- server/sonar-server/pom.xml | 2 +- server/sonar-web/pom.xml | 2 +- server/sonar-ws-client/pom.xml | 2 +- sonar-application/pom.xml | 2 +- sonar-batch-maven-compat/pom.xml | 2 +- sonar-batch-protocol/pom.xml | 2 +- sonar-batch/pom.xml | 2 +- sonar-check-api/pom.xml | 2 +- sonar-colorizer/pom.xml | 2 +- sonar-core/pom.xml | 2 +- sonar-deprecated/pom.xml | 2 +- sonar-duplications/pom.xml | 2 +- sonar-graph/pom.xml | 2 +- sonar-home/pom.xml | 2 +- sonar-java-api/pom.xml | 2 +- sonar-markdown/pom.xml | 2 +- sonar-maven-plugin/pom.xml | 2 +- sonar-maven3-plugin/pom.xml | 2 +- sonar-plugin-api/pom.xml | 2 +- sonar-testing-harness/pom.xml | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) (limited to 'sonar-batch-protocol') diff --git a/plugins/sonar-core-plugin/pom.xml b/plugins/sonar-core-plugin/pom.xml index 721d284e644..d7a5edda624 100644 --- a/plugins/sonar-core-plugin/pom.xml +++ b/plugins/sonar-core-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. org.codehaus.sonar.plugins diff --git a/plugins/sonar-cpd-plugin/pom.xml b/plugins/sonar-cpd-plugin/pom.xml index 4ee5a930168..6755e7ccd4f 100644 --- a/plugins/sonar-cpd-plugin/pom.xml +++ b/plugins/sonar-cpd-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. org.codehaus.sonar.plugins diff --git a/plugins/sonar-dbcleaner-plugin/pom.xml b/plugins/sonar-dbcleaner-plugin/pom.xml index b7424384de3..fa2302a61ac 100644 --- a/plugins/sonar-dbcleaner-plugin/pom.xml +++ b/plugins/sonar-dbcleaner-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. org.codehaus.sonar.plugins diff --git a/plugins/sonar-design-plugin/pom.xml b/plugins/sonar-design-plugin/pom.xml index b7da4f8a0b8..37822a98761 100644 --- a/plugins/sonar-design-plugin/pom.xml +++ b/plugins/sonar-design-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. org.codehaus.sonar.plugins diff --git a/plugins/sonar-email-notifications-plugin/pom.xml b/plugins/sonar-email-notifications-plugin/pom.xml index e135c5178a8..8274967827c 100644 --- a/plugins/sonar-email-notifications-plugin/pom.xml +++ b/plugins/sonar-email-notifications-plugin/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. diff --git a/plugins/sonar-l10n-en-plugin/pom.xml b/plugins/sonar-l10n-en-plugin/pom.xml index e90ab10a505..35bbff6ab1f 100644 --- a/plugins/sonar-l10n-en-plugin/pom.xml +++ b/plugins/sonar-l10n-en-plugin/pom.xml @@ -25,7 +25,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. diff --git a/plugins/sonar-xoo-plugin/pom.xml b/plugins/sonar-xoo-plugin/pom.xml index 52e62812d28..a7b48c7b842 100644 --- a/plugins/sonar-xoo-plugin/pom.xml +++ b/plugins/sonar-xoo-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT ../.. org.codehaus.sonar.plugins diff --git a/pom.xml b/pom.xml index a97ee2a0b84..5e8be1145e8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar pom - 4.5 + 4.5.1-SNAPSHOT SonarQube http://www.sonarqube.org/ Open source platform for continuous inspection of code quality diff --git a/server/pom.xml b/server/pom.xml index 008a6755093..5edff8719ae 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT server pom diff --git a/server/sonar-process-monitor/pom.xml b/server/sonar-process-monitor/pom.xml index 88c1e5dc6cd..c169c7b0f29 100644 --- a/server/sonar-process-monitor/pom.xml +++ b/server/sonar-process-monitor/pom.xml @@ -3,7 +3,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT ../ 4.0.0 diff --git a/server/sonar-process/pom.xml b/server/sonar-process/pom.xml index 3ed3e5724da..333cae57e6f 100644 --- a/server/sonar-process/pom.xml +++ b/server/sonar-process/pom.xml @@ -3,7 +3,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT ../ 4.0.0 diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index 42b57da291a..b35a7502868 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -3,7 +3,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT ../ 4.0.0 diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml index 398279d378d..09bc1cd3431 100644 --- a/server/sonar-server/pom.xml +++ b/server/sonar-server/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT .. sonar-server diff --git a/server/sonar-web/pom.xml b/server/sonar-web/pom.xml index bbfde98706b..94de3994edf 100644 --- a/server/sonar-web/pom.xml +++ b/server/sonar-web/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT .. sonar-web diff --git a/server/sonar-ws-client/pom.xml b/server/sonar-ws-client/pom.xml index d6002e37f32..b31b7c407ff 100644 --- a/server/sonar-ws-client/pom.xml +++ b/server/sonar-ws-client/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar server - 4.5 + 4.5.1-SNAPSHOT .. sonar-ws-client diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 9eb9fe7fa7c..c63b6cf0142 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-application diff --git a/sonar-batch-maven-compat/pom.xml b/sonar-batch-maven-compat/pom.xml index 71b820d2b98..b818bf15bf2 100644 --- a/sonar-batch-maven-compat/pom.xml +++ b/sonar-batch-maven-compat/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-batch-maven-compat diff --git a/sonar-batch-protocol/pom.xml b/sonar-batch-protocol/pom.xml index e1ad1ede7b7..5337b6c424b 100644 --- a/sonar-batch-protocol/pom.xml +++ b/sonar-batch-protocol/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-batch-protocol diff --git a/sonar-batch/pom.xml b/sonar-batch/pom.xml index e1f65c7a202..6e184f70b00 100644 --- a/sonar-batch/pom.xml +++ b/sonar-batch/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-batch diff --git a/sonar-check-api/pom.xml b/sonar-check-api/pom.xml index 684ef4e173c..b4d3d132f84 100644 --- a/sonar-check-api/pom.xml +++ b/sonar-check-api/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT .. sonar-check-api diff --git a/sonar-colorizer/pom.xml b/sonar-colorizer/pom.xml index b8ea052ab7d..dc0108dc2e9 100644 --- a/sonar-colorizer/pom.xml +++ b/sonar-colorizer/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT .. diff --git a/sonar-core/pom.xml b/sonar-core/pom.xml index 47e01376203..678fe559222 100644 --- a/sonar-core/pom.xml +++ b/sonar-core/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-core diff --git a/sonar-deprecated/pom.xml b/sonar-deprecated/pom.xml index ef82f2c052e..99771550ef5 100644 --- a/sonar-deprecated/pom.xml +++ b/sonar-deprecated/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-deprecated SonarQube :: Deprecated diff --git a/sonar-duplications/pom.xml b/sonar-duplications/pom.xml index 10c35b2fcd5..df1ad8f043c 100644 --- a/sonar-duplications/pom.xml +++ b/sonar-duplications/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-duplications diff --git a/sonar-graph/pom.xml b/sonar-graph/pom.xml index a4962e7f37b..904169a532e 100644 --- a/sonar-graph/pom.xml +++ b/sonar-graph/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT .. org.codehaus.sonar diff --git a/sonar-home/pom.xml b/sonar-home/pom.xml index c292b911c24..dcad3e31ff7 100644 --- a/sonar-home/pom.xml +++ b/sonar-home/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-home diff --git a/sonar-java-api/pom.xml b/sonar-java-api/pom.xml index be676f62548..cb1a4d26675 100644 --- a/sonar-java-api/pom.xml +++ b/sonar-java-api/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-java-api SonarQube :: Java API diff --git a/sonar-markdown/pom.xml b/sonar-markdown/pom.xml index a03f3150500..53ba70a81da 100644 --- a/sonar-markdown/pom.xml +++ b/sonar-markdown/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT .. diff --git a/sonar-maven-plugin/pom.xml b/sonar-maven-plugin/pom.xml index ad60badc62e..984ae7f960f 100644 --- a/sonar-maven-plugin/pom.xml +++ b/sonar-maven-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-maven-plugin maven-plugin diff --git a/sonar-maven3-plugin/pom.xml b/sonar-maven3-plugin/pom.xml index 5cfe97a2586..323ced6c24d 100644 --- a/sonar-maven3-plugin/pom.xml +++ b/sonar-maven3-plugin/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-maven3-plugin pom diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml index 416a077d2fa..44edf1918fd 100644 --- a/sonar-plugin-api/pom.xml +++ b/sonar-plugin-api/pom.xml @@ -5,7 +5,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-plugin-api diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml index 751dc83d974..bd91b11daed 100644 --- a/sonar-testing-harness/pom.xml +++ b/sonar-testing-harness/pom.xml @@ -4,7 +4,7 @@ org.codehaus.sonar sonar - 4.5 + 4.5.1-SNAPSHOT sonar-testing-harness jar -- cgit v1.2.3 From c6dab978b4e06918c7b96684a06c50c8aca74315 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 30 Sep 2014 00:07:03 +0200 Subject: Maven profiles for each technical stack and remove sonar-channel helpers from sonar-testing-harness --- fork.sh | 24 --------- plugins/sonar-core-plugin/pom.xml | 7 +++ plugins/sonar-cpd-plugin/pom.xml | 14 ++++++ plugins/sonar-dbcleaner-plugin/pom.xml | 8 +++ plugins/sonar-l10n-en-plugin/pom.xml | 7 +++ pom.xml | 58 ++++++++++++++++++++-- server/sonar-process-monitor/pom.xml | 12 +++++ server/sonar-process/pom.xml | 8 +++ .../org/sonar/process/ConfigurationUtilsTest.java | 2 +- .../org/sonar/process/LoopbackAddressTest.java | 2 +- .../java/org/sonar/process/NetworkUtilsTest.java | 2 +- .../java/org/sonar/process/ProcessUtilsTest.java | 4 +- server/sonar-search/pom.xml | 12 +++++ server/sonar-server/pom.xml | 7 +++ server/sonar-web/pom.xml | 3 +- server/sonar-ws-client/pom.xml | 7 +++ sonar-application/pom.xml | 7 +++ .../org/sonar/application/DefaultSettingsTest.java | 2 +- sonar-batch-protocol/pom.xml | 12 +++++ sonar-batch/pom.xml | 19 +++++++ sonar-check-api/pom.xml | 12 +++++ sonar-duplications/pom.xml | 12 +++++ sonar-graph/pom.xml | 12 +++++ sonar-java-api/pom.xml | 12 +++++ sonar-markdown/pom.xml | 11 ++++ sonar-maven-plugin/pom.xml | 12 +++++ sonar-testing-harness/pom.xml | 27 +++++----- .../java/org/sonar/api/server/ws/package-info.java | 22 -------- .../src/main/java/org/sonar/test/TestUtils.java | 29 +++++++---- .../org/sonar/test/channel/ChannelMatcher.java | 57 --------------------- .../org/sonar/test/channel/ChannelMatchers.java | 40 --------------- .../test/channel/ReaderHasNextCharMatcher.java | 46 ----------------- .../java/org/sonar/test/channel/package-info.java | 24 --------- .../java/org/sonar/test/i18n/I18nMatchers.java | 15 +++++- .../test/java/org/sonar/test/TestUtilsTest.java | 44 ++++++++++++++++ 35 files changed, 341 insertions(+), 251 deletions(-) delete mode 100755 fork.sh delete mode 100644 sonar-testing-harness/src/main/java/org/sonar/api/server/ws/package-info.java delete mode 100644 sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatcher.java delete mode 100644 sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatchers.java delete mode 100644 sonar-testing-harness/src/main/java/org/sonar/test/channel/ReaderHasNextCharMatcher.java delete mode 100644 sonar-testing-harness/src/main/java/org/sonar/test/channel/package-info.java (limited to 'sonar-batch-protocol') diff --git a/fork.sh b/fork.sh deleted file mode 100755 index 47e751c592b..00000000000 --- a/fork.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -mvn clean install -DskipTests -pl :sonar-server,:sonar-search,:sonar-process -amd - -if [[ "$OSTYPE" == "darwin"* ]]; then - OS='macosx-universal-64' -else - OS='linux-x86-64' -fi - -cd sonar-application/target/ -if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then - unzip sonarqube-*.zip -fi - -cd sonarqube-* -touch logs/application.log -touch logs/search.log -touch logs/sonar.log - -tmux new-session "tmux split-window -v 'tail -f logs/sonar.log'; tmux split-window -h 'tail -f logs/search.log'; java -jar lib/sonar-application*.jar -Dsonar.node.name=forky" -#tmux new-session "tmux split-window -h 'tail -f logs/search.log'; java -jar lib/sonar-application*.jar" - -#tmux new-session "tmux split-window -v 'tail -f logs/sonar.log'; tmux split-window -h 'tail -f logs/search.log'; tail -f logs/application.log" diff --git a/plugins/sonar-core-plugin/pom.xml b/plugins/sonar-core-plugin/pom.xml index d7a5edda624..d2b40030663 100644 --- a/plugins/sonar-core-plugin/pom.xml +++ b/plugins/sonar-core-plugin/pom.xml @@ -89,6 +89,13 @@ sonar-testing-harness test + + org.codehaus.sonar + sonar-plugin-api + test-jar + test + ${project.version} + diff --git a/plugins/sonar-cpd-plugin/pom.xml b/plugins/sonar-cpd-plugin/pom.xml index 6755e7ccd4f..468405d744f 100644 --- a/plugins/sonar-cpd-plugin/pom.xml +++ b/plugins/sonar-cpd-plugin/pom.xml @@ -59,6 +59,13 @@ sonar-xoo-plugin test + + org.codehaus.sonar + sonar-plugin-api + test-jar + test + ${project.version} + @@ -80,6 +87,13 @@ org.sonar.plugins.cpd.CpdPlugin + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + diff --git a/plugins/sonar-dbcleaner-plugin/pom.xml b/plugins/sonar-dbcleaner-plugin/pom.xml index fa2302a61ac..d4d5b3d5544 100644 --- a/plugins/sonar-dbcleaner-plugin/pom.xml +++ b/plugins/sonar-dbcleaner-plugin/pom.xml @@ -81,6 +81,14 @@ org.sonar.plugins.dbcleaner.DbCleanerPlugin + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + diff --git a/plugins/sonar-l10n-en-plugin/pom.xml b/plugins/sonar-l10n-en-plugin/pom.xml index 35bbff6ab1f..95b855352af 100644 --- a/plugins/sonar-l10n-en-plugin/pom.xml +++ b/plugins/sonar-l10n-en-plugin/pom.xml @@ -69,6 +69,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + diff --git a/pom.xml b/pom.xml index 5e8be1145e8..04ae3872fdb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.codehaus.sonar @@ -83,6 +84,10 @@ ${maven.build.timestamp} yyyy-MM-dd'T'HH:mm:ssZ + false + false + false + org.codehaus.mojo.signature java16 @@ -1348,7 +1353,7 @@ - + @@ -1361,7 +1366,7 @@ - + @@ -1375,7 +1380,7 @@ - + @@ -1388,7 +1393,7 @@ - + @@ -1427,6 +1432,49 @@ + + + + + + skipTests + + + skipTests + + + + true + true + true + + + + batch + + true + true + + + + server + + true + true + + + + web + + + true + true + true + + diff --git a/server/sonar-process-monitor/pom.xml b/server/sonar-process-monitor/pom.xml index c169c7b0f29..af327fb1a60 100644 --- a/server/sonar-process-monitor/pom.xml +++ b/server/sonar-process-monitor/pom.xml @@ -82,4 +82,16 @@ + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + + + diff --git a/server/sonar-process/pom.xml b/server/sonar-process/pom.xml index 333cae57e6f..0e6a50a9f23 100644 --- a/server/sonar-process/pom.xml +++ b/server/sonar-process/pom.xml @@ -91,6 +91,14 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + + diff --git a/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java index 4aa072a6eb3..cd92bbf4e7e 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ConfigurationUtilsTest.java @@ -96,6 +96,6 @@ public class ConfigurationUtilsTest { @Test public void private_constructor() throws Exception { - TestUtils.assertPrivateConstructor(ConfigurationUtils.class); + assertThat(TestUtils.hasOnlyPrivateConstructors(ConfigurationUtils.class)).isTrue(); } } diff --git a/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java b/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java index b612e24342d..8ccafff1f66 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/LoopbackAddressTest.java @@ -52,6 +52,6 @@ public class LoopbackAddressTest { @Test public void private_constructor() throws Exception { - TestUtils.assertPrivateConstructor(LoopbackAddress.class); + assertThat(TestUtils.hasOnlyPrivateConstructors(LoopbackAddress.class)).isTrue(); } } diff --git a/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java index 0462f76707a..052c67d94fe 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/NetworkUtilsTest.java @@ -42,6 +42,6 @@ public class NetworkUtilsTest { @Test public void private_constructor() throws Exception { - TestUtils.assertPrivateConstructor(NetworkUtils.class); + assertThat(TestUtils.hasOnlyPrivateConstructors(NetworkUtils.class)).isTrue(); } } diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java index ae1f53b2653..1a18d5983ae 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessUtilsTest.java @@ -22,10 +22,12 @@ package org.sonar.process; import org.junit.Test; import org.sonar.test.TestUtils; +import static org.fest.assertions.Assertions.assertThat; + public class ProcessUtilsTest { @Test public void private_constructor() throws Exception { - TestUtils.assertPrivateConstructor(ProcessUtils.class); + assertThat(TestUtils.hasOnlyPrivateConstructors(ProcessUtils.class)).isTrue(); } } diff --git a/server/sonar-search/pom.xml b/server/sonar-search/pom.xml index b35a7502868..93551819322 100644 --- a/server/sonar-search/pom.xml +++ b/server/sonar-search/pom.xml @@ -67,4 +67,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + + + diff --git a/server/sonar-server/pom.xml b/server/sonar-server/pom.xml index 09bc1cd3431..0313612ad69 100644 --- a/server/sonar-server/pom.xml +++ b/server/sonar-server/pom.xml @@ -267,6 +267,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + diff --git a/server/sonar-web/pom.xml b/server/sonar-web/pom.xml index 94de3994edf..0ba63fae775 100644 --- a/server/sonar-web/pom.xml +++ b/server/sonar-web/pom.xml @@ -173,7 +173,8 @@ js-tests - !skipTests + skipWebTests + false diff --git a/server/sonar-ws-client/pom.xml b/server/sonar-ws-client/pom.xml index b31b7c407ff..05b51b7ae1f 100644 --- a/server/sonar-ws-client/pom.xml +++ b/server/sonar-ws-client/pom.xml @@ -172,6 +172,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index c63b6cf0142..2245914d1cc 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -265,6 +265,13 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + diff --git a/sonar-application/src/test/java/org/sonar/application/DefaultSettingsTest.java b/sonar-application/src/test/java/org/sonar/application/DefaultSettingsTest.java index 49a66bc590c..82969821f62 100644 --- a/sonar-application/src/test/java/org/sonar/application/DefaultSettingsTest.java +++ b/sonar-application/src/test/java/org/sonar/application/DefaultSettingsTest.java @@ -60,6 +60,6 @@ public class DefaultSettingsTest { @Test public void private_constructor() throws Exception { - TestUtils.assertPrivateConstructor(DefaultSettings.class); + assertThat(TestUtils.hasOnlyPrivateConstructors(DefaultSettings.class)).isTrue(); } } diff --git a/sonar-batch-protocol/pom.xml b/sonar-batch-protocol/pom.xml index 5337b6c424b..17d373e2956 100644 --- a/sonar-batch-protocol/pom.xml +++ b/sonar-batch-protocol/pom.xml @@ -38,4 +38,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-batch/pom.xml b/sonar-batch/pom.xml index 6e184f70b00..36432454d76 100644 --- a/sonar-batch/pom.xml +++ b/sonar-batch/pom.xml @@ -102,6 +102,13 @@ + + org.codehaus.sonar + sonar-plugin-api + test-jar + test + ${project.version} + org.codehaus.sonar sonar-core @@ -155,4 +162,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-check-api/pom.xml b/sonar-check-api/pom.xml index b4d3d132f84..41dc566df00 100644 --- a/sonar-check-api/pom.xml +++ b/sonar-check-api/pom.xml @@ -18,4 +18,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-duplications/pom.xml b/sonar-duplications/pom.xml index df1ad8f043c..60df2ebcf22 100644 --- a/sonar-duplications/pom.xml +++ b/sonar-duplications/pom.xml @@ -79,4 +79,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-graph/pom.xml b/sonar-graph/pom.xml index 904169a532e..79e70ee3d92 100644 --- a/sonar-graph/pom.xml +++ b/sonar-graph/pom.xml @@ -37,4 +37,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-java-api/pom.xml b/sonar-java-api/pom.xml index cb1a4d26675..6c2dd964eba 100644 --- a/sonar-java-api/pom.xml +++ b/sonar-java-api/pom.xml @@ -25,4 +25,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-markdown/pom.xml b/sonar-markdown/pom.xml index 53ba70a81da..a6045e5ca46 100644 --- a/sonar-markdown/pom.xml +++ b/sonar-markdown/pom.xml @@ -47,4 +47,15 @@ + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipServerTests} + + + + diff --git a/sonar-maven-plugin/pom.xml b/sonar-maven-plugin/pom.xml index 984ae7f960f..1a932ff36de 100644 --- a/sonar-maven-plugin/pom.xml +++ b/sonar-maven-plugin/pom.xml @@ -57,4 +57,16 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${skipBatchTests} + + + + diff --git a/sonar-testing-harness/pom.xml b/sonar-testing-harness/pom.xml index bd91b11daed..e474953c6b0 100644 --- a/sonar-testing-harness/pom.xml +++ b/sonar-testing-harness/pom.xml @@ -19,10 +19,6 @@ org.skyscreamer jsonassert - - com.google.code.findbugs - jsr305 - junit junit @@ -32,21 +28,22 @@ hamcrest-all - - org.codehaus.sonar - sonar-channel - true + org.mockito + mockito-core - org.codehaus.sonar - sonar-plugin-api - ${project.version} + commons-io + commons-io - org.codehaus.sonar - sonar-plugin-api - ${project.version} - test-jar + commons-lang + commons-lang + + + + com.google.code.findbugs + jsr305 + provided diff --git a/sonar-testing-harness/src/main/java/org/sonar/api/server/ws/package-info.java b/sonar-testing-harness/src/main/java/org/sonar/api/server/ws/package-info.java deleted file mode 100644 index a216dca3631..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/api/server/ws/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -@javax.annotation.ParametersAreNonnullByDefault -package org.sonar.api.server.ws; diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java index 0a5d8fcaef0..c8522ec3ed8 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java @@ -27,9 +27,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.net.URL; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; - /** * Utilities for unit tests * @@ -73,14 +70,24 @@ public final class TestUtils { return getResource(resourcePath); } - public static void assertPrivateConstructor(Class clazz) { - try { - Constructor constructor = clazz.getDeclaredConstructor(); - assertThat(Modifier.isPrivate(constructor.getModifiers())).isTrue(); - constructor.setAccessible(true); - constructor.newInstance(); - } catch (Exception e) { - fail("Fail to instantiate " + clazz, e); + /** + * Asserts that all constructors are private, usually for helper classes with + * only static methods. If a constructor does not have any parameters, then + * it's instantiated. + */ + public static boolean hasOnlyPrivateConstructors(Class clazz) { + boolean ok = true; + for (Constructor constructor : clazz.getDeclaredConstructors()) { + ok &= Modifier.isPrivate(constructor.getModifiers()); + if (constructor.getParameterTypes().length == 0) { + constructor.setAccessible(true); + try { + constructor.newInstance(); + } catch (Exception e) { + throw new IllegalStateException(String.format("Fail to instantiate %s", clazz), e); + } + } } + return ok; } } diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatcher.java b/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatcher.java deleted file mode 100644 index c262cbca65e..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatcher.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.test.channel; - -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.sonar.channel.Channel; -import org.sonar.channel.CodeReader; - -public class ChannelMatcher extends BaseMatcher> { - - private final String sourceCode; - private final O output; - private final CodeReader reader; - - public ChannelMatcher(String sourceCode, O output) { - this.sourceCode = sourceCode; - this.output = output; - this.reader = new CodeReader(sourceCode); - } - - public ChannelMatcher(CodeReader reader, O output) { - this.output = output; - this.sourceCode = new String(reader.peek(30)); - this.reader = reader; - } - - public boolean matches(Object arg0) { - if ( !(arg0 instanceof Channel)) { - return false; - } - Channel channel = (Channel) arg0; - return channel.consume(reader, output); - } - - public void describeTo(Description description) { - description.appendText("Channel consumes '" + sourceCode + "'"); - } - -} diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatchers.java b/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatchers.java deleted file mode 100644 index b3bce24c591..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ChannelMatchers.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.test.channel; - -import org.sonar.channel.CodeReader; - -public final class ChannelMatchers { - - private ChannelMatchers() { - } - - public static ChannelMatcher consume(String sourceCode, O output) { - return new ChannelMatcher(sourceCode, output); - } - - public static ChannelMatcher consume(CodeReader codeReader, O output) { - return new ChannelMatcher(codeReader, output); - } - - public static ReaderHasNextCharMatcher hasNextChar(char nextChar) { - return new ReaderHasNextCharMatcher(nextChar); - } -} diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ReaderHasNextCharMatcher.java b/sonar-testing-harness/src/main/java/org/sonar/test/channel/ReaderHasNextCharMatcher.java deleted file mode 100644 index 477dc89a29b..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/test/channel/ReaderHasNextCharMatcher.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.test.channel; - -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.sonar.channel.CodeReader; - -public class ReaderHasNextCharMatcher extends BaseMatcher { - - private final char nextChar; - - public ReaderHasNextCharMatcher(char nextChar) { - this.nextChar = nextChar; - } - - public boolean matches(Object arg0) { - if ( !(arg0 instanceof CodeReader)) { - return false; - } - CodeReader reader = (CodeReader) arg0; - return reader.peek() == nextChar; - } - - public void describeTo(Description description) { - description.appendText("next char is '" + nextChar + "'"); - } - -} diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/channel/package-info.java b/sonar-testing-harness/src/main/java/org/sonar/test/channel/package-info.java deleted file mode 100644 index 482c6191040..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/test/channel/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -@ParametersAreNonnullByDefault -package org.sonar.test.channel; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/I18nMatchers.java b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/I18nMatchers.java index 3bc97ec8e44..360685bec9b 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/I18nMatchers.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/I18nMatchers.java @@ -24,6 +24,7 @@ import org.apache.commons.lang.StringUtils; import org.sonar.test.TestUtils; import java.io.File; +import java.net.URL; import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -49,7 +50,7 @@ public final class I18nMatchers { * Checks that all the translation bundles found on the classpath are up to date with the corresponding default ones found in the classpath. */ public static void assertBundlesUpToDate() { - File bundleFolder = TestUtils.getResource(BundleSynchronizedMatcher.L10N_PATH); + File bundleFolder = getResource(BundleSynchronizedMatcher.L10N_PATH); if (bundleFolder == null || !bundleFolder.isDirectory()) { fail("No bundle found in: " + BundleSynchronizedMatcher.L10N_PATH); } @@ -77,4 +78,16 @@ public final class I18nMatchers { fail(message.toString()); } } + + private static File getResource(String path) { + String resourcePath = path; + if (!resourcePath.startsWith("/")) { + resourcePath = "/" + resourcePath; + } + URL url = TestUtils.class.getResource(resourcePath); + if (url != null) { + return FileUtils.toFile(url); + } + return null; + } } diff --git a/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java b/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java index 54a0d903357..f06d434441c 100644 --- a/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java +++ b/sonar-testing-harness/src/test/java/org/sonar/test/TestUtilsTest.java @@ -24,6 +24,7 @@ import org.junit.Test; import java.io.File; import static org.fest.assertions.Assertions.assertThat; +import static org.fest.assertions.Fail.fail; import static org.sonar.test.TestUtils.getResource; public class TestUtilsTest { @@ -45,4 +46,47 @@ public class TestUtilsTest { File file = getResource("org/sonar/test/TestUtilsTest/unknown.txt"); assertThat(file).isNull(); } + + @Test + public void hasOnlyPrivateConstructors() { + assertThat(TestUtils.hasOnlyPrivateConstructors(TestUtils.class)).isTrue(); + assertThat(TestUtils.hasOnlyPrivateConstructors(OnlyPrivateConstructors.class)).isTrue(); + assertThat(TestUtils.hasOnlyPrivateConstructors(MixOfPublicAndPrivateConstructors.class)).isFalse(); + try { + TestUtils.hasOnlyPrivateConstructors(FailToInstantiate.class); + fail(); + } catch (IllegalStateException e) { + // ok + } + } + + public static class OnlyPrivateConstructors { + private OnlyPrivateConstructors() { + } + + private OnlyPrivateConstructors(int i) { + } + + public static void foo() { + + } + } + + public static class MixOfPublicAndPrivateConstructors { + private MixOfPublicAndPrivateConstructors() { + } + + public MixOfPublicAndPrivateConstructors(int i) { + } + + public static void foo() { + + } + } + + public static class FailToInstantiate { + private FailToInstantiate() { + throw new IllegalArgumentException(); + } + } } -- cgit v1.2.3