]> source.dussan.org Git - sonarqube.git/commitdiff
Add integration tests on updatecenter and testing categories
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 26 Jun 2015 17:56:08 +0000 (19:56 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Jun 2015 09:03:33 +0000 (11:03 +0200)
35 files changed:
it/it-plugins/pom.xml
it/it-plugins/sonar-fake-plugin/pom.xml [new file with mode: 0644]
it/it-plugins/sonar-fake-plugin/src/main/java/FakePlugin.java [new file with mode: 0644]
it/it-tests/pom.xml
it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
it/it-tests/src/test/java/testing/suite/CoverageTest.java [new file with mode: 0644]
it/it-tests/src/test/java/testing/suite/CoverageTrackingTest.java [new file with mode: 0644]
it/it-tests/src/test/java/testing/suite/TestExecutionTest.java [new file with mode: 0644]
it/it-tests/src/test/java/testing/suite/TestingTestSuite.java [new file with mode: 0644]
it/it-tests/src/test/java/updatecenter/UpdateCenterSystemUpdateTest.java [new file with mode: 0644]
it/it-tests/src/test/java/updatecenter/UpdateCenterTest.java [new file with mode: 0644]
it/it-tests/src/test/java/util/ItUtils.java
it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html [new file with mode: 0644]
it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html [new file with mode: 0644]
it/it-tests/src/test/resources/selenium/qualitygate/notifications/activate_notification_channels.html [deleted file]
it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html [deleted file]
it/it-tests/src/test/resources/testing/suite/CoverageTest/it_coverage-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage_no_condition-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/CoverageTest/ut_and_it_coverage-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/covered_files-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/tests-expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/testing/suite/TestExecutionTest/expected.json [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-dependencies.properties [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-system-update-with-already-compatible-plugins.properties [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-with-missing-plugin-version.properties [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center.properties [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/available-plugins.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/installed-plugins.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/plugin-updates.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/refresh-update-center.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/system-updates-with-missing-installed-plugin-version.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/system-updates-without-plugin-updates.html [new file with mode: 0644]
it/it-tests/src/test/resources/updatecenter/system-updates.html [new file with mode: 0644]
it/pom.xml

index d901ff66a447da61e4a4b6bb9503fa3591ae68b3..8fb85d96e95d468948035a2d4b457433ed90fae6 100644 (file)
     </plugins>
   </build>
 
+  <properties>
+    <apiVersion>${project.parent.version}</apiVersion>
+  </properties>
 
+  <modules>
+    <module>sonar-fake-plugin</module>
+  </modules>
 </project>
diff --git a/it/it-plugins/sonar-fake-plugin/pom.xml b/it/it-plugins/sonar-fake-plugin/pom.xml
new file mode 100644 (file)
index 0000000..c2ce047
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.sonarsource.it</groupId>
+    <artifactId>it-plugins</artifactId>
+    <version>5.2-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>sonar-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.codehaus.sonar</groupId>
+      <artifactId>sonar-plugin-api</artifactId>
+      <version>${apiVersion}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.sonar</groupId>
+        <artifactId>sonar-packaging-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <version>1.12.1</version>
+        <configuration>
+          <pluginClass>FakePlugin</pluginClass>
+          <pluginKey>fake</pluginKey>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/it/it-plugins/sonar-fake-plugin/src/main/java/FakePlugin.java b/it/it-plugins/sonar-fake-plugin/src/main/java/FakePlugin.java
new file mode 100644 (file)
index 0000000..ef57a7a
--- /dev/null
@@ -0,0 +1,12 @@
+import org.sonar.api.SonarPlugin;
+
+import java.util.Collections;
+import java.util.List;
+
+public final class FakePlugin extends SonarPlugin {
+
+  public List getExtensions() {
+    return Collections.emptyList();
+  }
+
+}
index b24d0a74dbc6b1603b19ff7d71fc758fbab443b9..171bdf86b99dffd0becbbc0f4c485ce94934098a 100644 (file)
   </properties>
 
   <dependencies>
+    <dependency>
+      <groupId>org.codehaus.sonar.plugins</groupId>
+      <artifactId>sonar-xoo-plugin</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.sonar</groupId>
+      <artifactId>sonar-application</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
     <dependency>
       <groupId>org.sonarsource.it</groupId>
       <artifactId>it-plugins</artifactId>
index 12e3ca3da91a15bfe0b3b34383e81719c8b8c313..582cb58fd0b32f7c3aea2c8e327fe530e3d24344 100644 (file)
@@ -62,8 +62,8 @@ public class QualityGateNotificationTest {
       Selenese selenese = Selenese
         .builder()
         .setHtmlTestsInClasspath("notifications",
-          "/selenium/qualitygate/notifications/email_configuration.html",
-          "/selenium/qualitygate/notifications/activate_notification_channels.html").build();
+          "/qualitygate/notifications/email_configuration.html",
+          "/qualitygate/notifications/activate_notification_channels.html").build();
       orchestrator.executeSelenese(selenese);
 
       // Create quality gate with conditions on variations
diff --git a/it/it-tests/src/test/java/testing/suite/CoverageTest.java b/it/it-tests/src/test/java/testing/suite/CoverageTest.java
new file mode 100644 (file)
index 0000000..16c0be3
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package testing.suite;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import org.apache.commons.io.IOUtils;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.sonar.wsclient.services.Resource;
+import org.sonar.wsclient.services.ResourceQuery;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.projectDir;
+
+public class CoverageTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = TestingTestSuite.ORCHESTRATOR;
+
+  private static final String[] ALL_COVERAGE_METRICS = new String[] {
+    "line_coverage", "lines_to_cover", "uncovered_lines", "branch_coverage", "conditions_to_cover", "uncovered_conditions", "coverage",
+    "it_line_coverage", "it_lines_to_cover", "it_uncovered_lines", "it_branch_coverage", "it_conditions_to_cover", "it_uncovered_conditions", "it_coverage",
+    "overall_line_coverage", "overall_lines_to_cover", "overall_uncovered_lines", "overall_branch_coverage", "overall_conditions_to_cover", "overall_uncovered_conditions",
+    "overall_coverage"
+  };
+
+  @Before
+  public void delete_data() {
+    orchestrator.resetData();
+  }
+
+  @Test
+  public void unit_test_coverage() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-ut-coverage")));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("sample-ut-coverage", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("line_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("uncovered_lines")).isEqualTo(2);
+    assertThat(project.getMeasureValue("branch_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("conditions_to_cover")).isEqualTo(2);
+    assertThat(project.getMeasureValue("uncovered_conditions")).isEqualTo(1);
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(50.0);
+
+    assertThat(project.getMeasureValue("it_coverage")).isNull();
+
+    assertThat(project.getMeasureValue("overall_coverage")).isNull();
+
+    String coverage = orchestrator.getServer().adminWsClient().get("api/sources/lines", "key", "sample-ut-coverage:src/main/xoo/sample/Sample.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTest/unit_test_coverage-expected.json"), "UTF-8"), coverage, false);
+  }
+
+  @Test
+  public void unit_test_coverage_no_condition() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-ut-coverage-no-condition")));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("sample-ut-coverage", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("line_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("uncovered_lines")).isEqualTo(2);
+    assertThat(project.getMeasureValue("branch_coverage")).isNull();
+    assertThat(project.getMeasureValue("conditions_to_cover")).isNull();
+    assertThat(project.getMeasureValue("uncovered_conditions")).isNull();
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(50.0);
+
+    assertThat(project.getMeasureValue("it_coverage")).isNull();
+
+    assertThat(project.getMeasureValue("overall_coverage")).isNull();
+
+    String coverage = orchestrator.getServer().adminWsClient().get("api/sources/lines", "key", "sample-ut-coverage:src/main/xoo/sample/Sample.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTest/unit_test_coverage_no_condition-expected.json"), "UTF-8"), coverage, false);
+  }
+
+  @Test
+  public void it_coverage() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-it-coverage")));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("sample-it-coverage", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("coverage")).isNull();
+
+    assertThat(project.getMeasureValue("it_line_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("it_lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("it_uncovered_lines")).isEqualTo(2);
+    assertThat(project.getMeasureValue("it_branch_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("it_conditions_to_cover")).isEqualTo(2);
+    assertThat(project.getMeasureValue("it_uncovered_conditions")).isEqualTo(1);
+    assertThat(project.getMeasureValue("it_coverage")).isEqualTo(50.0);
+
+    assertThat(project.getMeasureValue("overall_coverage")).isNull();
+
+    String coverage = orchestrator.getServer().adminWsClient().get("api/sources/lines", "key", "sample-it-coverage:src/main/xoo/sample/Sample.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTest/it_coverage-expected.json"), "UTF-8"), coverage, false);
+  }
+
+  @Test
+  public void ut_and_it_coverage() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-overall-coverage")));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("sample-overall-coverage", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("line_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("uncovered_lines")).isEqualTo(2);
+    assertThat(project.getMeasureValue("branch_coverage")).isEqualTo(25.0);
+    assertThat(project.getMeasureValue("conditions_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("uncovered_conditions")).isEqualTo(3);
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(37.5);
+
+    assertThat(project.getMeasureValue("it_line_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("it_lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("it_uncovered_lines")).isEqualTo(2);
+    assertThat(project.getMeasureValue("it_branch_coverage")).isEqualTo(25.0);
+    assertThat(project.getMeasureValue("it_conditions_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("it_uncovered_conditions")).isEqualTo(3);
+    assertThat(project.getMeasureValue("it_coverage")).isEqualTo(37.5);
+
+    assertThat(project.getMeasureValue("overall_line_coverage")).isEqualTo(75.0);
+    assertThat(project.getMeasureValue("overall_lines_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("overall_uncovered_lines")).isEqualTo(1);
+    assertThat(project.getMeasureValue("overall_branch_coverage")).isEqualTo(50.0);
+    assertThat(project.getMeasureValue("overall_conditions_to_cover")).isEqualTo(4);
+    assertThat(project.getMeasureValue("overall_uncovered_conditions")).isEqualTo(2);
+    assertThat(project.getMeasureValue("overall_coverage")).isEqualTo(62.5);
+
+    String coverage = orchestrator.getServer().adminWsClient().get("api/sources/lines", "key", "sample-overall-coverage:src/main/xoo/sample/Sample.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTest/ut_and_it_coverage-expected.json"), "UTF-8"), coverage, false);
+  }
+
+  /**
+   * SONAR-766
+   */
+  @Test
+  public void should_compute_coverage_on_project() {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-half-covered")));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("xoo-half-covered", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(50.0);
+  }
+
+  /**
+   * SONAR-766
+   */
+  @Test
+  @Ignore("TODO")
+  public void should_ignore_coverage_on_full_path() {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-half-covered"))
+      .setProperty("sonar.coverage.exclusions", "src/main/xoo/org/sonar/tests/halfcovered/UnCovered.xoo"));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("xoo-half-covered", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(100.0);
+  }
+
+  /**
+   * SONAR-766
+   */
+  @Test
+  @Ignore("TODO")
+  public void should_ignore_coverage_on_pattern() {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-half-covered"))
+      .setProperty("sonar.coverage.exclusions", "**/UnCovered*"));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("xoo-half-covered", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("coverage")).isEqualTo(100.0);
+  }
+
+  /**
+   * SONAR-766
+   */
+  @Test
+  public void should_not_have_coverage_at_all() {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-half-covered"))
+      .setProperty("sonar.coverage.exclusions", "**/*"));
+
+    Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("xoo-half-covered", ALL_COVERAGE_METRICS));
+    assertThat(project.getMeasureValue("coverage")).isNull();
+  }
+
+}
diff --git a/it/it-tests/src/test/java/testing/suite/CoverageTrackingTest.java b/it/it-tests/src/test/java/testing/suite/CoverageTrackingTest.java
new file mode 100644 (file)
index 0000000..5af2867
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package testing.suite;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.commons.io.IOUtils;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.skyscreamer.jsonassert.JSONAssert;
+
+import static util.ItUtils.projectDir;
+
+public class CoverageTrackingTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = TestingTestSuite.ORCHESTRATOR;
+
+  @Before
+  public void delete_data() {
+    orchestrator.resetData();
+  }
+
+  @Test
+  public void test_coverage_per_test() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-with-coverage-per-test")));
+
+    String tests = orchestrator.getServer().adminWsClient().get("api/tests/list", "testFileKey", "sample-with-tests:src/test/xoo/sample/SampleTest.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTrackingTest/tests-expected.json"), "UTF-8"), tests, false);
+
+    String covered_files = orchestrator.getServer().adminWsClient()
+      .get("api/tests/covered_files", "testUuid", extractSuccessfulTestUuid(tests));
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("CoverageTrackingTest/covered_files-expected.json"), "UTF-8"), covered_files, false);
+  }
+
+  private String extractSuccessfulTestUuid(String json) {
+    Matcher jsonObjectMatcher = Pattern.compile(".*\\{((.*?)success(.*?))\\}.*", Pattern.MULTILINE).matcher(json);
+    jsonObjectMatcher.find();
+
+    Matcher uuidMatcher = Pattern.compile(".*\"testUuid\"\\s*?:\\s*?\"(\\S*?)\".*", Pattern.MULTILINE).matcher(jsonObjectMatcher.group(1));
+    return uuidMatcher.find() ? uuidMatcher.group(1) : "";
+  }
+}
diff --git a/it/it-tests/src/test/java/testing/suite/TestExecutionTest.java b/it/it-tests/src/test/java/testing/suite/TestExecutionTest.java
new file mode 100644 (file)
index 0000000..a6ac069
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package testing.suite;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import org.apache.commons.io.IOUtils;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.sonar.wsclient.services.Resource;
+import org.sonar.wsclient.services.ResourceQuery;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.projectDir;
+
+public class TestExecutionTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = TestingTestSuite.ORCHESTRATOR;
+
+  @Before
+  public void delete_data() {
+    orchestrator.resetData();
+  }
+
+  @Test
+  public void test_execution() throws Exception {
+    orchestrator.executeBuilds(SonarRunner.create(projectDir("testing/xoo-sample-with-tests-execution")));
+
+    Resource project = orchestrator.getServer().getWsClient()
+      .find(ResourceQuery.createForMetrics("sample-with-tests", "test_success_density", "test_failures", "test_errors", "tests", "skipped_tests", "test_execution_time"));
+    assertThat(project.getMeasureValue("test_success_density")).isEqualTo(50.0);
+    assertThat(project.getMeasureIntValue("test_failures")).isEqualTo(1);
+    assertThat(project.getMeasureIntValue("test_errors")).isEqualTo(1);
+    assertThat(project.getMeasureIntValue("tests")).isEqualTo(4);
+    assertThat(project.getMeasureIntValue("skipped_tests")).isEqualTo(1);
+    assertThat(project.getMeasureIntValue("test_execution_time")).isEqualTo(8);
+
+    String json = orchestrator.getServer().adminWsClient().get("api/tests/list", "testFileKey", "sample-with-tests:src/test/xoo/sample/SampleTest.xoo");
+    JSONAssert.assertEquals(IOUtils.toString(this.getClass().getResourceAsStream("TestExecutionTest/expected.json"), "UTF-8"), json, false);
+  }
+}
diff --git a/it/it-tests/src/test/java/testing/suite/TestingTestSuite.java b/it/it-tests/src/test/java/testing/suite/TestingTestSuite.java
new file mode 100644 (file)
index 0000000..bb6ebdc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package testing.suite;
+
+import com.sonar.orchestrator.Orchestrator;
+import org.junit.ClassRule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import util.ItUtils;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+  CoverageTrackingTest.class,
+  CoverageTest.class,
+  TestExecutionTest.class
+})
+public class TestingTestSuite {
+
+  @ClassRule
+  public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
+    .addPlugin(ItUtils.xooPlugin())
+    .build();
+}
diff --git a/it/it-tests/src/test/java/updatecenter/UpdateCenterSystemUpdateTest.java b/it/it-tests/src/test/java/updatecenter/UpdateCenterSystemUpdateTest.java
new file mode 100644 (file)
index 0000000..20ed430
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package updatecenter;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.selenium.Selenese;
+import java.io.File;
+import java.io.IOException;
+import org.apache.commons.io.FileUtils;
+import org.junit.After;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.pluginArtifact;
+
+public class UpdateCenterSystemUpdateTest {
+
+  Orchestrator orchestrator;
+
+  @After
+  public void stop() {
+    if (orchestrator != null) {
+      orchestrator.stop();
+    }
+  }
+
+  /**
+   * SONAR-4279
+   */
+  @Test
+  public void should_not_display_already_compatible_plugins_on_system_update() {
+    orchestrator = Orchestrator.builderEnv()
+      .setServerProperty("sonar.updatecenter.url",
+        UpdateCenterSystemUpdateTest.class.getResource("UpdateCenterTest/update-center-system-update-with-already-compatible-plugins.properties").toString())
+      .addPlugin(pluginArtifact("sonar-fake-plugin"))
+      .build();
+
+    orchestrator.start();
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("system-updates-without-plugin-updates",
+      "/updatecenter/system-updates-without-plugin-updates.html"
+      ).build();
+    orchestrator.executeSelenese(selenese);
+  }
+
+  /**
+   * SONAR-4585
+   */
+  @Test
+  public void should_system_update_page_not_fail_when_installed_plugin_version_not_found_in_update_center_definitions() throws IOException {
+    orchestrator = Orchestrator.builderEnv()
+      .setServerProperty("sonar.updatecenter.url",
+        UpdateCenterSystemUpdateTest.class.getResource("UpdateCenterTest/update-center-with-missing-plugin-version.properties").toString())
+      .addPlugin(pluginArtifact("sonar-fake-plugin"))
+      .build();
+
+    orchestrator.start();
+
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("system-updates-with-missing-installed-plugin-version",
+      "/updatecenter/system-updates-with-missing-installed-plugin-version.html"
+      ).build();
+    orchestrator.executeSelenese(selenese);
+
+    // Exception stacktrace should not be in logs
+    File logs = orchestrator.getServer().getLogs();
+    assertThat(FileUtils.readFileToString(logs)).doesNotContain("NoSuchElementException");
+  }
+
+}
diff --git a/it/it-tests/src/test/java/updatecenter/UpdateCenterTest.java b/it/it-tests/src/test/java/updatecenter/UpdateCenterTest.java
new file mode 100644 (file)
index 0000000..12f214a
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2009-2014 SonarSource SA
+ * All rights reserved
+ * mailto:contact AT sonarsource DOT com
+ */
+package updatecenter;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.selenium.Selenese;
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.wsclient.services.Plugin;
+import org.sonar.wsclient.services.UpdateCenterQuery;
+
+import static junit.framework.Assert.assertNotNull;
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.pluginArtifact;
+
+public class UpdateCenterTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = Orchestrator.builderEnv()
+    .setServerProperty("sonar.updatecenter.url", UpdateCenterTest.class.getResource("UpdateCenterTest/update-center.properties").toString())
+    .addPlugin(pluginArtifact("sonar-fake-plugin"))
+    .build();
+
+  @Test
+  public void web_service_should_return_installed_plugins() {
+    List<Plugin> plugins = orchestrator.getServer().getAdminWsClient().findAll(UpdateCenterQuery.createForInstalledPlugins());
+    assertThat(plugins.size()).isGreaterThan(0);
+
+    Plugin installedPlugin = findPlugin(plugins, "fake");
+    assertNotNull(installedPlugin);
+    assertThat(installedPlugin.getName()).isEqualTo("Plugins :: Fake");
+    assertThat(installedPlugin.getVersion()).isEqualTo("1.0-SNAPSHOT");
+  }
+
+  @Test
+  public void test_console() {
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server-update-center",
+      "/updatecenter/installed-plugins.html",
+      "/updatecenter/plugin-updates.html",
+      "/updatecenter/refresh-update-center.html",
+      "/updatecenter/system-updates.html",
+      "/updatecenter/available-plugins.html"
+      ).build();
+    orchestrator.executeSelenese(selenese);
+  }
+
+  private Plugin findPlugin(List<Plugin> plugins, String pluginKey) {
+    for (Plugin plugin : plugins) {
+      if (StringUtils.equals(pluginKey, plugin.getKey())) {
+        return plugin;
+      }
+    }
+    return null;
+  }
+
+}
index 09124d89ac8c77c6a47e44e883d6b45f2b000606..f0392cf732c6f3191a56325672505a22aecea70e 100644 (file)
@@ -52,4 +52,18 @@ public class ItUtils {
     }
     return dir;
   }
