From b48ef5a6aaa8f93f768efeac447bbbf365aa4428 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 5 Oct 2015 10:42:44 +0200 Subject: Move all batch ITs in the same suite --- it/it-plugins/crash-plugin/pom.xml | 38 ---------------------- .../crash-plugin/src/main/java/CrashPlugin.java | 12 ------- .../crash-plugin/src/main/java/CrashSensor.java | 31 ------------------ it/it-plugins/pom.xml | 1 - .../src/main/java/EncryptionVerifier.java | 12 ++++--- 5 files changed, 7 insertions(+), 87 deletions(-) delete mode 100644 it/it-plugins/crash-plugin/pom.xml delete mode 100644 it/it-plugins/crash-plugin/src/main/java/CrashPlugin.java delete mode 100644 it/it-plugins/crash-plugin/src/main/java/CrashSensor.java (limited to 'it/it-plugins') diff --git a/it/it-plugins/crash-plugin/pom.xml b/it/it-plugins/crash-plugin/pom.xml deleted file mode 100644 index 330344c5fa0..00000000000 --- a/it/it-plugins/crash-plugin/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - - org.sonarsource.it - it-plugins - 5.2-SNAPSHOT - - - crash-plugin - sonar-plugin - Plugins :: Crash - 1.0-SNAPSHOT - Crash on demand - - - - org.codehaus.sonar - sonar-plugin-api - ${apiVersion} - provided - - - - - - - org.codehaus.sonar - sonar-packaging-maven-plugin - 1.12.1 - true - - CrashPlugin - - - - - diff --git a/it/it-plugins/crash-plugin/src/main/java/CrashPlugin.java b/it/it-plugins/crash-plugin/src/main/java/CrashPlugin.java deleted file mode 100644 index dba4fbd4e0a..00000000000 --- a/it/it-plugins/crash-plugin/src/main/java/CrashPlugin.java +++ /dev/null @@ -1,12 +0,0 @@ -import org.sonar.api.SonarPlugin; - -import java.util.Arrays; -import java.util.List; - -public class CrashPlugin extends SonarPlugin { - - public List getExtensions() { - return Arrays.asList(CrashSensor.class); - } - -} diff --git a/it/it-plugins/crash-plugin/src/main/java/CrashSensor.java b/it/it-plugins/crash-plugin/src/main/java/CrashSensor.java deleted file mode 100644 index 7fdd2576120..00000000000 --- a/it/it-plugins/crash-plugin/src/main/java/CrashSensor.java +++ /dev/null @@ -1,31 +0,0 @@ -import org.sonar.api.Properties; -import org.sonar.api.Property; -import org.sonar.api.batch.Sensor; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.config.Settings; -import org.sonar.api.resources.Project; - -@Properties({ - @Property( - key = "crash", - name = "Property to decide if it crash or not", - defaultValue = "false") -}) -public class CrashSensor implements Sensor { - - private Settings settings; - - public CrashSensor(Settings settings) { - this.settings = settings; - } - - public boolean shouldExecuteOnProject(Project project) { - return true; - } - - public void analyse(Project project, SensorContext sensorContext) { - if ("true".equals(settings.getString("crash"))) { - throw new RuntimeException("Crash!"); - } - } -} diff --git a/it/it-plugins/pom.xml b/it/it-plugins/pom.xml index aa8d2238af2..db917ba0e3c 100644 --- a/it/it-plugins/pom.xml +++ b/it/it-plugins/pom.xml @@ -33,7 +33,6 @@ access-secured-props-plugin batch-plugin - crash-plugin extension-lifecycle-plugin global-property-change-plugin l10n-fr-pack diff --git a/it/it-plugins/settings-encryption-plugin/src/main/java/EncryptionVerifier.java b/it/it-plugins/settings-encryption-plugin/src/main/java/EncryptionVerifier.java index c3ea7361c64..a4bafa7b6ae 100644 --- a/it/it-plugins/settings-encryption-plugin/src/main/java/EncryptionVerifier.java +++ b/it/it-plugins/settings-encryption-plugin/src/main/java/EncryptionVerifier.java @@ -11,11 +11,13 @@ public class EncryptionVerifier implements BatchExtension { } public void start() { - System.out.println("Start EncryptionVerifier"); - - String decryptedValue = settings.getString("encryptedProperty"); - if (!"this is a secret".equals(decryptedValue)) { - throw new IllegalStateException("The property 'encryptedProperty' can not be decrypted"); + if (settings.hasKey("encryptedProperty")) { + System.out.println("Start EncryptionVerifier"); + + String decryptedValue = settings.getString("encryptedProperty"); + if (!"this is a secret".equals(decryptedValue)) { + throw new IllegalStateException("The property 'encryptedProperty' can not be decrypted"); + } } } } -- cgit v1.2.3