]> source.dussan.org Git - sonarqube.git/commitdiff
Move Highlighting IT 5.5-M1
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 12 Feb 2016 15:43:47 +0000 (16:43 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 15 Feb 2016 08:09:03 +0000 (09:09 +0100)
it/it-tests/src/test/java/it/highlighting/HighlightingTest.java
it/it-tests/src/test/resources/highlighting/HighlightingTest/syntax-highlighting.html [new file with mode: 0644]

index afd05117b0eb054a133ce1e6d99aee83c33f32c0..41dc60b3b08af4788b86d1360896d016719694fe 100644 (file)
 package it.highlighting;
 
 import com.sonar.orchestrator.Orchestrator;
-import com.sonar.orchestrator.build.SonarScanner;
 import com.sonar.orchestrator.selenium.Selenese;
 import it.Category4Suite;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
-import util.ItUtils;
+
+import static util.ItUtils.runProjectAnalysis;
 
 public class HighlightingTest {
 
@@ -38,18 +38,29 @@ public class HighlightingTest {
     orchestrator.resetData();
   }
 
+  @Test
+  public void highlight_source_code_and_symbols_usage() throws Exception {
+    runProjectAnalysis(orchestrator, "highlighting/xoo-sample-with-highlighting-v2");
+
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("highlight_source_code_and_symbols_usage",
+      // SONAR-3893 & SONAR-4247
+      "/highlighting/HighlightingTest/syntax-highlighting.html",
+      // SONAR-4249 & SONAR-4250
+      "/highlighting/HighlightingTest/symbol-usages-highlighting.html"
+      ).build();
+    orchestrator.executeSelenese(selenese);
+  }
+
   // Check that E/S index is updated when file content is unchanged but plugin generates different syntax/symbol highlighting
   @Test
-  public void updateHighlightingEvenWhenCodeUnchanged() throws Exception {
-    SonarScanner runner = SonarScanner.create(ItUtils.projectDir("highlighting/xoo-sample-with-highlighting-v1"));
-    orchestrator.executeBuild(runner);
+  public void update_highlighting_even_when_code_unchanged() throws Exception {
+    runProjectAnalysis(orchestrator, "highlighting/xoo-sample-with-highlighting-v1");
 
     Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("syntax-highlighting-v1",
       "/highlighting/HighlightingTest/syntax-highlighting-v1.html").build();
     orchestrator.executeSelenese(selenese);
 
-    runner = SonarScanner.create(ItUtils.projectDir("highlighting/xoo-sample-with-highlighting-v2"));
-    orchestrator.executeBuild(runner);
+    runProjectAnalysis(orchestrator, "highlighting/xoo-sample-with-highlighting-v2");
 
     selenese = Selenese.builder().setHtmlTestsInClasspath("syntax-highlighting-v2",
       "/highlighting/HighlightingTest/syntax-highlighting-v2.html",
diff --git a/it/it-tests/src/test/resources/highlighting/HighlightingTest/syntax-highlighting.html b/it/it-tests/src/test/resources/highlighting/HighlightingTest/syntax-highlighting.html
new file mode 100644 (file)
index 0000000..24d0ac6
--- /dev/null
@@ -0,0 +1,59 @@
+<?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>java-syntax-highlighting</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">highlight-syntax</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/component/index?id=sample-with-highlighting%3Asrc%2Fmain%2Fxoo%2Fsample%2FSample.xoo</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForElementPresent</td>
+        <td>css=.source-line</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>storeHtmlSource</td>
+        <td></td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyHtmlSource</td>
+        <td>glob:*&lt;span class="k"&gt;package&lt;/span&gt;*</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyHtmlSource</td>
+        <td>glob:*&lt;span class="k"&gt;public&lt;/span&gt;*</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyHtmlSource</td>
+        <td>glob:*&lt;span class="k"&gt;class&lt;/span&gt;*</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyHtmlSource</td>
+        <td>glob:*&lt;span class="k"&gt;return&lt;/span&gt;*</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>verifyHtmlSource</td>
+        <td>glob:*&lt;span class="s"&gt;"hello"&lt;/span&gt;*</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>