diff options
author | David Rautureau <david.rautureau@sonarsource.com> | 2018-02-08 15:01:19 +0100 |
---|---|---|
committer | David Rautureau <david.rautureau@sonarsource.com> | 2018-03-09 11:33:38 +0100 |
commit | 1a17e4302e4b63de6b4ce7c049441803b9471524 (patch) | |
tree | 031bcfbf302c7909c5b45a7c31f1bbc00a2fce34 /tests | |
parent | 21fbe3697bdb6e66016ef8d0bea49da574e02e7d (diff) | |
download | sonarqube-1a17e4302e4b63de6b4ce7c049441803b9471524.tar.gz sonarqube-1a17e4302e4b63de6b4ce7c049441803b9471524.zip |
Move To Gradle
Diffstat (limited to 'tests')
110 files changed, 894 insertions, 1891 deletions
diff --git a/tests/build.gradle b/tests/build.gradle new file mode 100644 index 00000000000..3f4d6d8c61e --- /dev/null +++ b/tests/build.gradle @@ -0,0 +1,149 @@ +ext { + jettyVersion = '9.3.11.v20160721' + bytemanVersion = '3.0.10' +} + +configurations { + sqZip + includeInTestResources +} + +def pluginsForITs = [ + ':plugins:sonar-xoo-plugin', + ':tests:plugins:access-secured-props-plugin', + ':tests:plugins:base-auth-plugin', + ':tests:plugins:batch-plugin', + ':tests:plugins:extension-lifecycle-plugin', + ':tests:plugins:fake-billing-plugin', + ':tests:plugins:fake-governance-plugin', + ':tests:plugins:foo-plugin-v1', + ':tests:plugins:foo-plugin-v2', + ':tests:plugins:global-property-change-plugin', + ':tests:plugins:issue-filter-plugin', + ':tests:plugins:l10n-fr-pack', + ':tests:plugins:license-plugin', + ':tests:plugins:oauth2-auth-plugin', + ':tests:plugins:project-builder-plugin', + ':tests:plugins:property-relocation-plugin', + ':tests:plugins:property-sets-plugin', + ':tests:plugins:security-plugin', + ':tests:plugins:server-plugin', + ':tests:plugins:settings-encryption-plugin', + ':tests:plugins:settings-plugin', + ':tests:plugins:sonar-fake-plugin', + ':tests:plugins:sonar-subcategories-plugin', + ':tests:plugins:ui-extensions-plugin', + ':tests:plugins:posttask-plugin', + ':tests:plugins:wait-at-platform-level4-plugin', + ':tests:plugins:ws-plugin', + ':tests:plugins:backdating-plugin-v1', + ':tests:plugins:backdating-plugin-v2', + ':tests:plugins:backdating-customplugin' +] + +dependencies { + testCompile 'org.sonarsource.orchestrator:sonar-orchestrator' + testCompile project(':server:sonar-qa-util') + testCompile project(':sonar-ws') + // required version 23.0 for selenide + testCompile 'com.google.guava:guava:23.0' + testCompile 'junit:junit' + testCompile 'org.assertj:assertj-core' + testCompile 'org.assertj:assertj-guava' + testCompile 'com.googlecode.json-simple:json-simple' + testCompile 'org.skyscreamer:jsonassert:1.2.0' + testCompile 'com.squareup.okhttp3:mockwebserver' + testCompile 'org.subethamail:subethasmtp' + testCompile "org.eclipse.jetty:jetty-server:${jettyVersion}" + testCompile "org.eclipse.jetty:jetty-servlet:${jettyVersion}" + testCompile "org.eclipse.jetty:jetty-proxy:${jettyVersion}" + testCompile "org.jboss.byteman:byteman-submit:${bytemanVersion}" + testCompile 'com.microsoft.sqlserver:mssql-jdbc' + testCompile 'mysql:mysql-connector-java' + testCompile 'org.postgresql:postgresql' + testCompile 'com.oracle.jdbc:ojdbc8' + + includeInTestResources "org.jboss.byteman:byteman:${bytemanVersion}" +} + +sonarqube { + skipProject = true +} + +//UT are excluding in order for ITs to only run when needed +test{ + exclude '*' +} + +task integrationTest(type: Test) { + description = 'Runs integration tests' + + for (plugin in pluginsForITs) { + dependsOn project(plugin).assemble + } + + jacoco.enabled = false + + systemProperty 'orchestrator.configUrl', System.getProperty('orchestrator.configUrl') + systemProperty 'orchestrator.artifactory.apiKey', System.getProperty('orchestrator.artifactory.apiKey') + systemProperty 'orchestrator.artifactory.repositories', System.getProperty('orchestrator.artifactory.repositories') + if (project.hasProperty('cix')) { + systemProperty 'sonar.runtimeVersion', version + } + + def category = System.getProperty('category') + filter { + switch (category) { + case 'Lite': + includeTestsMatching 'org.sonarqube.tests.lite.*Suite' + break + case 'Category1': + includeTestsMatching 'org.sonarqube.tests.Category1Suite' + includeTestsMatching 'org.sonarqube.tests.authorization.*Suite' + includeTestsMatching 'org.sonarqube.tests.measure.*Suite' + includeTestsMatching 'org.sonarqube.tests.qualityGate.*Suite' + includeTestsMatching 'org.sonarqube.tests.source.*Suite' + break + case 'Category2': + includeTestsMatching 'org.sonarqube.tests.issue.*Suite' + includeTestsMatching 'org.sonarqube.tests.test.*Suite' + includeTestsMatching 'org.sonarqube.tests.qualityModel.*Suite' + break + case 'Category3': + includeTestsMatching 'org.sonarqube.tests.Category3Suite' + includeTestsMatching 'org.sonarqube.tests.component.*Suite' + includeTestsMatching 'org.sonarqube.tests.project.*Suite' + break + case 'Category4': + includeTestsMatching 'org.sonarqube.tests.Category4Suite' + includeTestsMatching 'org.sonarqube.tests.duplication.*Suite' + includeTestsMatching 'org.sonarqube.tests.user.*Suite' + includeTestsMatching 'org.sonarqube.tests.webhook.*Suite' + break + case 'Category5': + includeTestsMatching 'org.sonarqube.tests.Category5Suite' + break + case 'Category6': + includeTestsMatching 'org.sonarqube.tests.Category6Suite' + includeTestsMatching 'org.sonarqube.tests.organization.*Suite' + break + case 'Plugins': + includeTestsMatching 'org.sonarqube.tests.plugins.PluginsSuite' + break + case 'Upgrade': + includeTestsMatching 'org.sonarqube.tests.upgrade.UpgradeSuite' + break + case 'ServerPerformance': + includeTestsMatching 'org.sonarqube.tests.performance.server.ServerPerformanceSuite' + break + } + } +} + +processTestResources() { + into('/') { + from configurations.includeInTestResources + // TODO cache not invalidated when pattern changes? + rename '(.*)-' + bytemanVersion + '.jar', '$1.jar' + } +} diff --git a/tests/plugins/access-secured-props-plugin/build.gradle b/tests/plugins/access-secured-props-plugin/build.gradle new file mode 100644 index 00000000000..b41c78ff478 --- /dev/null +++ b/tests/plugins/access-secured-props-plugin/build.gradle @@ -0,0 +1,19 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'AccessSecuredPropsPlugin', + 'Plugin-Version': '1.0.2.42', + 'Plugin-Display-Version': '1.0.2 (build 42)', + 'Plugin-Class': 'AccessSecuredPropsPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Access Secured PropertiesFoo', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/access-secured-props-plugin/pom.xml b/tests/plugins/access-secured-props-plugin/pom.xml deleted file mode 100644 index 55fe1f96b98..00000000000 --- a/tests/plugins/access-secured-props-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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>access-secured-props-plugin</artifactId> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Access Secured Properties</name> - <version>1.0.2.42</version> - <description>Access .secured properties</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.18.0.372</version> - <extensions>true</extensions> - <configuration> - <pluginClass>AccessSecuredPropsPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/backdating-customplugin/build.gradle b/tests/plugins/backdating-customplugin/build.gradle new file mode 100644 index 00000000000..1e047a85029 --- /dev/null +++ b/tests/plugins/backdating-customplugin/build.gradle @@ -0,0 +1,31 @@ +sonarqube { + skipProject = true +} + +dependencies { + compile 'com.google.guava:guava' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compileOnly 'com.google.code.findbugs:jsr305' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + compileOnly project(':tests:plugins:backdating-plugin-v1') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'custombackdating', + 'Plugin-Version': version, + 'Plugin-Class': 'org.sonar.backdating.custom.BackdatingPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Custom', + 'Plugin-License': 'GNU LGPL 3', + 'Plugin-Base': 'backdating' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/backdating-customplugin/pom.xml b/tests/plugins/backdating-customplugin/pom.xml deleted file mode 100644 index 2072ab6b84b..00000000000 --- a/tests/plugins/backdating-customplugin/pom.xml +++ /dev/null @@ -1,82 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../..</relativePath> - </parent> - <artifactId>backdating-customplugin</artifactId> - <name>SonarQube :: Plugins :: Backdating (custom)</name> - <packaging>sonar-plugin</packaging> - <description>Sample of custom rule plugin to test issue backdating</description> - - <properties> - <sonar.skip>true</sonar.skip> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>backdating-plugin-v1</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - - <!-- unit testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <configuration> - <pluginKey>custombackdating</pluginKey> - <pluginName>Custom</pluginName> - <basePlugin>backdating</basePlugin> - <pluginClass>org.sonar.backdating.custom.BackdatingPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/backdating-plugin-v1/build.gradle b/tests/plugins/backdating-plugin-v1/build.gradle new file mode 100644 index 00000000000..8ef8bb8177d --- /dev/null +++ b/tests/plugins/backdating-plugin-v1/build.gradle @@ -0,0 +1,29 @@ +sonarqube { + skipProject = true +} + +dependencies { + compile 'com.google.guava:guava' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compileOnly 'com.google.code.findbugs:jsr305' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'backdating', + 'Plugin-Version': version, + 'Plugin-Class': 'org.sonar.plugins.backdating.BackdatingPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Foo', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/backdating-plugin-v1/pom.xml b/tests/plugins/backdating-plugin-v1/pom.xml deleted file mode 100644 index f1f567bc73f..00000000000 --- a/tests/plugins/backdating-plugin-v1/pom.xml +++ /dev/null @@ -1,75 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../..</relativePath> - </parent> - <artifactId>backdating-plugin-v1</artifactId> - <name>SonarQube :: Plugins :: Backdating (V1)</name> - <packaging>sonar-plugin</packaging> - <description>Sample of plugin to test issue backdating</description> - - <properties> - <sonar.skip>true</sonar.skip> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - - <!-- unit testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <configuration> - <pluginKey>backdating</pluginKey> - <pluginName>Foo</pluginName> - <pluginClass>org.sonar.plugins.backdating.BackdatingPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/backdating-plugin-v2/build.gradle b/tests/plugins/backdating-plugin-v2/build.gradle new file mode 100644 index 00000000000..202d2bbeebc --- /dev/null +++ b/tests/plugins/backdating-plugin-v2/build.gradle @@ -0,0 +1,29 @@ +sonarqube { + skipProject = true +} + +dependencies { + compile 'com.google.guava:guava' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + compileOnly 'com.google.code.findbugs:jsr305' +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'backdating', + 'Plugin-Version': version, + 'Plugin-Class': 'org.sonar.plugins.backdating.BackdatingPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Foo', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/backdating-plugin-v2/pom.xml b/tests/plugins/backdating-plugin-v2/pom.xml deleted file mode 100644 index fefc6bba2fd..00000000000 --- a/tests/plugins/backdating-plugin-v2/pom.xml +++ /dev/null @@ -1,75 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../..</relativePath> - </parent> - <artifactId>backdating-plugin-v2</artifactId> - <name>SonarQube :: Plugins :: Backdating (V2)</name> - <packaging>sonar-plugin</packaging> - <description>Sample of plugin to test issue backdating</description> - - <properties> - <sonar.skip>true</sonar.skip> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - - <!-- unit testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <configuration> - <pluginKey>backdating</pluginKey> - <pluginName>Foo</pluginName> - <pluginClass>org.sonar.plugins.backdating.BackdatingPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/base-auth-plugin/build.gradle b/tests/plugins/base-auth-plugin/build.gradle new file mode 100644 index 00000000000..ee1c6490082 --- /dev/null +++ b/tests/plugins/base-auth-plugin/build.gradle @@ -0,0 +1,25 @@ +dependencies { + compile('com.google.guava:guava:17.0') { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + } + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + compileOnly 'javax.servlet:javax.servlet-api:3.0.1' +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'baseauthplugin', + 'Plugin-Version': version, + 'Plugin-Class': 'FakeBaseAuthPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Fake Base Authentication Plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/base-auth-plugin/pom.xml b/tests/plugins/base-auth-plugin/pom.xml deleted file mode 100644 index 7b2555b98f8..00000000000 --- a/tests/plugins/base-auth-plugin/pom.xml +++ /dev/null @@ -1,57 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>base-auth-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Fake Base Authentication Plugin</name> - <description>Test for base authentication plugin (like openid)</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>3.0.1</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>17.0</version> - <exclusions> - <exclusion> - <!-- should be declared with scope provided --> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <configuration> - <pluginClass>FakeBaseAuthPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/batch-plugin/build.gradle b/tests/plugins/batch-plugin/build.gradle new file mode 100644 index 00000000000..e21395aa1be --- /dev/null +++ b/tests/plugins/batch-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'batch-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'com.sonarsource.BatchPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'SonarQube Integration Tests :: Plugins :: Batch', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/batch-plugin/pom.xml b/tests/plugins/batch-plugin/pom.xml deleted file mode 100644 index 4bd7041393a..00000000000 --- a/tests/plugins/batch-plugin/pom.xml +++ /dev/null @@ -1,37 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>batch-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>SonarQube Integration Tests :: Plugins :: Batch</name> - <description>Main plugin for batch tests</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <extensions>true</extensions> - <configuration> - <pluginClass>com.sonarsource.BatchPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/extension-lifecycle-plugin/build.gradle b/tests/plugins/extension-lifecycle-plugin/build.gradle new file mode 100644 index 00000000000..92d5faefce3 --- /dev/null +++ b/tests/plugins/extension-lifecycle-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'extension-lifecycle-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'ExtensionLifecyclePlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Extension Lifecycle', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/extension-lifecycle-plugin/pom.xml b/tests/plugins/extension-lifecycle-plugin/pom.xml deleted file mode 100644 index 73e6a088a4e..00000000000 --- a/tests/plugins/extension-lifecycle-plugin/pom.xml +++ /dev/null @@ -1,36 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - <artifactId>extension-lifecycle-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Extension Lifecycle</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>ExtensionLifecyclePlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/fake-billing-plugin/build.gradle b/tests/plugins/fake-billing-plugin/build.gradle new file mode 100644 index 00000000000..fe1303c5633 --- /dev/null +++ b/tests/plugins/fake-billing-plugin/build.gradle @@ -0,0 +1,19 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + compileOnly project(':server:sonar-server') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'billing', + 'Plugin-Version': version, + 'Plugin-Class': 'FakeBillingPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Fake Billing Plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/fake-billing-plugin/pom.xml b/tests/plugins/fake-billing-plugin/pom.xml deleted file mode 100644 index a5430e50a1a..00000000000 --- a/tests/plugins/fake-billing-plugin/pom.xml +++ /dev/null @@ -1,44 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>fake-billing-plugin</artifactId> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Fake Billing Plugin</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-server</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>FakeBillingPlugin</pluginClass> - <pluginKey>billing</pluginKey> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/fake-governance-plugin/build.gradle b/tests/plugins/fake-governance-plugin/build.gradle new file mode 100644 index 00000000000..225751ba344 --- /dev/null +++ b/tests/plugins/fake-governance-plugin/build.gradle @@ -0,0 +1,19 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + compileOnly project(':server:sonar-server') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'governance', + 'Plugin-Version': version, + 'Plugin-Class': 'FakeGovernancePlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Fake Governance Plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/fake-governance-plugin/pom.xml b/tests/plugins/fake-governance-plugin/pom.xml deleted file mode 100644 index 1442c73d770..00000000000 --- a/tests/plugins/fake-governance-plugin/pom.xml +++ /dev/null @@ -1,44 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>fake-governance-plugin</artifactId> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Fake Governance Plugin</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-server</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>FakeGovernancePlugin</pluginClass> - <pluginKey>governance</pluginKey> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/foo-plugin-v1/build.gradle b/tests/plugins/foo-plugin-v1/build.gradle new file mode 100644 index 00000000000..c768ae45a98 --- /dev/null +++ b/tests/plugins/foo-plugin-v1/build.gradle @@ -0,0 +1,29 @@ +sonarqube { + skipProject = true +} + +dependencies { + compile 'com.google.guava:guava' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compileOnly 'com.google.code.findbugs:jsr305' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'foo', + 'Plugin-Version': version, + 'Plugin-Class': 'org.sonar.foo.FooPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Foo', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/foo-plugin-v1/pom.xml b/tests/plugins/foo-plugin-v1/pom.xml deleted file mode 100644 index ce6bec89282..00000000000 --- a/tests/plugins/foo-plugin-v1/pom.xml +++ /dev/null @@ -1,75 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../..</relativePath> - </parent> - <artifactId>foo-plugin-v1</artifactId> - <name>SonarQube :: Plugins :: Foo (V1)</name> - <packaging>sonar-plugin</packaging> - <description>Sample of plugin to document and test available APIs</description> - - <properties> - <sonar.skip>true</sonar.skip> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - - <!-- unit testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <configuration> - <pluginKey>foo</pluginKey> - <pluginName>Foo</pluginName> - <pluginClass>org.sonar.foo.FooPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/foo-plugin-v2/build.gradle b/tests/plugins/foo-plugin-v2/build.gradle new file mode 100644 index 00000000000..c768ae45a98 --- /dev/null +++ b/tests/plugins/foo-plugin-v2/build.gradle @@ -0,0 +1,29 @@ +sonarqube { + skipProject = true +} + +dependencies { + compile 'com.google.guava:guava' + compile 'commons-io:commons-io' + compile 'commons-lang:commons-lang' + compileOnly 'com.google.code.findbugs:jsr305' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'foo', + 'Plugin-Version': version, + 'Plugin-Class': 'org.sonar.foo.FooPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Foo', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/foo-plugin-v2/pom.xml b/tests/plugins/foo-plugin-v2/pom.xml deleted file mode 100644 index 1bd47c6e5c7..00000000000 --- a/tests/plugins/foo-plugin-v2/pom.xml +++ /dev/null @@ -1,75 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../..</relativePath> - </parent> - <artifactId>foo-plugin-v2</artifactId> - <name>SonarQube :: Plugins :: Foo (V2)</name> - <packaging>sonar-plugin</packaging> - <description>Sample of plugin to document and test available APIs</description> - - <properties> - <sonar.skip>true</sonar.skip> - </properties> - - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <scope>provided</scope> - </dependency> - - <!-- unit testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <configuration> - <pluginKey>foo</pluginKey> - <pluginName>Foo</pluginName> - <pluginClass>org.sonar.foo.FooPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/global-property-change-plugin/build.gradle b/tests/plugins/global-property-change-plugin/build.gradle new file mode 100644 index 00000000000..6832540b178 --- /dev/null +++ b/tests/plugins/global-property-change-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'global-property-change-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'GlobalPropertyChangePlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Plugins :: Global Property Change', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/global-property-change-plugin/pom.xml b/tests/plugins/global-property-change-plugin/pom.xml deleted file mode 100644 index c906feaf2af..00000000000 --- a/tests/plugins/global-property-change-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>global-property-change-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Global Property Change</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>GlobalPropertyChangePlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/issue-filter-plugin/build.gradle b/tests/plugins/issue-filter-plugin/build.gradle new file mode 100644 index 00000000000..63fe9a1d629 --- /dev/null +++ b/tests/plugins/issue-filter-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'issue-filter-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'IssueFilterPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'IT :: Issue Filter', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/issue-filter-plugin/pom.xml b/tests/plugins/issue-filter-plugin/pom.xml deleted file mode 100644 index 6027229a423..00000000000 --- a/tests/plugins/issue-filter-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>issue-filter-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>IT :: Issue Filter</name> - <description>IT :: Issue Filter</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>IssueFilterPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/l10n-fr-pack/build.gradle b/tests/plugins/l10n-fr-pack/build.gradle new file mode 100644 index 00000000000..0e528ef2cf1 --- /dev/null +++ b/tests/plugins/l10n-fr-pack/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'l10n-fr-pack', + 'Plugin-Version': version, + 'Plugin-Class': 'SimpleFrenchPackPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'l10n-fr-pack', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/l10n-fr-pack/pom.xml b/tests/plugins/l10n-fr-pack/pom.xml deleted file mode 100644 index 59f84aaedbe..00000000000 --- a/tests/plugins/l10n-fr-pack/pom.xml +++ /dev/null @@ -1,52 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>l10n-fr-pack</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>IT :: Simple French Language Pack</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <basePlugin>l10nen</basePlugin> - <pluginClass>SimpleFrenchPackPlugin</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/tests/plugins/license-plugin/build.gradle b/tests/plugins/license-plugin/build.gradle new file mode 100644 index 00000000000..8ec6c368508 --- /dev/null +++ b/tests/plugins/license-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'license-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'LicensePlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'license-plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/license-plugin/pom.xml b/tests/plugins/license-plugin/pom.xml deleted file mode 100644 index a3754d95edc..00000000000 --- a/tests/plugins/license-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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>license-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: License</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>LicensePlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/oauth2-auth-plugin/build.gradle b/tests/plugins/oauth2-auth-plugin/build.gradle new file mode 100644 index 00000000000..f0d08a98294 --- /dev/null +++ b/tests/plugins/oauth2-auth-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'oauth2-auth-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'FakeOAuth2AuthPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Fake OAuth2 Authentication Plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/oauth2-auth-plugin/pom.xml b/tests/plugins/oauth2-auth-plugin/pom.xml deleted file mode 100644 index 700b6354589..00000000000 --- a/tests/plugins/oauth2-auth-plugin/pom.xml +++ /dev/null @@ -1,45 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>oauth2-auth-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Fake OAuth2 Authentication Plugin</name> - <description>Test for OAuth2 authentication plugin (like openid)</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>javax.servlet-api</artifactId> - <version>3.0.1</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <configuration> - <pluginClass>FakeOAuth2AuthPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/pom.xml b/tests/plugins/pom.xml deleted file mode 100644 index fb1746c1363..00000000000 --- a/tests/plugins/pom.xml +++ /dev/null @@ -1,69 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - <relativePath>../../pom.xml</relativePath> - </parent> - <groupId>org.sonarsource.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <name>SonarQube Integration Tests :: Plugins</name> - <description>The fake plugins used by integration tests</description> - <packaging>pom</packaging> - - <properties> - <skipSanityChecks>true</skipSanityChecks> - <enforcer.skip>true</enforcer.skip> - <maven.deploy.skip>true</maven.deploy.skip> - <source.skip>true</source.skip> - <apiVersion>${project.parent.version}</apiVersion> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - </plugins> - </build> - - <modules> - <module>access-secured-props-plugin</module> - <module>base-auth-plugin</module> - <module>batch-plugin</module> - <module>extension-lifecycle-plugin</module> - <module>fake-billing-plugin</module> - <module>fake-governance-plugin</module> - <module>foo-plugin-v1</module> - <module>foo-plugin-v2</module> - <module>global-property-change-plugin</module> - <module>issue-filter-plugin</module> - <module>l10n-fr-pack</module> - <module>license-plugin</module> - <module>oauth2-auth-plugin</module> - <module>project-builder-plugin</module> - <module>property-relocation-plugin</module> - <module>property-sets-plugin</module> - <module>security-plugin</module> - <module>server-plugin</module> - <module>settings-encryption-plugin</module> - <module>settings-plugin</module> - <module>sonar-fake-plugin</module> - <module>sonar-subcategories-plugin</module> - <module>ui-extensions-plugin</module> - <module>posttask-plugin</module> - <module>wait-at-platform-level4-plugin</module> - <module>ws-plugin</module> - <module>backdating-plugin-v1</module> - <module>backdating-plugin-v2</module> - <module>backdating-customplugin</module> - </modules> -</project> diff --git a/tests/plugins/posttask-plugin/build.gradle b/tests/plugins/posttask-plugin/build.gradle new file mode 100644 index 00000000000..da9560a10dd --- /dev/null +++ b/tests/plugins/posttask-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'posttask-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'PostTaskPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'SonarQube Integration Tests :: Plugins :: PostTask', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/posttask-plugin/pom.xml b/tests/plugins/posttask-plugin/pom.xml deleted file mode 100644 index 6b1dbe398d4..00000000000 --- a/tests/plugins/posttask-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>posttask-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>SonarQube Integration Tests :: Plugins :: PostTask</name> - <description>Plugin testing the Compute Engine Post Task API</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>PostTaskPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/project-builder-plugin/build.gradle b/tests/plugins/project-builder-plugin/build.gradle new file mode 100644 index 00000000000..ca035179e9a --- /dev/null +++ b/tests/plugins/project-builder-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'project-builder-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'ProjectBuilderPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Project Builder', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/project-builder-plugin/pom.xml b/tests/plugins/project-builder-plugin/pom.xml deleted file mode 100644 index 98ed082222d..00000000000 --- a/tests/plugins/project-builder-plugin/pom.xml +++ /dev/null @@ -1,36 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - <artifactId>project-builder-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Project Builder</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>ProjectBuilderPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/property-relocation-plugin/build.gradle b/tests/plugins/property-relocation-plugin/build.gradle new file mode 100644 index 00000000000..14ed5d44966 --- /dev/null +++ b/tests/plugins/property-relocation-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'property-relocation-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'PropertyRelocationPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'property-relocation-plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/property-relocation-plugin/pom.xml b/tests/plugins/property-relocation-plugin/pom.xml deleted file mode 100644 index a5915c85909..00000000000 --- a/tests/plugins/property-relocation-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>property-relocation-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Property Relocation</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>PropertyRelocationPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/property-sets-plugin/build.gradle b/tests/plugins/property-sets-plugin/build.gradle new file mode 100644 index 00000000000..6ce9d77d5ee --- /dev/null +++ b/tests/plugins/property-sets-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'property-sets-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'PropertySetsPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'property-sets-plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/property-sets-plugin/pom.xml b/tests/plugins/property-sets-plugin/pom.xml deleted file mode 100644 index c8081a72fa1..00000000000 --- a/tests/plugins/property-sets-plugin/pom.xml +++ /dev/null @@ -1,42 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-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.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>PropertySetsPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/security-plugin/build.gradle b/tests/plugins/security-plugin/build.gradle new file mode 100644 index 00000000000..cfd4d2bbe0f --- /dev/null +++ b/tests/plugins/security-plugin/build.gradle @@ -0,0 +1,29 @@ +configurations { + testCompile.extendsFrom(compileOnly) +} + +dependencies { + compile 'commons-lang:commons-lang' + compile 'com.google.guava:guava' + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') + testCompile 'junit:junit' + testCompile 'org.assertj:assertj-core' +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'security-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'SecurityPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'security-plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/security-plugin/pom.xml b/tests/plugins/security-plugin/pom.xml deleted file mode 100644 index 5664abd0c66..00000000000 --- a/tests/plugins/security-plugin/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ -<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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>security-plugin</artifactId> - <packaging>sonar-plugin</packaging> - <version>1.0-SNAPSHOT</version> - <description>Plugins :: Security</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.6</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-guava</artifactId> - <version>1.3.1</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>SecurityPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/tests/plugins/server-plugin/build.gradle b/tests/plugins/server-plugin/build.gradle new file mode 100644 index 00000000000..685e50ec050 --- /dev/null +++ b/tests/plugins/server-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'server-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'ServerPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'SonarQube Integration Tests :: Plugins :: Server', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/server-plugin/pom.xml b/tests/plugins/server-plugin/pom.xml deleted file mode 100644 index ea012d4ab81..00000000000 --- a/tests/plugins/server-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>server-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>SonarQube Integration Tests :: Plugins :: Server</name> - <description>Main plugin for Server tests</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>ServerPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/settings-encryption-plugin/build.gradle b/tests/plugins/settings-encryption-plugin/build.gradle new file mode 100644 index 00000000000..c7fb784e794 --- /dev/null +++ b/tests/plugins/settings-encryption-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'settings-encryption-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'SettingsEncryptionPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'settings-encryption-plugin', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/settings-encryption-plugin/pom.xml b/tests/plugins/settings-encryption-plugin/pom.xml deleted file mode 100644 index c3395957065..00000000000 --- a/tests/plugins/settings-encryption-plugin/pom.xml +++ /dev/null @@ -1,36 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - <artifactId>settings-encryption-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Settings Encryption</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>SettingsEncryptionPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/settings-plugin/build.gradle b/tests/plugins/settings-plugin/build.gradle new file mode 100644 index 00000000000..44489319a50 --- /dev/null +++ b/tests/plugins/settings-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'settings-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'SettingsPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Settings', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/settings-plugin/pom.xml b/tests/plugins/settings-plugin/pom.xml deleted file mode 100644 index db0bb95516a..00000000000 --- a/tests/plugins/settings-plugin/pom.xml +++ /dev/null @@ -1,40 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>settings-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <description>Plugins :: Settings</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>SettingsPlugin</pluginClass> - <pluginName>Settings</pluginName> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/sonar-fake-plugin/build.gradle b/tests/plugins/sonar-fake-plugin/build.gradle new file mode 100644 index 00000000000..0696ae95234 --- /dev/null +++ b/tests/plugins/sonar-fake-plugin/build.gradle @@ -0,0 +1,19 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'fake', + 'Plugin-Version': version, + 'Plugin-Class': 'FakePlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Fake', + 'Plugin-License': 'GNU LGPL 3', + 'Plugin-Organization': 'SonarSource' + ) + } +} diff --git a/tests/plugins/sonar-fake-plugin/pom.xml b/tests/plugins/sonar-fake-plugin/pom.xml deleted file mode 100644 index d0945e97d09..00000000000 --- a/tests/plugins/sonar-fake-plugin/pom.xml +++ /dev/null @@ -1,40 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>sonar-fake-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Fake</name> - <description>SonarQube Integration Tests :: Fake Plugin</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <configuration> - <pluginClass>FakePlugin</pluginClass> - <pluginKey>fake</pluginKey> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/sonar-subcategories-plugin/build.gradle b/tests/plugins/sonar-subcategories-plugin/build.gradle new file mode 100644 index 00000000000..53ad942de98 --- /dev/null +++ b/tests/plugins/sonar-subcategories-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'sonar-subcategories-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'SubCategoriesPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: SubCategories', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/sonar-subcategories-plugin/pom.xml b/tests/plugins/sonar-subcategories-plugin/pom.xml deleted file mode 100644 index 85ea4f9714c..00000000000 --- a/tests/plugins/sonar-subcategories-plugin/pom.xml +++ /dev/null @@ -1,58 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-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.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</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/tests/plugins/ui-extensions-plugin/build.gradle b/tests/plugins/ui-extensions-plugin/build.gradle new file mode 100644 index 00000000000..5f85c3dd294 --- /dev/null +++ b/tests/plugins/ui-extensions-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'ui-extensions-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'UiExtensionsPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'SonarQube Integration Tests :: Plugins :: UI extensions', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/ui-extensions-plugin/pom.xml b/tests/plugins/ui-extensions-plugin/pom.xml deleted file mode 100644 index 1bbd2a52ccf..00000000000 --- a/tests/plugins/ui-extensions-plugin/pom.xml +++ /dev/null @@ -1,39 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>ui-extensions-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>SonarQube Integration Tests :: Plugins :: UI extensions</name> - <description>Main plugin for UT extensions tests</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <extensions>true</extensions> - <configuration> - <pluginClass>UiExtensionsPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/wait-at-platform-level4-plugin/build.gradle b/tests/plugins/wait-at-platform-level4-plugin/build.gradle new file mode 100644 index 00000000000..626dad0d2a2 --- /dev/null +++ b/tests/plugins/wait-at-platform-level4-plugin/build.gradle @@ -0,0 +1,18 @@ +dependencies { + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'wait-at-platform-level4-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'WaitAtPlaformLevel4Plugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'Plugins :: Wait at platform level4 initialization phase', + 'Plugin-License': 'GNU LGPL 3' + ) + } +} diff --git a/tests/plugins/wait-at-platform-level4-plugin/pom.xml b/tests/plugins/wait-at-platform-level4-plugin/pom.xml deleted file mode 100644 index dc68f3f652d..00000000000 --- a/tests/plugins/wait-at-platform-level4-plugin/pom.xml +++ /dev/null @@ -1,51 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>wait-at-platform-level4-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>Plugins :: Wait at platform level4 initialization phase</name> - <description>Test for failing Elasticsearch on platform4</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>17.0</version> - <exclusions> - <exclusion> - <!-- should be declared with scope provided --> - <groupId>com.google.code.findbugs</groupId> - <artifactId>jsr305</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <version>1.15</version> - <configuration> - <pluginClass>WaitAtPlaformLevel4Plugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/plugins/ws-plugin/build.gradle b/tests/plugins/ws-plugin/build.gradle new file mode 100644 index 00000000000..879e3df31f0 --- /dev/null +++ b/tests/plugins/ws-plugin/build.gradle @@ -0,0 +1,22 @@ +dependencies { + compile project(':sonar-ws') + compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow') +} + +jar { + manifest { + attributes( + 'Plugin-Key': 'ws-plugin', + 'Plugin-Version': version, + 'Plugin-Class': 'WsPlugin', + 'Plugin-ChildFirstClassLoader': 'false', + 'Sonar-Version': '7.1-SNAPSHOT', + 'SonarLint-Supported': 'false', + 'Plugin-Name': 'SonarQube Integration Tests :: Plugins :: Ws', + 'Plugin-License': 'GNU LGPL 3' + ) + } + into('META-INF/lib') { + from configurations.compile + } +} diff --git a/tests/plugins/ws-plugin/pom.xml b/tests/plugins/ws-plugin/pom.xml deleted file mode 100644 index c0c0d8e6dca..00000000000 --- a/tests/plugins/ws-plugin/pom.xml +++ /dev/null @@ -1,43 +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.sonarqube.tests</groupId> - <artifactId>plugins</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <artifactId>ws-plugin</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>sonar-plugin</packaging> - <name>SonarQube Integration Tests :: Plugins :: Ws</name> - <description>Plugin for WS tests</description> - - <dependencies> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-plugin-api</artifactId> - <version>${apiVersion}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-ws</artifactId> - <version>${apiVersion}</version> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> - <artifactId>sonar-packaging-maven-plugin</artifactId> - <extensions>true</extensions> - <configuration> - <pluginClass>WsPlugin</pluginClass> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/tests/pom.xml b/tests/pom.xml deleted file mode 100644 index 09a4a0aa7a4..00000000000 --- a/tests/pom.xml +++ /dev/null @@ -1,282 +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/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonarqube</artifactId> - <version>7.1-SNAPSHOT</version> - </parent> - - <groupId>org.sonarsource.sonarqube.tests</groupId> - <artifactId>tests</artifactId> - <name>SonarQube Integration Tests</name> - <description>Integration, performance, upgrade tests</description> - - <properties> - <maven.deploy.skip>true</maven.deploy.skip> - <source.skip>true</source.skip> - <enforcer.skip>true</enforcer.skip> - <skipSanityChecks>true</skipSanityChecks> - <sqZipDir>../sonar-application/target</sqZipDir> - <category>*</category> - <skipIts>false</skipIts> - <jetty.version>9.3.11.v20160721</jetty.version> - <byteman.version>3.0.10</byteman.version> - </properties> - - <dependencies> - <!-- This is just to force Maven to download it in local repository --> - <dependency> - <groupId>com.sonarsource.license</groupId> - <artifactId>sonar-dev-license-plugin</artifactId> - <!-- Should be the same version than in Orchestrator builder in your test suite --> - <version>3.2.0.1163</version> - <scope>runtime</scope> - </dependency> - <dependency> - <!-- required for selenide --> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>23.0</version> - <scope>test</scope> - </dependency> - <!-- must be declared first --> - <dependency> - <groupId>org.sonarsource.orchestrator</groupId> - <artifactId>sonar-orchestrator</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <!-- required for overriding ws-client 4.5 to have complete error stacktraces - in Issue tests --> - <groupId>org.codehaus.sonar</groupId> - <artifactId>sonar-ws-client</artifactId> - <version>5.0</version> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-application</artifactId> - <version>${project.version}</version> - <type>zip</type> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-qa-util</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-process</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-ws</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-guava</artifactId> - </dependency> - <dependency> - <groupId>com.googlecode.json-simple</groupId> - <artifactId>json-simple</artifactId> - </dependency> - <dependency> - <groupId>org.skyscreamer</groupId> - <artifactId>jsonassert</artifactId> - <version>1.2.0</version> - </dependency> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>mockwebserver</artifactId> - </dependency> - <dependency> - <groupId>org.subethamail</groupId> - <artifactId>subethasmtp</artifactId> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>${jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-servlet</artifactId> - <version>${jetty.version}</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-proxy</artifactId> - <version>${jetty.version}</version> - </dependency> - <dependency> - <groupId>org.sonarsource.scanner.cli</groupId> - <artifactId>sonar-scanner-cli</artifactId> - <version>2.7</version> - <type>zip</type> - </dependency> - <dependency> - <groupId>org.jboss.byteman</groupId> - <artifactId>byteman-submit</artifactId> - <version>${byteman.version}</version> - </dependency> - - <!-- JDBC drivers --> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - </dependency> - <dependency> - <groupId>org.postgresql</groupId> - <artifactId>postgresql</artifactId> - </dependency> - <dependency> - <groupId>com.microsoft.sqlserver</groupId> - <artifactId>mssql-jdbc</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <argLine>-Dsonar.runtimeVersion=${project.version} - -Dmaven.localRepository=${settings.localRepository} - </argLine> - <skipTests>${skipIts}</skipTests> - <includes> - <include>%regex[.*/(${category})/.*Suite.class]</include> - - <!-- deprecated categories --> - <include>%regex[.*/(${category})Suite.class]</include> - </includes> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-byteman-for-resilience-tests</id> - <phase>generate-test-resources</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.jboss.byteman</groupId> - <artifactId>byteman</artifactId> - <version>${byteman.version}</version> - <overWrite>false</overWrite> - <destFileName>byteman.jar</destFileName> - </artifactItem> - </artifactItems> - <outputDirectory>${project.basedir}/target</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>false</overWriteSnapshots> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <!-- TODO rename to oracle --> - <id>with-db-drivers</id> - <activation> - <property> - <name>with-db-drivers</name> - </property> - </activation> - <dependencies> - <dependency> - <groupId>com.oracle.jdbc</groupId> - <artifactId>ojdbc8</artifactId> - </dependency> - </dependencies> - </profile> - - <profile> - <id>qa</id> - <activation> - <property> - <name>env.SONARSOURCE_QA</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-sonarqube-zip</id> - <phase>generate-test-resources</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-application</artifactId> - <version>${project.version}</version> - <type>zip</type> - <overWrite>true</overWrite> - </artifactItem> - </artifactItems> - <outputDirectory>${project.basedir}/../sonar-application/target</outputDirectory> - <overWriteReleases>true</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - </configuration> - </execution> - <execution> - <id>copy-xoo-plugin</id> - <phase>generate-test-resources</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>org.sonarsource.sonarqube</groupId> - <artifactId>sonar-xoo-plugin</artifactId> - <version>${project.version}</version> - <type>sonar-plugin</type> - <overWrite>true</overWrite> - </artifactItem> - </artifactItems> - <outputDirectory>${project.basedir}/../plugins/sonar-xoo-plugin/target</outputDirectory> - <overWriteReleases>true</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project> diff --git a/tests/src/test/java/org/sonarqube/tests/Byteman.java b/tests/src/test/java/org/sonarqube/tests/Byteman.java index f32647f153d..26e21b4a31b 100644 --- a/tests/src/test/java/org/sonarqube/tests/Byteman.java +++ b/tests/src/test/java/org/sonarqube/tests/Byteman.java @@ -20,11 +20,11 @@ package org.sonarqube.tests; import com.sonar.orchestrator.OrchestratorBuilder; +import com.sonar.orchestrator.util.NetworkUtils; import java.io.File; import java.net.InetAddress; import java.util.Collections; import org.jboss.byteman.agent.submit.Submit; -import org.sonar.process.NetworkUtilsImpl; import static java.lang.String.format; @@ -50,16 +50,15 @@ public class Byteman { public Byteman(OrchestratorBuilder builder, Process process) { this.builder = builder; String jar = findBytemanJar(); - port = NetworkUtilsImpl.INSTANCE.getNextAvailablePort(InetAddress.getLoopbackAddress()); + port = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); String bytemanArg = format("-javaagent:%s=boot:%s,port:%d", jar, jar, port); builder.setServerProperty(process.argument, bytemanArg); } private static String findBytemanJar() { - // see pom.xml, Maven copies and renames the artifact. - File jar = new File("target/byteman.jar"); + File jar = new File("build/resources/test/byteman.jar"); if (!jar.exists()) { - throw new IllegalStateException("Can't find " + jar + ". Please execute 'mvn generate-test-resources' once in directory tests/."); + throw new IllegalStateException("Can't find " + jar + ". Please execute './gradlew tests:processIntegrationTestResources'."); } return jar.getAbsolutePath(); } diff --git a/tests/src/test/java/org/sonarqube/tests/Category1Suite.java b/tests/src/test/java/org/sonarqube/tests/Category1Suite.java index 89368b1488a..09e1edb94d4 100644 --- a/tests/src/test/java/org/sonarqube/tests/Category1Suite.java +++ b/tests/src/test/java/org/sonarqube/tests/Category1Suite.java @@ -29,6 +29,7 @@ import org.sonarqube.tests.settings.EmailsTest; import org.sonarqube.tests.settings.PropertySetsTest; import org.sonarqube.tests.settings.SettingsTest; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -48,7 +49,7 @@ import static util.ItUtils.xooPlugin; public class Category1Suite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .setServerProperty("sonar.notifications.delay", "1") .addPlugin(pluginArtifact("property-sets-plugin")) .addPlugin(pluginArtifact("sonar-subcategories-plugin")) @@ -67,9 +68,6 @@ public class Category1Suite { .addPlugin(pluginArtifact("posttask-plugin")) - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .addPlugin(xooPlugin()) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/Category3Suite.java b/tests/src/test/java/org/sonarqube/tests/Category3Suite.java index 2924b41373f..3a59293a07a 100644 --- a/tests/src/test/java/org/sonarqube/tests/Category3Suite.java +++ b/tests/src/test/java/org/sonarqube/tests/Category3Suite.java @@ -40,6 +40,7 @@ import org.sonarqube.tests.analysis.TempFolderTest; import org.sonarqube.tests.plugins.VersionPluginTest; import org.sonarqube.tests.webhook.WebhooksTest; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -70,7 +71,7 @@ import static util.ItUtils.xooPlugin; public class Category3Suite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java") @@ -89,9 +90,5 @@ public class Category3Suite { // used by ProjectBuilderTest .addPlugin(pluginArtifact("project-builder-plugin")) - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") -// .setServerProperty("sonar.web.javaAdditionalOpts", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/Category4Suite.java b/tests/src/test/java/org/sonarqube/tests/Category4Suite.java index 332ef87afe1..b0296eaf19c 100644 --- a/tests/src/test/java/org/sonarqube/tests/Category4Suite.java +++ b/tests/src/test/java/org/sonarqube/tests/Category4Suite.java @@ -39,6 +39,7 @@ import org.sonarqube.tests.ui.UiTest; import org.sonarqube.tests.ws.WsLocalCallTest; import org.sonarqube.tests.ws.WsTest; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -75,7 +76,7 @@ import static util.ItUtils.xooPlugin; public class Category4Suite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) // Used in UiExtensionsTest @@ -87,8 +88,7 @@ public class Category4Suite { // Used by LogsTest .setServerProperty("sonar.web.accessLogs.pattern", LogsTest.ACCESS_LOGS_PATTERN) - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") + .setServerProperty("sonar.web.javaAdditionalOpts", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001") .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/Category6Suite.java b/tests/src/test/java/org/sonarqube/tests/Category6Suite.java index dd8ecd2876b..842aa61711c 100644 --- a/tests/src/test/java/org/sonarqube/tests/Category6Suite.java +++ b/tests/src/test/java/org/sonarqube/tests/Category6Suite.java @@ -39,6 +39,7 @@ import org.sonarqube.tests.rule.RulesMarkdownTest; import org.sonarqube.tests.rule.RulesWsTest; import org.sonarqube.tests.user.OrganizationIdentityProviderTest; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -70,7 +71,7 @@ public class Category6Suite { public static final int SEARCH_HTTP_PORT = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() // for ES resiliency tests .setServerProperty("sonar.search.httpPort", "" + SEARCH_HTTP_PORT) @@ -82,8 +83,5 @@ public class Category6Suite { .addPlugin(pluginArtifact("base-auth-plugin")) .addPlugin(pluginArtifact("ui-extensions-plugin")) - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java b/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java index 3385fad3a5a..eee7c8edf6b 100644 --- a/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java +++ b/tests/src/test/java/org/sonarqube/tests/analysis/AnalysisEsResilienceTest.java @@ -53,6 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; import static org.sonarqube.tests.Byteman.Process.CE; import static org.sonarqube.ws.Ce.TaskStatus.FAILED; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.projectDir; public class AnalysisEsResilienceTest { @@ -63,7 +64,7 @@ public class AnalysisEsResilienceTest { private static final int esHttpPort = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); static { - byteman = new Byteman(Orchestrator.builderEnv(), CE); + byteman = new Byteman(newOrchestratorBuilder(), CE); orchestrator = byteman .getOrchestratorBuilder() .addPlugin(ItUtils.xooPlugin()) diff --git a/tests/src/test/java/org/sonarqube/tests/authorization/AuthorizationSuite.java b/tests/src/test/java/org/sonarqube/tests/authorization/AuthorizationSuite.java index f29f8d2e318..23c03e7888c 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorization/AuthorizationSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/authorization/AuthorizationSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -33,6 +34,7 @@ import static util.ItUtils.xooPlugin; IssuePermissionTest.class, PermissionSearchTest.class, PermissionTemplatePageTest.class, + ProvisioningPermissionTest.class, QualityProfileAdminPermissionTest.class, SystemPasscodeTest.class @@ -40,10 +42,7 @@ import static util.ItUtils.xooPlugin; public class AuthorizationSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() // for SystemPasscodeTest // this privileged plugin provides the WS api/system_passcode/check // that is used by the tests @@ -52,5 +51,4 @@ public class AuthorizationSuite { .addPlugin(xooPlugin()) .build(); - } diff --git a/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java b/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java index 62dabd40247..ce8678dc292 100644 --- a/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java +++ b/tests/src/test/java/org/sonarqube/tests/ce/CeShutdownTest.java @@ -37,6 +37,7 @@ import util.ItUtils; import static com.google.common.base.Preconditions.checkState; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; public class CeShutdownTest { @@ -115,7 +116,7 @@ public class CeShutdownTest { pauseFile = temp.newFile(); FileUtils.touch(pauseFile); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .setServerProperty("sonar.ce.pauseTask.path", pauseFile.getAbsolutePath()) .setServerProperty("sonar.ce.gracefulStopTimeOutInMs", "" + timeOutInMs) .addPlugin(ItUtils.xooPlugin()) diff --git a/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java b/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java index 82453df03d6..64d85836fdb 100644 --- a/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java +++ b/tests/src/test/java/org/sonarqube/tests/ce/CeWorkersTest.java @@ -58,6 +58,7 @@ import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.newAdminWsClient; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -82,7 +83,7 @@ public class CeWorkersTest { public static void setUp() throws Exception { sharedMemory = temporaryFolder.newFile(); - OrchestratorBuilder builder = Orchestrator.builderEnv() + OrchestratorBuilder builder = newOrchestratorBuilder() .addPlugin(pluginArtifact("fake-governance-plugin")) .setServerProperty("fakeGoverance.workerLatch.sharedMemoryFile", sharedMemory.getAbsolutePath()) // overwrite default value to display heap dump on OOM and reduce max heap diff --git a/tests/src/test/java/org/sonarqube/tests/component/ComponentSuite.java b/tests/src/test/java/org/sonarqube/tests/component/ComponentSuite.java index 5053112626c..0384ce9562b 100644 --- a/tests/src/test/java/org/sonarqube/tests/component/ComponentSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/component/ComponentSuite.java @@ -23,6 +23,7 @@ import com.sonar.orchestrator.Orchestrator; import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import util.ItUtils; import static util.ItUtils.xooPlugin; @@ -35,9 +36,7 @@ import static util.ItUtils.xooPlugin; public class ComponentSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") + public static final Orchestrator ORCHESTRATOR = ItUtils.newOrchestratorBuilder() .addPlugin(xooPlugin()) diff --git a/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationSuite.java b/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationSuite.java index bbe5e540ea6..e8c1833f402 100644 --- a/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/duplication/DuplicationSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -36,11 +37,8 @@ import static util.ItUtils.xooPlugin; }) public class DuplicationSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) - // reduce Elasticsearch memory - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationDatePluginChangedTest.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationDatePluginChangedTest.java index af2fbd1e1a6..cff4e0f1aa5 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationDatePluginChangedTest.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueCreationDatePluginChangedTest.java @@ -43,6 +43,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.newUserWsClient; import static util.ItUtils.pluginArtifact; import static util.ItUtils.projectDir; @@ -68,7 +69,7 @@ public class IssueCreationDatePluginChangedTest { private static final String USER_EMAIL = "tester@example.org"; @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) .addPlugin(ItUtils.pluginArtifact("backdating-plugin-v1")) .addPlugin(ItUtils.pluginArtifact("backdating-customplugin")) diff --git a/tests/src/test/java/org/sonarqube/tests/issue/IssueSuite.java b/tests/src/test/java/org/sonarqube/tests/issue/IssueSuite.java index ed6bf7a60a7..8ff714fe6e3 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/IssueSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/IssueSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -51,7 +52,7 @@ import static util.ItUtils.xooPlugin; public class IssueSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .setServerProperty("sonar.search.httpPort", "9025") .addPlugin(xooPlugin()) @@ -63,9 +64,6 @@ public class IssueSuite { .setServerProperty("organization.enabled", "true") - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueSuite.java b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueSuite.java index 2babb0d1985..85381682159 100644 --- a/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/issue/OrganizationIssueSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -33,12 +34,9 @@ import static util.ItUtils.xooPlugin; public class OrganizationIssueSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java b/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java index 8551fd35d3c..0c89f7cd8fe 100644 --- a/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java +++ b/tests/src/test/java/org/sonarqube/tests/lite/LiteTest.java @@ -38,6 +38,7 @@ import org.sonarqube.ws.client.measures.MeasuresService; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.xooPlugin; @@ -45,7 +46,7 @@ public class LiteTest { private static final String PROJECT_KEY = "com.sonarsource.it.samples:multi-modules-sample"; - private static Orchestrator orchestrator = Orchestrator.builderEnv() + private static Orchestrator orchestrator = newOrchestratorBuilder() .setOrchestratorProperty("sonar.web.context", "/sonarqube") .addPlugin(xooPlugin()) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/marketplace/UpdateCenterTest.java b/tests/src/test/java/org/sonarqube/tests/marketplace/UpdateCenterTest.java index e1c851aaae1..8e50a080451 100644 --- a/tests/src/test/java/org/sonarqube/tests/marketplace/UpdateCenterTest.java +++ b/tests/src/test/java/org/sonarqube/tests/marketplace/UpdateCenterTest.java @@ -28,6 +28,7 @@ import org.sonarqube.qa.util.pageobjects.MarketplacePage; import org.sonarqube.qa.util.pageobjects.Navigation; import util.user.UserRule; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; /** @@ -36,7 +37,7 @@ import static util.ItUtils.pluginArtifact; public class UpdateCenterTest { @ClassRule - public static final Orchestrator orchestrator = Orchestrator.builderEnv() + public static final Orchestrator orchestrator = newOrchestratorBuilder() .setServerProperty("sonar.updatecenter.url", UpdateCenterTest.class.getResource("/marketplace/UpdateCenterTest/update-center.properties").toString()) .addPlugin(pluginArtifact("sonar-fake-plugin")) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/measure/MeasureSuite.java b/tests/src/test/java/org/sonarqube/tests/measure/MeasureSuite.java index 7bd56dc9686..ea6ad5d0e7f 100644 --- a/tests/src/test/java/org/sonarqube/tests/measure/MeasureSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/measure/MeasureSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -44,10 +45,7 @@ import static util.ItUtils.xooPlugin; public class MeasureSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) // used by DecimalScaleMetricTest diff --git a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationSuite.java b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationSuite.java index 7511f41200c..024a8849b41 100644 --- a/tests/src/test/java/org/sonarqube/tests/organization/OrganizationSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/organization/OrganizationSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -40,14 +41,11 @@ import static util.ItUtils.xooPlugin; public class OrganizationSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) .addPlugin(pluginArtifact("fake-billing-plugin")) .addPlugin(pluginArtifact("ui-extensions-plugin")) - - // reduce memory for Elasticsearch to 128M - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/performance/scanner/ScannerPerformanceSuite.java b/tests/src/test/java/org/sonarqube/tests/performance/scanner/ScannerPerformanceSuite.java index 1b789600e24..918cb4ba7a6 100644 --- a/tests/src/test/java/org/sonarqube/tests/performance/scanner/ScannerPerformanceSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/performance/scanner/ScannerPerformanceSuite.java @@ -29,6 +29,9 @@ import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.sonarqube.tests.performance.AbstractPerfTest; +import static util.ItUtils.newOrchestratorBuilder; +import static util.ItUtils.xooPlugin; + @RunWith(Suite.class) @Suite.SuiteClasses({ BootstrappingTest.class, @@ -41,9 +44,8 @@ import org.sonarqube.tests.performance.AbstractPerfTest; public class ScannerPerformanceSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator - .builderEnv() - .addPlugin(FileLocation.byWildcardMavenFilename(new File("../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() + .addPlugin(xooPlugin()) // should not be so high, but required as long embedded h2 is used -> requires more memory on server .setServerProperty("sonar.web.javaOpts", "-Xmx1G -XX:+HeapDumpOnOutOfMemoryError") // Needed by DuplicationTest::hugeJavaFile diff --git a/tests/src/test/java/org/sonarqube/tests/performance/server/ComputeEnginePerfTest.java b/tests/src/test/java/org/sonarqube/tests/performance/server/ComputeEnginePerfTest.java index 7ee7fa84624..f6e15a279a1 100644 --- a/tests/src/test/java/org/sonarqube/tests/performance/server/ComputeEnginePerfTest.java +++ b/tests/src/test/java/org/sonarqube/tests/performance/server/ComputeEnginePerfTest.java @@ -34,6 +34,9 @@ import org.junit.rules.TemporaryFolder; import org.sonarqube.tests.performance.AbstractPerfTest; import org.sonarqube.tests.performance.ServerLogs; +import static util.ItUtils.newOrchestratorBuilder; +import static util.ItUtils.xooPlugin; + public class ComputeEnginePerfTest extends AbstractPerfTest { private static int MAX_HEAP_SIZE_IN_MEGA = 600; @@ -41,9 +44,8 @@ public class ComputeEnginePerfTest extends AbstractPerfTest { public static TemporaryFolder temp = new TemporaryFolder(); @ClassRule - public static Orchestrator orchestrator = Orchestrator - .builderEnv() - .addPlugin(FileLocation.byWildcardMavenFilename(new File("../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) + public static Orchestrator orchestrator = newOrchestratorBuilder() + .addPlugin(xooPlugin()) .setServerProperty( "sonar.web.javaOpts", String.format("-Xms%dm -Xmx%dm -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true", MAX_HEAP_SIZE_IN_MEGA, MAX_HEAP_SIZE_IN_MEGA)) diff --git a/tests/src/test/java/org/sonarqube/tests/performance/server/ServerPerfTest.java b/tests/src/test/java/org/sonarqube/tests/performance/server/ServerPerfTest.java index 3de0d05c8cc..2d147551db5 100644 --- a/tests/src/test/java/org/sonarqube/tests/performance/server/ServerPerfTest.java +++ b/tests/src/test/java/org/sonarqube/tests/performance/server/ServerPerfTest.java @@ -33,6 +33,8 @@ import org.sonarqube.tests.performance.AbstractPerfTest; import org.sonarqube.tests.performance.ServerLogs; import static org.apache.commons.io.FileUtils.readLines; +import static util.ItUtils.newOrchestratorBuilder; +import static util.ItUtils.xooPlugin; public class ServerPerfTest extends AbstractPerfTest { private static final int TIMEOUT_3_MINUTES = 1000 * 60 * 3; @@ -44,8 +46,8 @@ public class ServerPerfTest extends AbstractPerfTest { @Test public void server_startup_and_shutdown() throws Exception { String defaultWebJavaOptions = "-Xmx768m -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF-8"; - Orchestrator orchestrator = Orchestrator.builderEnv() - .addPlugin(FileLocation.byWildcardMavenFilename(new File("../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) + Orchestrator orchestrator = newOrchestratorBuilder() + .addPlugin(xooPlugin()) // See http://wiki.apache.org/tomcat/HowTo/FasterStartUp // Sometimes source of entropy is too small and Tomcat spends ~20 seconds on the step : diff --git a/tests/src/test/java/org/sonarqube/tests/plugins/CompressPluginsTest.java b/tests/src/test/java/org/sonarqube/tests/plugins/CompressPluginsTest.java index ca57e9fc7e4..f2601bdaa1a 100644 --- a/tests/src/test/java/org/sonarqube/tests/plugins/CompressPluginsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/plugins/CompressPluginsTest.java @@ -24,7 +24,6 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarScanner; -import org.json.JSONException; import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; @@ -34,6 +33,7 @@ import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsResponse; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.projectDir; import static util.ItUtils.xooPlugin; @@ -42,7 +42,7 @@ import static util.ItUtils.xooPlugin; */ public class CompressPluginsTest { @ClassRule - public static Orchestrator orchestrator = Orchestrator.builderEnv() + public static Orchestrator orchestrator = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setServerProperty("sonar.pluginsCompression.enable", "true") .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java b/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java index eb32eebbc6c..bcde9c81ca2 100644 --- a/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java @@ -24,8 +24,6 @@ import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarScanner; import com.sonar.orchestrator.locator.MavenLocation; -import java.io.File; -import java.net.MalformedURLException; import java.util.Arrays; import java.util.List; import org.junit.BeforeClass; @@ -50,8 +48,8 @@ import org.sonarqube.tests.plugins.checks.SwiftCheck; import org.sonarqube.tests.plugins.checks.Validation; import org.sonarqube.tests.plugins.checks.WebCheck; -import static com.sonar.orchestrator.locator.FileLocation.byWildcardMavenFilename; import static org.assertj.core.api.Assertions.fail; +import static util.ItUtils.newOrchestratorBuilder; /** * Verify that latest releases of the plugins available in update center @@ -83,8 +81,7 @@ public class PluginsTest { @BeforeClass public static void startServer() { - OrchestratorBuilder builder = Orchestrator.builderEnv() - .setZipFile(byWildcardMavenFilename(new File("../sonar-application/target"), "sonar*.zip").getFile()); + OrchestratorBuilder builder = newOrchestratorBuilder(); builder.addPlugin(MavenLocation.of("com.sonarsource.license", "sonar-dev-license-plugin", "3.2.0.1163")); diff --git a/tests/src/test/java/org/sonarqube/tests/project/ProjectSuite.java b/tests/src/test/java/org/sonarqube/tests/project/ProjectSuite.java index 575f42abf47..eaf2ba850be 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/ProjectSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/project/ProjectSuite.java @@ -26,6 +26,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -50,9 +51,7 @@ public class ProjectSuite { static final int SEARCH_HTTP_PORT = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() // for ES resiliency tests .setServerProperty("sonar.search.httpPort", "" + SEARCH_HTTP_PORT) .setServerProperty("sonar.search.recovery.delayInMs", "1000") diff --git a/tests/src/test/java/org/sonarqube/tests/project/SonarCloudProjectSuite.java b/tests/src/test/java/org/sonarqube/tests/project/SonarCloudProjectSuite.java index 872029f36d6..d65f7b52c37 100644 --- a/tests/src/test/java/org/sonarqube/tests/project/SonarCloudProjectSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/project/SonarCloudProjectSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -33,7 +34,7 @@ import static util.ItUtils.xooPlugin; public class SonarCloudProjectSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setServerProperty("sonar.sonarcloud.enabled", "true") .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateSuite.java b/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateSuite.java index 574957407de..985f8b3a3dc 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityGate/OrganizationQualityGateSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -36,13 +37,10 @@ import static util.ItUtils.xooPlugin; public class OrganizationQualityGateSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() // required for notification tests .setServerProperty("sonar.notifications.delay", "1") - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .addPlugin(pluginArtifact("posttask-plugin")) .addPlugin(xooPlugin()) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateSuite.java b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateSuite.java index 3ce87ad9528..910144e75cb 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -38,13 +39,10 @@ import static util.ItUtils.xooPlugin; public class QualityGateSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() // required for notification tests .setServerProperty("sonar.notifications.delay", "1") - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .addPlugin(pluginArtifact("posttask-plugin")) .addPlugin(xooPlugin()) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/qualityModel/QualityModelSuite.java b/tests/src/test/java/org/sonarqube/tests/qualityModel/QualityModelSuite.java index c7431a8bbff..b796cfe6b84 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityModel/QualityModelSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityModel/QualityModelSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -40,12 +41,9 @@ import static util.ItUtils.xooPlugin; public class QualityModelSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/ActiveRuleEsResilienceTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/ActiveRuleEsResilienceTest.java index 869beb0154b..44a91226fda 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/ActiveRuleEsResilienceTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/ActiveRuleEsResilienceTest.java @@ -38,6 +38,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.sonarqube.tests.Byteman.Process.WEB; +import static util.ItUtils.newOrchestratorBuilder; public class ActiveRuleEsResilienceTest { private static final String RULE_ONE_BUG_PER_LINE = "xoo:OneBugIssuePerLine"; @@ -47,7 +48,7 @@ public class ActiveRuleEsResilienceTest { private static final Byteman byteman; static { - byteman = new Byteman(Orchestrator.builderEnv(), WEB); + byteman = new Byteman(newOrchestratorBuilder(), WEB); orchestrator = byteman .getOrchestratorBuilder() .setServerProperty("sonar.search.recovery.delayInMs", "1000") diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java index 2eb34952fa4..861beecbe53 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/BuiltInQualityProfilesNotificationTest.java @@ -41,6 +41,7 @@ import util.user.UserRule; import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; public class BuiltInQualityProfilesNotificationTest { @@ -67,7 +68,7 @@ public class BuiltInQualityProfilesNotificationTest { @Test public void does_not_send_mail_if_no_quality_profile_is_updated() throws Exception { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("foo-plugin-v1")) .setServerProperty("email.smtp_host.secured", "localhost") .setServerProperty("email.smtp_port.secured", Integer.toString(smtpServer.getServer().getPort())) @@ -86,7 +87,7 @@ public class BuiltInQualityProfilesNotificationTest { @Test public void send_mail_if_quality_profile_is_updated() throws Exception { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("foo-plugin-v1")) .setServerProperty("sonar.notifications.delay", "1") .setServerProperty("email.smtp_host.secured", "localhost") @@ -174,7 +175,7 @@ public class BuiltInQualityProfilesNotificationTest { @Test public void do_not_send_mail_if_notifications_are_disabled_in_settings() throws Exception { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("foo-plugin-v1")) .setServerProperty("sonar.builtInQualityProfiles.disableNotificationOnUpdate", "true") .setServerProperty("email.smtp_host.secured", "localhost") diff --git a/tests/src/test/java/org/sonarqube/tests/rule/RuleEsResilienceTest.java b/tests/src/test/java/org/sonarqube/tests/rule/RuleEsResilienceTest.java index 2efd49948ce..1163564bbba 100644 --- a/tests/src/test/java/org/sonarqube/tests/rule/RuleEsResilienceTest.java +++ b/tests/src/test/java/org/sonarqube/tests/rule/RuleEsResilienceTest.java @@ -38,6 +38,7 @@ import util.ItUtils; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.sonarqube.tests.Byteman.Process.WEB; +import static util.ItUtils.newOrchestratorBuilder; public class RuleEsResilienceTest { @@ -46,7 +47,7 @@ public class RuleEsResilienceTest { private static final Byteman byteman; static { - byteman = new Byteman(Orchestrator.builderEnv(), WEB); + byteman = new Byteman(newOrchestratorBuilder(), WEB); orchestrator = byteman .getOrchestratorBuilder() .setServerProperty("sonar.search.recovery.delayInMs", "1000") diff --git a/tests/src/test/java/org/sonarqube/tests/rule/RuleReKeyingTest.java b/tests/src/test/java/org/sonarqube/tests/rule/RuleReKeyingTest.java index ddff401dcc1..6576d0ec924 100644 --- a/tests/src/test/java/org/sonarqube/tests/rule/RuleReKeyingTest.java +++ b/tests/src/test/java/org/sonarqube/tests/rule/RuleReKeyingTest.java @@ -40,6 +40,7 @@ import org.sonarqube.ws.client.issues.SearchRequest; import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toSet; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.projectDir; @@ -60,7 +61,7 @@ public class RuleReKeyingTest { @Test public void rules_are_re_keyed_when_upgrading_and_downgrading_plugin() { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("foo-plugin-v1")) .build(); orchestrator.start(); diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java index 010ba984229..532925b7c50 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/RestartTest.java @@ -29,7 +29,6 @@ import org.junit.rules.DisableOnDebug; import org.junit.rules.ExpectedException; import org.junit.rules.TestRule; import org.junit.rules.Timeout; -import org.sonarqube.qa.util.Tester; import org.sonarqube.ws.System; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsClient; @@ -39,6 +38,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static util.ItUtils.newAdminWsClient; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.newWsClient; /** @@ -64,7 +64,7 @@ public class RestartTest { public void restart_in_prod_mode_requires_sysadmin_permission_and_restarts() throws Exception { // server classloader locks Jar files on Windows if (!SystemUtils.IS_OS_WINDOWS) { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .setOrchestratorProperty("orchestrator.keepWorkspace", "true") .build(); orchestrator.start(); diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/ServerSystemRestartingOrchestrator.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/ServerSystemRestartingOrchestrator.java index 161456b209a..ed4fd75d914 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/ServerSystemRestartingOrchestrator.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/ServerSystemRestartingOrchestrator.java @@ -33,6 +33,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static util.ItUtils.newAdminWsClient; +import static util.ItUtils.newOrchestratorBuilder; /** * This class start a new orchestrator on each test case @@ -57,7 +58,7 @@ public class ServerSystemRestartingOrchestrator { @Test public void check_minimal_sonar_version_at_startup() throws Exception { try { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(FileLocation.of(new File(ServerSystemRestartingOrchestrator.class.getResource("/serverSystem/ServerSystemTest/incompatible-plugin-1.0.jar").toURI()))) .build(); orchestrator.start(); @@ -70,9 +71,9 @@ public class ServerSystemRestartingOrchestrator { @Test public void support_install_dir_with_whitespaces() throws Exception { - String dirName = "target/has space"; + String dirName = "build/distributions/has space"; FileUtils.deleteDirectory(new File(dirName)); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .setOrchestratorProperty("orchestrator.workspaceDir", dirName) .build(); orchestrator.start(); @@ -83,7 +84,7 @@ public class ServerSystemRestartingOrchestrator { // SONAR-4748 @Test public void should_create_in_temp_folder() throws Exception { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(ItUtils.pluginArtifact("server-plugin")) .setServerProperty("sonar.createTempFiles", "true") .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/serverSystem/SystemStateTest.java b/tests/src/test/java/org/sonarqube/tests/serverSystem/SystemStateTest.java index 94d9fc77b29..7a2ee2e42a5 100644 --- a/tests/src/test/java/org/sonarqube/tests/serverSystem/SystemStateTest.java +++ b/tests/src/test/java/org/sonarqube/tests/serverSystem/SystemStateTest.java @@ -41,6 +41,7 @@ import org.sonarqube.ws.client.WsClient; import static com.google.common.base.Preconditions.checkState; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.newSystemUserWsClient; import static util.ItUtils.newWsClient; import static util.ItUtils.pluginArtifact; @@ -128,7 +129,7 @@ public class SystemStateTest { void start(Lock lock) { checkState(orchestrator == null); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("server-plugin")) .setServerProperty("sonar.web.startupLock.path", lock.webFile.getAbsolutePath()) .setServerProperty("sonar.ce.startupLock.path", lock.ceFile.getAbsolutePath()) diff --git a/tests/src/test/java/org/sonarqube/tests/settings/SettingsTestRestartingOrchestrator.java b/tests/src/test/java/org/sonarqube/tests/settings/SettingsTestRestartingOrchestrator.java index 8aee5ebb876..1c4f5a88e3e 100644 --- a/tests/src/test/java/org/sonarqube/tests/settings/SettingsTestRestartingOrchestrator.java +++ b/tests/src/test/java/org/sonarqube/tests/settings/SettingsTestRestartingOrchestrator.java @@ -21,7 +21,6 @@ package org.sonarqube.tests.settings; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarScanner; -import java.io.UnsupportedEncodingException; import java.net.URL; import org.junit.After; import org.junit.Rule; @@ -33,6 +32,7 @@ import util.user.UserRule; import static com.codeborne.selenide.Condition.visible; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.projectDir; import static util.ItUtils.xooPlugin; @@ -60,7 +60,7 @@ public class SettingsTestRestartingOrchestrator { @Test public void test_settings() { URL secretKeyUrl = getClass().getResource("/settings/SettingsTest/sonar-secret.txt"); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("settings-plugin")) .addPlugin(pluginArtifact("license-plugin")) .setServerProperty("sonar.secretKeyPath", secretKeyUrl.getFile()) @@ -86,7 +86,7 @@ public class SettingsTestRestartingOrchestrator { @Test public void property_relocation() { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("property-relocation-plugin")) .addPlugin(xooPlugin()) .setServerProperty("sonar.deprecatedKey", "true") diff --git a/tests/src/test/java/org/sonarqube/tests/source/SourceSuite.java b/tests/src/test/java/org/sonarqube/tests/source/SourceSuite.java index fbcb1885bf9..070a0fc941e 100644 --- a/tests/src/test/java/org/sonarqube/tests/source/SourceSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/source/SourceSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -37,9 +38,7 @@ import static util.ItUtils.xooPlugin; public class SourceSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator - .builderEnv() - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .setOrchestratorProperty("scmgitVersion", "LATEST_RELEASE") .addPlugin(xooPlugin()) .addPlugin("scmgit") diff --git a/tests/src/test/java/org/sonarqube/tests/startup/StartupIndexationTest.java b/tests/src/test/java/org/sonarqube/tests/startup/StartupIndexationTest.java index 643a0ff12d5..f654949bd26 100644 --- a/tests/src/test/java/org/sonarqube/tests/startup/StartupIndexationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/startup/StartupIndexationTest.java @@ -38,6 +38,7 @@ import org.sonarqube.ws.Users; import org.sonarqube.ws.client.users.SearchRequest; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; public class StartupIndexationTest { @@ -81,7 +82,7 @@ public class StartupIndexationTest { pauseFile = temp.newFile(); FileUtils.touch(pauseFile); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .setServerProperty("sonar.web.pause.path", pauseFile.getAbsolutePath()) .addPlugin(pluginArtifact("wait-at-platform-level4-plugin")) .setStartupLogWatcher(l -> l.contains("PlatformLevel4 initialization phase is paused")) diff --git a/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryOptOutTest.java b/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryOptOutTest.java index 1cd6186184d..a827baa6282 100644 --- a/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryOptOutTest.java +++ b/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryOptOutTest.java @@ -32,13 +32,14 @@ import org.sonarqube.ws.client.GetRequest; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.jsonToMap; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; public class TelemetryOptOutTest { public static MockWebServer server = new MockWebServer(); - private static Orchestrator orchestrator = Orchestrator.builderEnv() + private static Orchestrator orchestrator = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setServerProperty("sonar.telemetry.enable", "false") .setServerProperty("sonar.telemetry.url", server.url("").toString()) diff --git a/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryUploadTest.java b/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryUploadTest.java index 8e8a9007f59..fd17f385112 100644 --- a/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryUploadTest.java +++ b/tests/src/test/java/org/sonarqube/tests/telemetry/TelemetryUploadTest.java @@ -37,6 +37,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; import static util.ItUtils.jsonToMap; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.runProjectAnalysis; import static util.ItUtils.xooPlugin; @@ -60,7 +61,7 @@ public class TelemetryUploadTest { @Test public void sent_telemetry_data() throws Exception { telemetryServer.enqueue(new MockResponse().setResponseCode(200)); - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setServerProperty("sonar.telemetry.url", telemetryServer.url("").toString()) // increase frequency so that payload is sent quickly after startup @@ -104,7 +105,7 @@ public class TelemetryUploadTest { @Test public void does_not_send_telemetry_data_right_away_by_Default() { - orchestrator = Orchestrator.builderEnv() + orchestrator = newOrchestratorBuilder() .addPlugin(xooPlugin()) .setServerProperty("sonar.telemetry.url", telemetryServer.url("").toString()) .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/test/TestSuite.java b/tests/src/test/java/org/sonarqube/tests/test/TestSuite.java index 8afec8fdf6a..9afbbfa2de9 100644 --- a/tests/src/test/java/org/sonarqube/tests/test/TestSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/test/TestSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -36,12 +37,9 @@ import static util.ItUtils.xooPlugin; public class TestSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) - // reduce memory for Elasticsearch - .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") - .build(); } diff --git a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java index 0828b039b11..8d79898aa13 100644 --- a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java +++ b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java @@ -25,7 +25,7 @@ import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.build.MavenBuild; import com.sonar.orchestrator.container.Server; -import com.sonar.orchestrator.locator.FileLocation; +import com.sonar.orchestrator.locator.MavenLocation; import com.sonar.orchestrator.version.Version; import java.io.File; import java.io.IOException; @@ -53,6 +53,8 @@ import static java.lang.Integer.parseInt; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; + public class UpgradeTest { private static final String PROJECT_KEY = "org.apache.struts:struts-parent"; @@ -70,8 +72,8 @@ public class UpgradeTest { } @Test - public void test_upgrade_from_5_6_1() { - testDatabaseUpgrade(Version.create("5.6.1")); + public void test_upgrade_from_6_7() { + testDatabaseUpgrade(Version.create("6.7")); } private void testDatabaseUpgrade(Version fromVersion) { @@ -152,8 +154,8 @@ public class UpgradeTest { OrchestratorBuilder builder = Orchestrator.builderEnv() .setSonarVersion(sqVersion.toString()) .setOrchestratorProperty("orchestrator.keepDatabase", String.valueOf(keepDatabase)) - .setOrchestratorProperty("javaVersion", "3.14") - .addPlugin("java") + .setOrchestratorProperty("orchestrator.workspaceDir", "build/it") + .addPlugin(MavenLocation.of("org.sonarsource.java", "sonar-java-plugin", "5.1.0.13090")) .setStartupLogWatcher(log -> log.contains("Process[web] is up")); orchestrator = builder.build(); orchestrator.start(); @@ -161,8 +163,7 @@ public class UpgradeTest { } private void startAndUpgradeDevServer() { - OrchestratorBuilder builder = Orchestrator.builderEnv() - .setZipFile(FileLocation.byWildcardMavenFilename(new File("../sonar-application/target"), "sonar*.zip").getFile()) + OrchestratorBuilder builder = newOrchestratorBuilder() .setOrchestratorProperty("orchestrator.keepDatabase", "true") .setOrchestratorProperty("javaVersion", LATEST_JAVA_RELEASE) .addPlugin("java") diff --git a/tests/src/test/java/org/sonarqube/tests/user/OnboardingTest.java b/tests/src/test/java/org/sonarqube/tests/user/OnboardingTest.java index e7c709f1237..440e0d4bba6 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/OnboardingTest.java +++ b/tests/src/test/java/org/sonarqube/tests/user/OnboardingTest.java @@ -30,13 +30,14 @@ import org.sonarqube.ws.client.users.DeactivateRequest; import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.newOrchestratorBuilder; public class OnboardingTest { private static final String ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS = "sonar.onboardingTutorial.showToNewUsers"; @ClassRule - public static final Orchestrator orchestrator = Orchestrator.builderEnv().build(); + public static final Orchestrator orchestrator = newOrchestratorBuilder().build(); @Rule public Tester tester = new Tester(orchestrator).disableOrganizations(); diff --git a/tests/src/test/java/org/sonarqube/tests/user/RealmAuthenticationTest.java b/tests/src/test/java/org/sonarqube/tests/user/RealmAuthenticationTest.java index e5586b474e2..c0f14d8e6a3 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/RealmAuthenticationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/user/RealmAuthenticationTest.java @@ -51,6 +51,7 @@ import static java.net.HttpURLConnection.HTTP_OK; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.newUserWsClient; import static util.ItUtils.pluginArtifact; import static util.ItUtils.resetSettings; @@ -76,7 +77,7 @@ public class RealmAuthenticationTest { private static final String USERS_PROPERTY = "sonar.fakeauthenticator.users"; @ClassRule - public static final Orchestrator orchestrator = Orchestrator.builderEnv() + public static final Orchestrator orchestrator = newOrchestratorBuilder() .addPlugin(pluginArtifact("security-plugin")) .setServerProperty("sonar.security.realm", "FakeRealm") .build(); diff --git a/tests/src/test/java/org/sonarqube/tests/user/SsoAuthenticationTest.java b/tests/src/test/java/org/sonarqube/tests/user/SsoAuthenticationTest.java index 07159881842..146f37ea777 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/SsoAuthenticationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/user/SsoAuthenticationTest.java @@ -34,6 +34,7 @@ import util.user.UserRule; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.call; +import static util.ItUtils.newOrchestratorBuilder; /** * Test SSO authentication (using HTTP headers). @@ -56,7 +57,7 @@ public class SsoAuthenticationTest { static final String GROUP_3 = "group-3"; @ClassRule - public static final Orchestrator orchestrator = Orchestrator.builderEnv() + public static final Orchestrator orchestrator = newOrchestratorBuilder() .setServerProperty("sonar.web.sso.enable", "true") .setServerProperty("sonar.web.sso.loginHeader", LOGIN_HEADER) .setServerProperty("sonar.web.sso.nameHeader", NAME_HEADER) diff --git a/tests/src/test/java/org/sonarqube/tests/user/UserEsResilienceTest.java b/tests/src/test/java/org/sonarqube/tests/user/UserEsResilienceTest.java index ca5516f3896..92ff670f0e3 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/UserEsResilienceTest.java +++ b/tests/src/test/java/org/sonarqube/tests/user/UserEsResilienceTest.java @@ -39,6 +39,7 @@ import util.ItUtils; import static org.assertj.core.api.Assertions.assertThat; import static org.sonarqube.tests.Byteman.Process.WEB; import static util.ItUtils.expectHttpError; +import static util.ItUtils.newOrchestratorBuilder; public class UserEsResilienceTest { @@ -47,7 +48,7 @@ public class UserEsResilienceTest { private static final Byteman byteman; static { - byteman = new Byteman(Orchestrator.builderEnv(), WEB); + byteman = new Byteman(newOrchestratorBuilder(), WEB); orchestrator = byteman .getOrchestratorBuilder() .setServerProperty("sonar.search.recovery.delayInMs", "1000") diff --git a/tests/src/test/java/org/sonarqube/tests/user/UserSuite.java b/tests/src/test/java/org/sonarqube/tests/user/UserSuite.java index 4eb7d0138dd..0f448dd9a7a 100644 --- a/tests/src/test/java/org/sonarqube/tests/user/UserSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/user/UserSuite.java @@ -25,6 +25,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.pluginArtifact; import static util.ItUtils.xooPlugin; @@ -44,7 +45,7 @@ import static util.ItUtils.xooPlugin; public class UserSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) // Used in BaseIdentityProviderTest diff --git a/tests/src/test/java/org/sonarqube/tests/webhook/WebhooksSuite.java b/tests/src/test/java/org/sonarqube/tests/webhook/WebhooksSuite.java index 6412ec5c48e..e3bc89f9269 100644 --- a/tests/src/test/java/org/sonarqube/tests/webhook/WebhooksSuite.java +++ b/tests/src/test/java/org/sonarqube/tests/webhook/WebhooksSuite.java @@ -24,6 +24,7 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; +import static util.ItUtils.newOrchestratorBuilder; import static util.ItUtils.xooPlugin; @RunWith(Suite.class) @@ -34,7 +35,7 @@ import static util.ItUtils.xooPlugin; public class WebhooksSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() + public static final Orchestrator ORCHESTRATOR = newOrchestratorBuilder() .addPlugin(xooPlugin()) // reduce memory for Elasticsearch diff --git a/tests/src/test/java/util/ItUtils.java b/tests/src/test/java/util/ItUtils.java index d91c8e37872..a5c763180de 100644 --- a/tests/src/test/java/util/ItUtils.java +++ b/tests/src/test/java/util/ItUtils.java @@ -25,6 +25,7 @@ import com.google.common.collect.ImmutableMap; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarRunner; import com.sonar.orchestrator.container.Server; @@ -54,6 +55,7 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; @@ -96,8 +98,23 @@ public class ItUtils { private ItUtils() { } + public static OrchestratorBuilder newOrchestratorBuilder() { + OrchestratorBuilder builder = Orchestrator.builderEnv(); + String version = System.getProperty("sonar.runtimeVersion"); + if (StringUtils.isEmpty(version)) { + File zip = FileLocation.byWildcardMavenFilename(new File("../sonar-application/build/distributions"), "sonar-application-*.zip").getFile(); + builder.setZipFile(zip); + } else { + builder.setSonarVersion(version); + } + return builder + // reduce memory for Elasticsearch + .setServerProperty("sonar.search.javaOpts", "-Xms128m -Xmx128m") + .setOrchestratorProperty("orchestrator.workspaceDir", "build/it"); + } + public static FileLocation xooPlugin() { - return FileLocation.byWildcardMavenFilename(new File("../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar"); + return FileLocation.byWildcardMavenFilename(new File("../plugins/sonar-xoo-plugin/build/libs"), "sonar-xoo-plugin-*.jar"); } public static List<Issue> getAllServerIssues(Orchestrator orchestrator) { @@ -164,7 +181,7 @@ public class ItUtils { * @param dirName the directory of it/plugins, for example "sonar-fake-plugin". */ public static FileLocation pluginArtifact(String dirName) { - return FileLocation.byWildcardMavenFilename(new File("plugins/" + dirName + "/target"), dirName + "-*.jar"); + return FileLocation.byWildcardMavenFilename(new File("plugins/" + dirName + "/build/libs"), dirName + "-*.jar"); } /** |