+
+  /**
+   * Locate the artifact of a fake plugin stored in it/it-plugins.
+   *
+   * @param dirName the directory of it/it-plugins, for example "sonar-fake-plugin".
+   *                     It assumes that version is 1.0-SNAPSHOT
+   */
+  public static FileLocation pluginArtifact(String dirName) {
+    File file = new File(HOME_DIR.get(), "it/it-plugins/" + dirName + "/target/" + dirName + "-1.0-SNAPSHOT.jar");
+    if (!file.exists()) {
+      throw new IllegalStateException(String.format("Plugin [%s]for integration tests is not built. File not found:%s", dirName, file));
+    }
+    return FileLocation.of(file);
+  }
 }
diff --git a/it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html b/it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html
new file mode 100644 (file)
index 0000000..8e0bce0
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>create_user_with_email</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">create_user_with_email</td>
+    </tr>
+    </thead>
+    <tbody>
+<tr>
+       <td>open</td>
+       <td>/sonar/sessions/new</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>login</td>
+       <td>tester</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>password</td>
+       <td>tester</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/account/index</td>
+       <td></td>
+</tr>
+<tr>
+       <td>check</td>
+       <td>global_notifs_NewAlerts.EmailNotificationChannel</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//input[@value='Save changes']</td>
+       <td></td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html b/it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html
new file mode 100644 (file)
index 0000000..3d32118
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>email_configuration</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>setTimeout</td>
+        <td>300000</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/email_configuration</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyValue</td>
+        <td>smtp_host</td>
+        <td>localhost</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>to_address</td>
+        <td>test@example.org</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>submit_test</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>info</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/selenium/qualitygate/notifications/activate_notification_channels.html b/it/it-tests/src/test/resources/selenium/qualitygate/notifications/activate_notification_channels.html
deleted file mode 100644 (file)
index 8e0bce0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>create_user_with_email</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">create_user_with_email</td>
-    </tr>
-    </thead>
-    <tbody>
-<tr>
-       <td>open</td>
-       <td>/sonar/sessions/new</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>login</td>
-       <td>tester</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>password</td>
-       <td>tester</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sonar/account/index</td>
-       <td></td>
-</tr>
-<tr>
-       <td>check</td>
-       <td>global_notifs_NewAlerts.EmailNotificationChannel</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>//input[@value='Save changes']</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html b/it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html
deleted file mode 100644 (file)
index 3d32118..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>email_configuration</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>setTimeout</td>
-        <td>300000</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/new</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/email_configuration</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>verifyValue</td>
-        <td>smtp_host</td>
-        <td>localhost</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>to_address</td>
-        <td>test@example.org</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>submit_test</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForVisible</td>
-        <td>info</td>
-        <td></td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTest/it_coverage-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTest/it_coverage-expected.json
new file mode 100644 (file)
index 0000000..1bf11e7
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "sources": [
+    {
+      "line": 1,
+      "code": "package sample;",
+    },
+    {
+      "line": 2,
+      "code": "",
+    },
+    {
+      "line": 3,
+      "code": "public class Sample {",
+    },
+    {
+      "line": 4,
+      "code": "\t",
+    },
+    {
+      "line": 5,
+      "code": "\tpublic Sample(int i) {",
+    },
+    {
+      "line": 6,
+      "code": "\t\tint j = i++;",
+      "itLineHits": 1
+    },
+    {
+      "line": 7,
+      "code": "\t}",
+    },
+    {
+      "line": 8,
+      "code": "\t",
+    },
+    {
+      "line": 9,
+      "code": "\tprivate String myMethod() {",
+    },
+    {
+      "line": 10,
+      "code": "\t\tif (foo == bar) {",
+      "itLineHits": 0
+    },
+    {
+      "line": 11,
+      "code": "\t\t\treturn \"hello\";",
+      "itLineHits": 1
+    },
+    {
+      "line": 12,
+      "code": "\t\t} else {",
+    },
+    {
+      "line": 13,
+      "code": "\t\t\tthrow new IllegalStateException();",
+      "itLineHits": 0
+    },
+    {
+      "line": 14,
+      "code": "\t\t}",
+    },
+    {
+      "line": 15,
+      "code": "\t}",
+    },
+    {
+      "line": 16,
+      "code": "}",
+    },
+    {
+      "line": 17,
+      "code": "",
+    }
+  ]
+
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage-expected.json
new file mode 100644 (file)
index 0000000..ae72588
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "sources":[
+    {
+      "line": 1,
+      "code": "package sample;",
+    },
+    {
+      "line": 2,
+      "code": "",
+    },
+    {
+      "line": 3,
+      "code": "public class Sample {",
+    },
+    {
+      "line": 4,
+      "code": "\t",
+    },
+    {
+      "line": 5,
+      "code": "\tpublic Sample(int i) {",
+    },
+    {
+      "line": 6,
+      "code": "\t\tint j = i++;",
+      "utLineHits": 1
+    },
+    {
+      "line": 7,
+      "code": "\t}",
+    },
+    {
+      "line": 8,
+      "code": "\t",
+    },
+    {
+      "line": 9,
+      "code": "\tprivate String myMethod() {",
+    },
+    {
+      "line": 10,
+      "code": "\t\tif (foo == bar) {",
+      "utLineHits": 0,
+      "utConditions": 2,
+      "utCoveredConditions": 1
+    },
+    {
+      "line": 11,
+      "code": "\t\t\treturn \"hello\";",
+      "utLineHits": 1
+    },
+    {
+      "line": 12,
+      "code": "\t\t} else {",
+    },
+    {
+      "line": 13,
+      "code": "\t\t\tthrow new IllegalStateException();",
+      "utLineHits": 0
+    },
+    {
+      "line": 14,
+      "code": "\t\t}",
+    },
+    {
+      "line": 15,
+      "code": "\t}",
+    },
+    {
+      "line": 16,
+      "code": "}",
+    },
+    {
+      "line": 17,
+      "code": "",
+    }
+  ]
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage_no_condition-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTest/unit_test_coverage_no_condition-expected.json
new file mode 100644 (file)
index 0000000..6f5d2f7
--- /dev/null
@@ -0,0 +1,76 @@
+{
+  "sources": [
+    {
+      "line": 1,
+      "code": "package sample;",
+    },
+    {
+      "line": 2,
+      "code": "",
+    },
+    {
+      "line": 3,
+      "code": "public class Sample {",
+    },
+    {
+      "line": 4,
+      "code": "\t",
+    },
+    {
+      "line": 5,
+      "code": "\tpublic Sample(int i) {",
+    },
+    {
+      "line": 6,
+      "code": "\t\tint j = i++;",
+      "utLineHits": 1
+    },
+    {
+      "line": 7,
+      "code": "\t}",
+    },
+    {
+      "line": 8,
+      "code": "\t",
+    },
+    {
+      "line": 9,
+      "code": "\tprivate String myMethod() {",
+    },
+    {
+      "line": 10,
+      "code": "\t\tif (foo == bar) {",
+      "utLineHits": 0
+    },
+    {
+      "line": 11,
+      "code": "\t\t\treturn \"hello\";",
+      "utLineHits": 1
+    },
+    {
+      "line": 12,
+      "code": "\t\t} else {",
+    },
+    {
+      "line": 13,
+      "code": "\t\t\tthrow new IllegalStateException();",
+      "utLineHits": 0
+    },
+    {
+      "line": 14,
+      "code": "\t\t}",
+    },
+    {
+      "line": 15,
+      "code": "\t}",
+    },
+    {
+      "line": 16,
+      "code": "}",
+    },
+    {
+      "line": 17,
+      "code": "",
+    }
+  ]
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTest/ut_and_it_coverage-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTest/ut_and_it_coverage-expected.json
new file mode 100644 (file)
index 0000000..9d12abb
--- /dev/null
@@ -0,0 +1,85 @@
+{
+  "sources": [
+    {
+      "line": 1,
+      "code": "package sample;",
+    },
+    {
+      "line": 2,
+      "code": "",
+    },
+    {
+      "line": 3,
+      "code": "public class Sample {",
+    },
+    {
+      "line": 4,
+      "code": "\t",
+    },
+    {
+      "line": 5,
+      "code": "\tpublic Sample(int i) {",
+    },
+    {
+      "line": 6,
+      "code": "\t\tint j = i++;",
+      "utLineHits": 1,
+      "itLineHits": 1
+    },
+    {
+      "line": 7,
+      "code": "\t}",
+    },
+    {
+      "line": 8,
+      "code": "\t",
+    },
+    {
+      "line": 9,
+      "code": "\tprivate String myMethod() {",
+    },
+    {
+      "line": 10,
+      "code": "\t\tif (foo == bar &amp;&amp; biz &gt; 1) {",
+      "utLineHits": 0,
+      "utConditions": 4,
+      "utCoveredConditions": 1,
+      "itLineHits": 0,
+      "itConditions": 4,
+      "itCoveredConditions": 1
+    },
+    {
+      "line": 11,
+      "code": "\t\t\treturn \"hello\";",
+      "utLineHits": 1,
+      "itLineHits": 0
+    },
+    {
+      "line": 12,
+      "code": "\t\t} else {",
+    },
+    {
+      "line": 13,
+      "code": "\t\t\tthrow new IllegalStateException();",
+      "utLineHits": 0,
+      "itLineHits": 1
+    },
+    {
+      "line": 14,
+      "code": "\t\t}",
+    },
+    {
+      "line": 15,
+      "code": "\t}",
+    },
+    {
+      "line": 16,
+      "code": "}",
+    },
+    {
+      "line": 17,
+      "code": "",
+    }
+  ]
+
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/covered_files-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/covered_files-expected.json
new file mode 100644 (file)
index 0000000..5dda4f3
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "files": [
+    {
+      "key": "sample-with-tests:src/main/xoo/sample/Sample.xoo",
+      "longName": "src/main/xoo/sample/Sample.xoo",
+      "coveredLines": 2
+    },
+    {
+      "key": "sample-with-tests:src/main/xoo/sample/Sample2.xoo",
+      "longName": "src/main/xoo/sample/Sample2.xoo",
+      "coveredLines": 1
+    }
+  ]
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/tests-expected.json b/it/it-tests/src/test/resources/testing/suite/CoverageTrackingTest/tests-expected.json
new file mode 100644 (file)
index 0000000..f957eca
--- /dev/null
@@ -0,0 +1,35 @@
+{
+  "tests": [
+    {
+      "name": "success",
+      "status": "OK",
+      "durationInMs": 4,
+      "coveredLines": 3,
+      "message": "",
+      "stacktrace": ""
+    },
+    {
+      "name": "error",
+      "status": "ERROR",
+      "durationInMs": 2,
+      "coveredLines": 0,
+      "message": "Error",
+      "stacktrace": "The stack"
+    },
+    {
+      "name": "failure",
+      "status": "FAILURE",
+      "durationInMs": 2,
+      "coveredLines": 1,
+      "message": "Failure",
+      "stacktrace": ""
+    },
+    {
+      "name": "skipped",
+      "status": "SKIPPED",
+      "coveredLines": 0,
+      "message": "",
+      "stacktrace": ""
+    }
+  ]
+}
diff --git a/it/it-tests/src/test/resources/testing/suite/TestExecutionTest/expected.json b/it/it-tests/src/test/resources/testing/suite/TestExecutionTest/expected.json
new file mode 100644 (file)
index 0000000..8ad71d6
--- /dev/null
@@ -0,0 +1,35 @@
+{
+  "tests": [
+    {
+      "name": "success",
+      "status": "OK",
+      "durationInMs": 4,
+      "coveredLines": 0,
+      "message": "",
+      "stacktrace": ""
+    },
+    {
+      "name": "error",
+      "status": "ERROR",
+      "durationInMs": 2,
+      "coveredLines": 0,
+      "message": "Error",
+      "stacktrace": "The stack"
+    },
+    {
+      "name": "failure",
+      "status": "FAILURE",
+      "durationInMs": 2,
+      "coveredLines": 0,
+      "message": "Failure",
+      "stacktrace": ""
+    },
+    {
+      "name": "skipped",
+      "status": "SKIPPED",
+      "coveredLines": 0,
+      "message": "",
+      "stacktrace": ""
+    }
+  ]
+}
diff --git a/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-dependencies.properties b/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-dependencies.properties
new file mode 100644 (file)
index 0000000..65baf11
--- /dev/null
@@ -0,0 +1,83 @@
+# THIS FILE IS USED BY THE UPDATE CENTER
+# DO NOT REMOVE OR RENAME
+#
+# Note : prefix all : by \
+#
+
+publicVersions=3.0,100.0
+
+3.0.description=Encryption of database password, TimeMachine available as widgets, New algorithm for tracking violations, 40 bugs and 40 improvements
+3.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-3.0.zip
+3.0.changelogUrl=http\://www.sonarsource.org/downloads/#3.0
+3.0.date=2012-04-17
+
+100.0.description=Hundred dot zero!
+100.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-100.0.zip
+100.0.changelogUrl=http\://www.sonarsource.org/downloads/#100.0
+100.0.date=2112-06-13
+
+
+plugins=dotnet,fxcop,csharp,visualstudio
+
+#--------------------------------------------------------------------------------------------------------------------------
+dotnet.name=DotNet
+dotnet.category=Additional Languages
+dotnet.publicVersions=1.0,1.1
+
+dotnet.1.0.description=Dot Net 1.0
+dotnet.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+dotnet.1.0.downloadUrl=
+dotnet.1.0.date=2011-07-29
+
+dotnet.1.1.description=Dot Net 1.1
+dotnet.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+dotnet.1.1.downloadUrl=
+dotnet.1.1.date=2011-08-28
+
+fxcop.name=FxCop
+fxcop.category=Additional Languages
+fxcop.publicVersions=1.0,1.1
+
+fxcop.1.0.description=FxCop 1.0
+fxcop.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+fxcop.1.0.downloadUrl=
+fxcop.1.0.date=2012-01-05
+fxcop.1.0.parent=dotnet
+
+fxcop.1.1.description=FxCop 1.1
+fxcop.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+fxcop.1.1.downloadUrl=
+fxcop.1.1.date=2012-06-25
+fxcop.1.1.parent=dotnet
+
+csharp.name=C Sharp
+csharp.category=Additional Languages
+csharp.publicVersions=1.0,1.1
+
+csharp.1.0.description=C Sharp 1.0
+csharp.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+csharp.1.0.downloadUrl=
+csharp.1.0.date=2012-01-05
+csharp.1.0.requirePlugins=dotnet:1.0
+
+csharp.1.1.description=C Sharp 1.1
+csharp.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+csharp.1.1.downloadUrl=
+csharp.1.1.date=2012-06-25
+csharp.1.1.requirePlugins=dotnet:1.1
+
+visualstudio.name=Visual Studio
+visualstudio.category=Additional Languages
+visualstudio.publicVersions=1.0,1.1
+
+visualstudio.1.0.description=Visual Studio 1.0
+visualstudio.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+visualstudio.1.0.downloadUrl=
+visualstudio.1.0.date=2012-01-05
+visualstudio.1.0.requirePlugins=csharp:1.0
+
+visualstudio.1.1.description=Visual Studio 1.1
+visualstudio.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5
+visualstudio.1.1.downloadUrl=
+visualstudio.1.1.date=2012-06-25
+visualstudio.1.1.requirePlugins=csharp:1.1
diff --git a/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-system-update-with-already-compatible-plugins.properties b/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-system-update-with-already-compatible-plugins.properties
new file mode 100644 (file)
index 0000000..50c8c2b
--- /dev/null
@@ -0,0 +1,32 @@
+# THIS FILE IS USED BY THE UPDATE CENTER
+# DO NOT REMOVE OR RENAME
+#
+# Note : prefix all : by \
+#
+
+publicVersions=3.0,100.0
+
+3.0.description=Encryption of database password, TimeMachine available as widgets, New algorithm for tracking violations, 40 bugs and 40 improvements
+3.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-3.0.zip
+3.0.changelogUrl=http\://www.sonarsource.org/downloads/#3.0
+3.0.date=2012-04-17
+
+100.0.description=Hundred dot zero!
+100.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-100.0.zip
+100.0.changelogUrl=http\://www.sonarsource.org/downloads/#100.0
+100.0.date=2112-06-13
+
+
+plugins=fake
+
+#--------------------------------------------------------------------------------------------------------------------------
+fake.category=Additional Metrics
+fake.publicVersions=1.0
+fake.name=Fake
+fake.description=Fake plugin for integration tests
+
+fake.1.0.description=Initial release
+fake.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13,3.14,3.15,3.16,100.0
+fake.1.0.downloadUrl=
+fake.1.0.date=2011-05-06
+
diff --git a/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-with-missing-plugin-version.properties b/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center-with-missing-plugin-version.properties
new file mode 100644 (file)
index 0000000..11d35d2
--- /dev/null
@@ -0,0 +1,30 @@
+# THIS FILE IS USED BY THE UPDATE CENTER
+# DO NOT REMOVE OR RENAME
+#
+# Note : prefix all : by \
+#
+
+publicVersions=3.0,100.0
+
+3.0.description=Encryption of database password, TimeMachine available as widgets, New algorithm for tracking violations, 40 bugs and 40 improvements
+3.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-3.0.zip
+3.0.changelogUrl=http\://www.sonarsource.org/downloads/#3.0
+3.0.date=2012-04-17
+
+100.0.description=Hundred dot zero!
+100.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-100.0.zip
+100.0.changelogUrl=http\://www.sonarsource.org/downloads/#100.0
+100.0.date=2112-06-13
+
+plugins=fake
+
+#--------------------------------------------------------------------------------------------------------------------------
+fake.category=Additional Metrics
+fake.publicVersions=1.1
+fake.name=Fake
+fake.description=Fake plugin for integration tests
+
+fake.1.1.description=Support sonar 100.0
+fake.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,3.10,3.11,3.12,3.13,3.14,3.15,3.16,100.0
+fake.1.1.downloadUrl=
+fake.1.1.date=2012-04-27
diff --git a/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center.properties b/it/it-tests/src/test/resources/updatecenter/UpdateCenterTest/update-center.properties
new file mode 100644 (file)
index 0000000..5882d43
--- /dev/null
@@ -0,0 +1,62 @@
+# THIS FILE IS USED BY THE UPDATE CENTER
+# DO NOT REMOVE OR RENAME
+#
+# Note : prefix all : by \
+#
+
+publicVersions=3.0,100.0
+
+3.0.description=Encryption of database password, TimeMachine available as widgets, New algorithm for tracking violations, 40 bugs and 40 improvements
+3.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-3.0.zip
+3.0.changelogUrl=http\://www.sonarsource.org/downloads/#3.0
+3.0.date=2012-04-17
+
+100.0.description=Hundred dot zero!
+100.0.downloadUrl=http\://dist.sonar.codehaus.org/sonar-100.0.zip
+100.0.changelogUrl=http\://www.sonarsource.org/downloads/#100.0
+100.0.date=2112-06-13
+
+
+plugins=fake,abap
+
+#--------------------------------------------------------------------------------------------------------------------------
+abap.homepageUrl=http\://www.sonarsource.com/products/plugins/languages/abap/
+abap.name=ABAP
+abap.category=Additional Languages
+abap.publicVersions=1.0,1.0.1,1.1,2.0.1
+
+abap.1.0.description=Initial version of the product
+abap.1.0.sqVersions=2.7,2.8,2.9,2.10,2.11,2.12,2.13,2.13.1,2.14,3.0,3.0.1,3.1,3.1.1
+abap.1.0.downloadUrl=
+abap.1.0.date=2011-07-29
+
+abap.1.0.1.description=Adjust computation of certain metrics
+abap.1.0.1.sqVersions=2.7,2.8,2.9,2.10,2.11,2.12,2.13,2.13.1,2.14,3.0,3.0.1,3.1,3.1.1
+abap.1.0.1.downloadUrl=
+abap.1.0.1.date=2011-08-28
+
+abap.1.1.description=Adjust computation of certain metrics
+abap.1.1.sqVersions=2.7,2.8,2.9,2.10,2.11,2.12,2.13,2.13.1,2.14,3.0,3.0.1,3.1,3.1.1
+abap.1.1.downloadUrl=
+abap.1.1.date=2012-01-05
+
+abap.2.0.1.description=This new version provides an ABAP source code extractor, adds 5 new rules and improves others
+abap.2.0.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,6.0,6.1,6.2,6.3,6.4,6.5,6.6
+abap.2.0.1.downloadUrl=
+abap.2.0.1.date=2012-06-25
+
+#--------------------------------------------------------------------------------------------------------------------------
+fake.category=Additional Metrics
+fake.publicVersions=1.0,1.1
+fake.name=Fake
+fake.description=Fake plugin for integration tests
+
+fake.1.0.description=Initial release
+fake.1.0.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7
+fake.1.0.downloadUrl=
+fake.1.0.date=2011-05-06
+
+fake.1.1.description=Support sonarqube v100.0
+fake.1.1.sqVersions=3.2,3.3,3.4,3.5,3.6,3.7,3.7.1,3.7.2,3.7.3,3.7.4,3.7.5,3.7.6,3.7.7,4.0,4.0.1,4.1,4.2,4.3,4.4,4.5,4.6,4.7,5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,6.0,6.1,6.2,6.3,6.4,6.5,6.6,100.0
+fake.1.1.downloadUrl=
+fake.1.1.date=2012-04-27
diff --git a/it/it-tests/src/test/resources/updatecenter/available-plugins.html b/it/it-tests/src/test/resources/updatecenter/available-plugins.html
new file mode 100644 (file)
index 0000000..04f2b62
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>available-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Available Plugins</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*ABAP*</td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>content</td>
+        <td>*fake*</td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>content</td>
+        <td>*Fake*</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>link=ABAP</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>detail-abap</td>
+        <td>*2.0.1 (Jun 25, 2012)*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>id=submit-abap</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>errormsg</td>
+        <td>*Fail to download the plugin (abap, version 2.0.1)*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/installed-plugins.html b/it/it-tests/src/test/resources/updatecenter/installed-plugins.html
new file mode 100644 (file)
index 0000000..e691f40
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>installed-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*Installed Plugins*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>user-plugins</td>
+        <td>*Plugins :: Fake*1.0-SNAPSHOT*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/plugin-updates.html b/it/it-tests/src/test/resources/updatecenter/plugin-updates.html
new file mode 100644 (file)
index 0000000..a70e257
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>plugin-updates</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Plugin Updates</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>plugin-updates</td>
+        <td>*Fake*1.0-SNAPSHOT*1.1*Support sonarqube v100.0*</td>
+    </tr>
+    <tr>
+        <td>assertValue</td>
+        <td>upgrade-submit-fake</td>
+        <td>Upgrade to 1.1</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>id=upgrade-submit-fake</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>errormsg</td>
+        <td>*Fail to download the plugin (fake, version 1.1)*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/refresh-update-center.html b/it/it-tests/src/test/resources/updatecenter/refresh-update-center.html
new file mode 100644 (file)
index 0000000..3180666
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>installed-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Available Plugins</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*Updated on*</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=Refresh</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*Updated on*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/system-updates-with-missing-installed-plugin-version.html b/it/it-tests/src/test/resources/updatecenter/system-updates-with-missing-installed-plugin-version.html
new file mode 100644 (file)
index 0000000..63b3789
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>installed-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+       <td>open</td>
+       <td>/sonar/sessions/logout</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/settings</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=login</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=password</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>name=commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/updatecenter/system_updates?reload=true</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>content</td>
+       <td>*SonarQube 100.0*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/system-updates-without-plugin-updates.html b/it/it-tests/src/test/resources/updatecenter/system-updates-without-plugin-updates.html
new file mode 100644 (file)
index 0000000..9c51ab2
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>installed-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter/system_updates?reload=true</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*SonarQube 100.0*</td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>content</td>
+        <td>*SonarQube 100.0*Fake*1.1*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/updatecenter/system-updates.html b/it/it-tests/src/test/resources/updatecenter/system-updates.html
new file mode 100644 (file)
index 0000000..188a97c
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>installed-plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/updatecenter</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=System Updates</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>content</td>
+        <td>*SonarQube 100.0*Fake*1.1*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
index 5dbedb1715d32ffbf7e88222671b8d0f87251fba..01377ab9bf974c9d70b944fa0974709ea60d5298 100644 (file)
     <module>it-tests</module>
   </modules>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.codehaus.sonar.plugins</groupId>
-      <artifactId>sonar-xoo-plugin</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.sonar</groupId>
-      <artifactId>sonar-application</artifactId>
-      <version>${project.version}</version>
-      <scope>provided</scope>
-    </dependency>
-  </dependencies>
 </project>