diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-07-24 16:54:31 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-07-27 13:48:01 +0200 |
commit | fb860b18ab4b5bb95641b9521ea6ca438ad4dc34 (patch) | |
tree | 37033bdd749d200b5110d9614450fc236daeb791 /it/it-plugins | |
parent | 1fd3065c944d3cdbafb2f73d30228dc87e90f867 (diff) | |
download | sonarqube-fb860b18ab4b5bb95641b9521ea6ca438ad4dc34.tar.gz sonarqube-fb860b18ab4b5bb95641b9521ea6ca438ad4dc34.zip |
Add administration ITs
Diffstat (limited to 'it/it-plugins')
6 files changed, 282 insertions, 0 deletions
diff --git a/it/it-plugins/pom.xml b/it/it-plugins/pom.xml index 295cf70e24b..ef5117becb0 100644 --- a/it/it-plugins/pom.xml +++ b/it/it-plugins/pom.xml @@ -31,6 +31,8 @@ <modules> <module>l10n-fr-pack</module> + <module>property-sets-plugin</module> <module>sonar-fake-plugin</module> + <module>sonar-subcategories-plugin</module> </modules> </project> diff --git a/it/it-plugins/property-sets-plugin/pom.xml b/it/it-plugins/property-sets-plugin/pom.xml new file mode 100644 index 00000000000..21386137c0e --- /dev/null +++ b/it/it-plugins/property-sets-plugin/pom.xml @@ -0,0 +1,42 @@ +<?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>property-sets-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>sonar-plugin</packaging> + <description>Plugins :: Property Sets</description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <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>PropertySetsPlugin</pluginClass> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/it/it-plugins/property-sets-plugin/src/main/java/PropertySetsPlugin.java b/it/it-plugins/property-sets-plugin/src/main/java/PropertySetsPlugin.java new file mode 100644 index 00000000000..ab84cf6c6f0 --- /dev/null +++ b/it/it-plugins/property-sets-plugin/src/main/java/PropertySetsPlugin.java @@ -0,0 +1,96 @@ +import java.util.Collections; +import java.util.List; +import org.sonar.api.Properties; +import org.sonar.api.Property; +import org.sonar.api.PropertyField; +import org.sonar.api.PropertyType; +import org.sonar.api.SonarPlugin; + +@Properties({ + @Property( + key = "sonar.test.jira.servers", + name = "Jira Servers", + description = "List of jira server definitions", + global = true, + project = true, + category = "DEV", + fields = { + @PropertyField( + key = "key", + name = "Key", + type = PropertyType.STRING, + indicativeSize = 10), + @PropertyField( + key = "url", + name = "Url", + description = "l'url du serveur jira", + type = PropertyType.STRING, + indicativeSize = 20), + @PropertyField( + key = "port", + name = "Port", + type = PropertyType.INTEGER, + indicativeSize = 5)}), + @Property( + key = "sonar.demo", + name = "Demo", + global = true, + project = true, + category = "DEV", + fields = { + @PropertyField( + key = "text", + name = "text", + type = PropertyType.TEXT), + @PropertyField( + key = "boolean", + name = "boolean", + type = PropertyType.BOOLEAN), + @PropertyField( + key = "float", + name = "float", + type = PropertyType.FLOAT), + @PropertyField( + key = "license", + name = "license", + type = PropertyType.LICENSE), + @PropertyField( + key = "metric", + name = "metric", + type = PropertyType.METRIC), + @PropertyField( + key = "password", + name = "password", + type = PropertyType.PASSWORD), + @PropertyField( + key = "regexp", + name = "regexp", + type = PropertyType.REGULAR_EXPRESSION), + @PropertyField( + key = "list", + name = "list", + type = PropertyType.SINGLE_SELECT_LIST, + options = {"AAA", "BBB"})}), + @Property( + key = "sonar.autogenerated", + name = "Auto-generated", + global = true, + project = true, + category = "DEV", + fields = { + @PropertyField( + key = "value", + name = "value", + type = PropertyType.STRING)}), + @Property( + key = "sonar.test.jira", + name = "Jira", + project = true, + category = "DEV", + type = PropertyType.PROPERTY_SET, + propertySetKey = "sonar.test.jira.servers")}) +public class PropertySetsPlugin extends SonarPlugin { + public List getExtensions() { + return Collections.emptyList(); + } +} diff --git a/it/it-plugins/sonar-subcategories-plugin/pom.xml b/it/it-plugins/sonar-subcategories-plugin/pom.xml new file mode 100644 index 00000000000..69817d7a7db --- /dev/null +++ b/it/it-plugins/sonar-subcategories-plugin/pom.xml @@ -0,0 +1,58 @@ +<?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>sonar-subcategories-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>sonar-plugin</packaging> + + <name>Plugins :: SubCategories</name> + <description>Plugins :: SubCategories</description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <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>SubCategoriesPlugin</pluginClass> + </configuration> + </plugin> + + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>native2ascii-maven-plugin</artifactId> + <version>1.0-beta-1</version> + <executions> + <execution> + <goals> + <goal>native2ascii</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/it/it-plugins/sonar-subcategories-plugin/src/main/java/SubCategoriesPlugin.java b/it/it-plugins/sonar-subcategories-plugin/src/main/java/SubCategoriesPlugin.java new file mode 100644 index 00000000000..21dbd27e63d --- /dev/null +++ b/it/it-plugins/sonar-subcategories-plugin/src/main/java/SubCategoriesPlugin.java @@ -0,0 +1,81 @@ +/* + * 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. + */ + +import java.util.Arrays; +import java.util.List; +import org.sonar.api.SonarPlugin; +import org.sonar.api.config.PropertyDefinition; +import org.sonar.api.resources.Qualifiers; + +public class SubCategoriesPlugin extends SonarPlugin { + public List getExtensions() { + return Arrays.asList( + PropertyDefinition.builder("prop1") + .index(2) + .category("Category 1") + .subCategory("Sub category 1") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop2") + .index(1) + // SONAR-4501 category are case insensitive + .category("category 1") + .subCategory("Sub category 1") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop3") + .category("Category 1") + .subCategory("Sub category 2") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop5") + .category("Category 1") + // SONAR-4501 subcategory are case insensitive + .subCategory("sub category 2") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop4") + .category("Category 1") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop2_1") + .category("Category 2") + .subCategory("Sub category 1 of 2") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop2_2") + .category("Category 2") + .subCategory("Sub category 2 of 2") + .description("Foo") + .onQualifiers(Qualifiers.PROJECT) + .build(), + PropertyDefinition.builder("prop_only_on_project") + .category("project-only") + .description("Foo") + .onlyOnQualifiers(Qualifiers.PROJECT) + .build()); + } +} diff --git a/it/it-plugins/sonar-subcategories-plugin/src/main/resources/org/sonar/l10n/subcategories.properties b/it/it-plugins/sonar-subcategories-plugin/src/main/resources/org/sonar/l10n/subcategories.properties new file mode 100644 index 00000000000..c5cba9d826c --- /dev/null +++ b/it/it-plugins/sonar-subcategories-plugin/src/main/resources/org/sonar/l10n/subcategories.properties @@ -0,0 +1,3 @@ +property.category.category\ 1=Category 1 +property.category.category\ 1.sub\ category\ 1=Sub category 1 +property.category.category\ 1.sub\ category\ 2=Sub category 2 |