aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-26 18:48:19 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-29 11:03:33 +0200
commit64ff328a9bc2cf0ea575599d37ea6dfe4ac6274e (patch)
tree86d40f3746b73da164aae16fce4eff24d2c0054f /it
parente140eb43c7384fcaee539e9b1a07fae48cf95da2 (diff)
downloadsonarqube-64ff328a9bc2cf0ea575599d37ea6dfe4ac6274e.tar.gz
sonarqube-64ff328a9bc2cf0ea575599d37ea6dfe4ac6274e.zip
Fix execution of integration tests from command-line
Diffstat (limited to 'it')
-rw-r--r--it/it-plugins/pom.xml (renamed from it/plugins/pom.xml)5
-rw-r--r--it/it-projects/qualitygate/xoo-sample/sonar-project.properties (renamed from it/projects/qualitygate/xoo-sample/sonar-project.properties)0
-rw-r--r--it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo (renamed from it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo)0
-rw-r--r--it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures (renamed from it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures)0
-rw-r--r--it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo (renamed from it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo)0
-rw-r--r--it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures (renamed from it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures)0
-rw-r--r--it/it-tests/pom.xml (renamed from it/tests/pom.xml)11
-rw-r--r--it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java (renamed from it/tests/src/test/java/qualitygate/QualityGateNotificationTest.java)0
-rw-r--r--it/it-tests/src/test/java/qualitygate/QualityGateTest.java (renamed from it/tests/src/test/java/qualitygate/QualityGateTest.java)0
-rw-r--r--it/it-tests/src/test/java/util/ItUtils.java (renamed from it/tests/src/test/java/util/ItUtils.java)27
-rw-r--r--it/it-tests/src/test/resources/ItUtils.txt1
-rw-r--r--it/it-tests/src/test/resources/selenium/qualitygate/notifications/activate_notification_channels.html (renamed from it/tests/src/test/resources/selenium/qualitygate/notifications/activate_notification_channels.html)0
-rw-r--r--it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html (renamed from it/tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html)0
-rw-r--r--it/pom.xml8
14 files changed, 26 insertions, 26 deletions
diff --git a/it/plugins/pom.xml b/it/it-plugins/pom.xml
index 75d3eeda78c..d901ff66a44 100644
--- a/it/plugins/pom.xml
+++ b/it/it-plugins/pom.xml
@@ -8,7 +8,7 @@
<artifactId>it-parent</artifactId>
<version>5.2-SNAPSHOT</version>
</parent>
- <artifactId>plugins</artifactId>
+ <artifactId>it-plugins</artifactId>
<name>SonarQube Integration Tests :: Plugins</name>
<description>The fake plugins used by integration tests</description>
<packaging>pom</packaging>
@@ -25,8 +25,5 @@
</plugins>
</build>
- <modules>
-
- </modules>
</project>
diff --git a/it/projects/qualitygate/xoo-sample/sonar-project.properties b/it/it-projects/qualitygate/xoo-sample/sonar-project.properties
index 7fe05081304..7fe05081304 100644
--- a/it/projects/qualitygate/xoo-sample/sonar-project.properties
+++ b/it/it-projects/qualitygate/xoo-sample/sonar-project.properties
diff --git a/it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo
index b1210973dd9..b1210973dd9 100644
--- a/it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo
+++ b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo
diff --git a/it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures
index 4f638a7a00b..4f638a7a00b 100644
--- a/it/projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures
+++ b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample.xoo.measures
diff --git a/it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo
index 6c1b6459c34..6c1b6459c34 100644
--- a/it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo
+++ b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo
diff --git a/it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures
index 768513ad374..768513ad374 100644
--- a/it/projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures
+++ b/it/it-projects/qualitygate/xoo-sample/src/sample/Sample2.xoo.measures
diff --git a/it/tests/pom.xml b/it/it-tests/pom.xml
index b23fad4e1f4..b24d0a74dbc 100644
--- a/it/tests/pom.xml
+++ b/it/it-tests/pom.xml
@@ -8,16 +8,24 @@
<artifactId>it-parent</artifactId>
<version>5.2-SNAPSHOT</version>
</parent>
- <artifactId>tests</artifactId>
+ <artifactId>it-tests</artifactId>
<name>SonarQube Integration Tests :: Tests</name>
<properties>
<category>*</category>
<surefire.argLine>-Xmx128m -server</surefire.argLine>
+ <skipIts>false</skipIts>
</properties>
<dependencies>
<dependency>
+ <groupId>org.sonarsource.it</groupId>
+ <artifactId>it-plugins</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-ws-client</artifactId>
<version>5.0</version>
@@ -77,6 +85,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <skipTests>${skipIts}</skipTests>
<includes>
<include>${category}/suite/*TestSuite.java</include>
<!-- not included in suites -->
diff --git a/it/tests/src/test/java/qualitygate/QualityGateNotificationTest.java b/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
index 12e3ca3da91..12e3ca3da91 100644
--- a/it/tests/src/test/java/qualitygate/QualityGateNotificationTest.java
+++ b/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
diff --git a/it/tests/src/test/java/qualitygate/QualityGateTest.java b/it/it-tests/src/test/java/qualitygate/QualityGateTest.java
index e13f8bb07d5..e13f8bb07d5 100644
--- a/it/tests/src/test/java/qualitygate/QualityGateTest.java
+++ b/it/it-tests/src/test/java/qualitygate/QualityGateTest.java
diff --git a/it/tests/src/test/java/util/ItUtils.java b/it/it-tests/src/test/java/util/ItUtils.java
index 875ff1718ad..09124d89ac8 100644
--- a/it/tests/src/test/java/util/ItUtils.java
+++ b/it/it-tests/src/test/java/util/ItUtils.java
@@ -18,20 +18,13 @@ public class ItUtils {
private static final Supplier<File> HOME_DIR = Suppliers.memoize(new Supplier<File>() {
@Override
public File get() {
- File dir = new File("it");
-
- // intellij way
- if (dir.exists() && dir.isDirectory()) {
- return dir.getParentFile();
- }
-
- // maven way
- dir = new File("../it");
- if (dir.exists() && dir.isDirectory()) {
- return dir.getParentFile();
- }
-
- throw new IllegalStateException("Fail to locate home directory");
+ File testResources = FileUtils.toFile(ItUtils.class.getResource("/ItUtils.txt"));
+ return testResources // ${home}/it/it-tests/src/test/resources
+ .getParentFile() // ${home}/it/it-tests/src/test
+ .getParentFile() // ${home}/it/it-tests/src
+ .getParentFile() // ${home}/it/it-tests
+ .getParentFile() // ${home}/it
+ .getParentFile(); // ${home}
}
});
@@ -39,7 +32,7 @@ public class ItUtils {
File target = new File(HOME_DIR.get(), "plugins/sonar-xoo-plugin/target");
if (target.exists()) {
for (File jar : FileUtils.listFiles(target, new String[] {"jar"}, false)) {
- if (jar.getName().startsWith("sonar-xoo-plugin-") && !jar.getName().contains("-source")) {
+ if (jar.getName().startsWith("sonar-xoo-plugin-") && !jar.getName().contains("-sources")) {
return FileLocation.of(jar);
}
}
@@ -50,10 +43,10 @@ public class ItUtils {
/**
* Locate the directory of sample project
*
- * @param relativePath path related to the directory it/projects, for example "qualitygate/xoo-sample"
+ * @param relativePath path related to the directory it/it-projects, for example "qualitygate/xoo-sample"
*/
public static File projectDir(String relativePath) {
- File dir = new File(HOME_DIR.get(), "it/projects/" + relativePath);
+ File dir = new File(HOME_DIR.get(), "it/it-projects/" + relativePath);
if (!dir.exists() || !dir.isDirectory()) {
throw new IllegalStateException("Directory does not exist: " + dir.getAbsolutePath());
}
diff --git a/it/it-tests/src/test/resources/ItUtils.txt b/it/it-tests/src/test/resources/ItUtils.txt
new file mode 100644
index 00000000000..e95e310afe6
--- /dev/null
+++ b/it/it-tests/src/test/resources/ItUtils.txt
@@ -0,0 +1 @@
+Used by ItUtils to locate root directory of sources
diff --git a/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
index 8e0bce0bf8e..8e0bce0bf8e 100644
--- a/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
diff --git a/it/tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html b/it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html
index 3d32118ce93..3d32118ce93 100644
--- a/it/tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html
+++ b/it/it-tests/src/test/resources/selenium/qualitygate/notifications/email_configuration.html
diff --git a/it/pom.xml b/it/pom.xml
index cbb65650c6b..5dbedb1715d 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -16,21 +16,21 @@
<packaging>pom</packaging>
<modules>
- <module>plugins</module>
- <module>tests</module>
+ <module>it-plugins</module>
+ <module>it-tests</module>
</modules>
<dependencies>
<dependency>
<groupId>org.codehaus.sonar.plugins</groupId>
<artifactId>sonar-xoo-plugin</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-application</artifactId>
- <version>${pom.version}</version>
+ <version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>