diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-10-05 10:42:44 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-10-05 14:27:51 +0200 |
commit | b48ef5a6aaa8f93f768efeac447bbbf365aa4428 (patch) | |
tree | d1479c3927136036cbcdd5ed0271a4ae9bc66887 /it/it-plugins | |
parent | 2205d5242d2d2ebb579f4a20c7c2dc1a17fbe1a8 (diff) | |
download | sonarqube-b48ef5a6aaa8f93f768efeac447bbbf365aa4428.tar.gz sonarqube-b48ef5a6aaa8f93f768efeac447bbbf365aa4428.zip |
Move all batch ITs in the same suite
Diffstat (limited to 'it/it-plugins')
-rw-r--r-- | it/it-plugins/crash-plugin/pom.xml | 38 | ||||
-rw-r--r-- | it/it-plugins/crash-plugin/src/main/java/CrashPlugin.java | 12 | ||||
-rw-r--r-- | it/it-plugins/crash-plugin/src/main/java/CrashSensor.java | 31 | ||||
-rw-r--r-- | it/it-plugins/pom.xml | 1 | ||||
-rw-r--r-- | it/it-plugins/settings-encryption-plugin/src/main/java/EncryptionVerifier.java | 12 |
5 files changed, 7 insertions, 87 deletions
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 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.it</groupId> - <artifactId>it-plugins</artifactId> - <version>5.2-SNAPSHOT</version> - </parent> - - <artifactId>crash-plugin</artifactId> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Crash</name> - <version>1.0-SNAPSHOT</version> - <description>Crash on demand</description> - - <dependencies> - <dependency> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.12.1</version> - <extensions>true</extensions> - <configuration> - <pluginClass>CrashPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> 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 @@ <modules> <module>access-secured-props-plugin</module> <module>batch-plugin</module> - <module>crash-plugin</module> <module>extension-lifecycle-plugin</module> <module>global-property-change-plugin</module> <module>l10n-fr-pack</module> 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"); + } } } } |