Search in sources :

Example 81 with SonarScanner

use of com.sonar.orchestrator.build.SonarScanner in project sonar-web by SonarSource.

the class FileSuffixesTest method filesExtensionsHtmlPhp.

@Test
public void filesExtensionsHtmlPhp() {
    SonarScanner build = getSonarRunner().setProperty("sonar.web.file.suffixes", ".html,.php");
    orchestrator.executeBuild(build);
    assertThat(getAnalyzedFilesNumber()).isEqualTo(2);
}
Also used : SonarScanner(com.sonar.orchestrator.build.SonarScanner) Test(org.junit.Test)

Example 82 with SonarScanner

use of com.sonar.orchestrator.build.SonarScanner in project sonar-web by SonarSource.

the class FileSuffixesTest method filesSuffixesHtml.

@Test
public void filesSuffixesHtml() {
    SonarScanner build = getSonarRunner().setProperty("sonar.web.file.suffixes", ".html");
    orchestrator.executeBuild(build);
    assertThat(getAnalyzedFilesNumber()).isEqualTo(1);
}
Also used : SonarScanner(com.sonar.orchestrator.build.SonarScanner) Test(org.junit.Test)

Example 83 with SonarScanner

use of com.sonar.orchestrator.build.SonarScanner in project sonar-web by SonarSource.

the class FileSuffixesTest method should_analyze_all_files_with_empty_suffixes.

@Test
public void should_analyze_all_files_with_empty_suffixes() {
    SonarScanner build = getSonarRunner().setLanguage("web").setProperty("sonar.sourceEncoding", "UTF-8").setProperty("sonar.web.file.suffixes", "");
    orchestrator.executeBuild(build);
    assertThat(getAnalyzedFilesNumber()).isEqualTo(3);
}
Also used : SonarScanner(com.sonar.orchestrator.build.SonarScanner) Test(org.junit.Test)

Example 84 with SonarScanner

use of com.sonar.orchestrator.build.SonarScanner in project sonar-web by SonarSource.

the class StandardMeasuresTest method init.

@BeforeClass
public static void init() throws Exception {
    orchestrator.resetData();
    String projectKey = "TestOfWebPlugin";
    orchestrator.getServer().provisionProject(projectKey, projectKey);
    orchestrator.getServer().associateProjectToQualityProfile(projectKey, "web", "IT");
    SonarScanner build = createSonarScanner().setProjectDir(new File("projects/continuum-webapp/")).setProjectKey(projectKey).setProjectName(projectKey).setProjectVersion("1.0").setSourceDirs("src").setProperty("sonar.sourceEncoding", "UTF-8").setProperty("sonar.web.file.suffixes", ".xhtml,.jspf,.jsp");
    orchestrator.executeBuild(build);
}
Also used : File(java.io.File) WebTestSuite.createSonarScanner(com.sonar.it.web.WebTestSuite.createSonarScanner) SonarScanner(com.sonar.orchestrator.build.SonarScanner) BeforeClass(org.junit.BeforeClass)

Aggregations

SonarScanner (com.sonar.orchestrator.build.SonarScanner)84 Test (org.junit.Test)65 BuildResult (com.sonar.orchestrator.build.BuildResult)38 File (java.io.File)21 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)8 JSONArray (org.json.simple.JSONArray)4 JSONObject (org.json.simple.JSONObject)4 Issue (org.sonar.wsclient.issue.Issue)4 Favorites (org.sonarqube.ws.Favorites)3 SearchRequest (org.sonarqube.ws.client.favorite.SearchRequest)3 Path (java.nio.file.Path)2 ArrayList (java.util.ArrayList)2 BeforeClass (org.junit.BeforeClass)2 SonarClient (org.sonar.wsclient.SonarClient)2 IssueClient (org.sonar.wsclient.issue.IssueClient)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 WebTestSuite.createSonarScanner (com.sonar.it.web.WebTestSuite.createSonarScanner)1 BuildFailureException (com.sonar.orchestrator.build.BuildFailureException)1 SonarScannerInstaller (com.sonar.orchestrator.build.SonarScannerInstaller)1 FileSystem (com.sonar.orchestrator.config.FileSystem)1