From 8909ccd99b9bc5874f24395519d66e2bcb9bdacb Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 12 Feb 2016 16:43:47 +0100 Subject: [PATCH] Move Highlighting IT --- .../it/highlighting/HighlightingTest.java | 25 +++++--- .../HighlightingTest/syntax-highlighting.html | 59 +++++++++++++++++++ 2 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 it/it-tests/src/test/resources/highlighting/HighlightingTest/syntax-highlighting.html diff --git a/it/it-tests/src/test/java/it/highlighting/HighlightingTest.java b/it/it-tests/src/test/java/it/highlighting/HighlightingTest.java index afd05117b0e..41dc60b3b08 100644 --- a/it/it-tests/src/test/java/it/highlighting/HighlightingTest.java +++ b/it/it-tests/src/test/java/it/highlighting/HighlightingTest.java @@ -20,13 +20,13 @@ 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 index 00000000000..24d0ac63903 --- /dev/null +++ b/it/it-tests/src/test/resources/highlighting/HighlightingTest/syntax-highlighting.html @@ -0,0 +1,59 @@ + + + + + + java-syntax-highlighting + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
highlight-syntax
open/component/index?id=sample-with-highlighting%3Asrc%2Fmain%2Fxoo%2Fsample%2FSample.xoo
waitForElementPresentcss=.source-line
storeHtmlSource
verifyHtmlSourceglob:*<span class="k">package</span>*
verifyHtmlSourceglob:*<span class="k">public</span>*
verifyHtmlSourceglob:*<span class="k">class</span>*
verifyHtmlSourceglob:*<span class="k">return</span>*
verifyHtmlSourceglob:*<span class="s">"hello"</span>*
+ + -- 2.39.5