aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-01-07 11:48:04 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-01-07 11:48:04 +0100
commit7810d09da1bf3908ca190d5d1811fd8b58cc549b (patch)
tree76af758b9ec23cf152b9564fc19c3980569fa332 /it
parent0889052cc5a9963a3865d46e241553a4836c86fb (diff)
downloadsonarqube-7810d09da1bf3908ca190d5d1811fd8b58cc549b.tar.gz
sonarqube-7810d09da1bf3908ca190d5d1811fd8b58cc549b.zip
SONAR-7177 expand the root directory
Diffstat (limited to 'it')
-rw-r--r--it/it-projects/shared/xoo-sample-with-root-dir/Hello.xoo12
-rw-r--r--it/it-projects/shared/xoo-sample-with-root-dir/sonar-project.properties5
-rw-r--r--it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo16
-rw-r--r--it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo.measures11
-rw-r--r--it/it-tests/src/test/java/it/projectServices/ProjectCodeTest.java10
-rw-r--r--it/it-tests/src/test/resources/projectServices/ProjectCodeTest/code_page_should_expand_root_dir.html30
6 files changed, 84 insertions, 0 deletions
diff --git a/it/it-projects/shared/xoo-sample-with-root-dir/Hello.xoo b/it/it-projects/shared/xoo-sample-with-root-dir/Hello.xoo
new file mode 100644
index 00000000000..b83c3af128c
--- /dev/null
+++ b/it/it-projects/shared/xoo-sample-with-root-dir/Hello.xoo
@@ -0,0 +1,12 @@
+package com.sonar.it.samples.modules.b1;
+
+public class HelloB1 {
+ private int i;
+ private HelloB1() {
+
+ }
+
+ public void hello() {
+ System.out.println("hello" + " world");
+ }
+} \ No newline at end of file
diff --git a/it/it-projects/shared/xoo-sample-with-root-dir/sonar-project.properties b/it/it-projects/shared/xoo-sample-with-root-dir/sonar-project.properties
new file mode 100644
index 00000000000..35fbcff0e60
--- /dev/null
+++ b/it/it-projects/shared/xoo-sample-with-root-dir/sonar-project.properties
@@ -0,0 +1,5 @@
+sonar.projectKey=sample-with-root-dir
+sonar.projectName=Sample With Root Dir
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=.
+sonar.language=xoo
diff --git a/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo b/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo
new file mode 100644
index 00000000000..41871e123a3
--- /dev/null
+++ b/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo
@@ -0,0 +1,16 @@
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
diff --git a/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo.measures
new file mode 100644
index 00000000000..3f73ea8f695
--- /dev/null
+++ b/it/it-projects/shared/xoo-sample-with-root-dir/src/main/xoo/sample/Sample.xoo.measures
@@ -0,0 +1,11 @@
+ncloc:13
+#Used by dashboard/widgets tests
+complexity:3
+complexity_in_classes:3
+classes:1
+comment_lines:3
+public_api:5
+public_undocumented_api:2
+duplicated_files:1
+duplicated_blocks:2
+duplicated_lines:3
diff --git a/it/it-tests/src/test/java/it/projectServices/ProjectCodeTest.java b/it/it-tests/src/test/java/it/projectServices/ProjectCodeTest.java
index c29d3278164..875894fd67a 100644
--- a/it/it-tests/src/test/java/it/projectServices/ProjectCodeTest.java
+++ b/it/it-tests/src/test/java/it/projectServices/ProjectCodeTest.java
@@ -44,6 +44,16 @@ public class ProjectCodeTest {
new SeleneseTest(selenese).runOn(orchestrator);
}
+ @Test
+ public void code_page_should_expand_root_dir() throws Exception {
+ executeBuild("shared/xoo-sample-with-root-dir", "project-for-code-root-dir", "Project For Code");
+
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("code_page_should_expand_root_dir",
+ "/projectServices/ProjectCodeTest/code_page_should_expand_root_dir.html"
+ ).build();
+ new SeleneseTest(selenese).runOn(orchestrator);
+ }
+
private void executeBuild(String projectLocation, String projectKey, String projectName) {
orchestrator.executeBuild(
SonarRunner.create(projectDir(projectLocation))
diff --git a/it/it-tests/src/test/resources/projectServices/ProjectCodeTest/code_page_should_expand_root_dir.html b/it/it-tests/src/test/resources/projectServices/ProjectCodeTest/code_page_should_expand_root_dir.html
new file mode 100644
index 00000000000..9d07783bf00
--- /dev/null
+++ b/it/it-tests/src/test/resources/projectServices/ProjectCodeTest/code_page_should_expand_root_dir.html
@@ -0,0 +1,30 @@
+<?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"/>
+ <link rel="selenium.base" href="http://localhost:49506"/>
+ <title>code_page_should_expand_root_dir</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr>
+ <td rowspan="1" colspan="3">code_page_should_expand_root_dir</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/code?id=project-for-code-root-dir</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>css=#content</td>
+ <td>*Hello.xoo*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>