use of org.sonar.scanner.mediumtest.TaskResult in project sonarqube by SonarSource.
the class FileSystemMediumTest method scanProjectWithWrongCase.
// SONAR-6719
@Test
public void scanProjectWithWrongCase() {
if (System2.INSTANCE.isOsWindows()) {
File projectDir = new File("src/test/resources/mediumtest/xoo/sample");
TaskResult result = tester.newScanTask(new File(projectDir, "sonar-project.properties")).property("sonar.sources", "XOURCES").property("sonar.tests", "TESTX").start();
assertThat(result.inputFiles()).hasSize(3);
assertThat(result.inputFiles()).extractingResultOf("relativePath").containsOnly("xources/hello/HelloJava.xoo", "xources/hello/helloscala.xoo", "testx/ClassOneTest.xoo");
}
}
use of org.sonar.scanner.mediumtest.TaskResult in project sonarqube by SonarSource.
the class FileSystemMediumTest method scanProjectWithSourceSymlink.
// SONAR-5330
@Test
public void scanProjectWithSourceSymlink() {
if (!System2.INSTANCE.isOsWindows()) {
File projectDir = new File("src/test/resources/mediumtest/xoo/sample-with-symlink");
TaskResult result = tester.newScanTask(new File(projectDir, "sonar-project.properties")).start();
assertThat(result.inputFiles()).hasSize(3);
// check that symlink was not resolved to target
assertThat(result.inputFiles()).extractingResultOf("path").toString().startsWith(projectDir.toString());
}
}
use of org.sonar.scanner.mediumtest.TaskResult in project sonarqube by SonarSource.
the class FileSystemMediumTest method scanMultiModuleProject.
@Test
public void scanMultiModuleProject() {
File projectDir = new File("src/test/resources/mediumtest/xoo/multi-modules-sample");
TaskResult result = tester.newScanTask(new File(projectDir, "sonar-project.properties")).start();
assertThat(result.inputFiles()).hasSize(4);
assertThat(result.inputDirs()).hasSize(4);
}
use of org.sonar.scanner.mediumtest.TaskResult in project sonarqube by SonarSource.
the class FileSystemMediumTest method scanProjectWithTestDir.
@Test
public void scanProjectWithTestDir() throws IOException {
File test = new File(baseDir, "test");
test.mkdir();
File xooFile = new File(test, "sampleTest.xoo");
FileUtils.write(xooFile, "Sample test xoo\ncontent");
TaskResult result = tester.newTask().properties(builder.put("sonar.sources", "").put("sonar.tests", "test").build()).start();
assertThat(result.inputFiles()).hasSize(1);
assertThat(result.inputFile("test/sampleTest.xoo").type()).isEqualTo(InputFile.Type.TEST);
}
use of org.sonar.scanner.mediumtest.TaskResult in project sonarqube by SonarSource.
the class FileSystemMediumTest method scanProjectWithSourceDir.
@Test
public void scanProjectWithSourceDir() throws IOException {
File srcDir = new File(baseDir, "src");
srcDir.mkdir();
File xooFile = new File(srcDir, "sample.xoo");
FileUtils.write(xooFile, "Sample xoo\ncontent");
TaskResult result = tester.newTask().properties(builder.put("sonar.sources", "src").build()).start();
assertThat(result.inputFiles()).hasSize(1);
assertThat(result.inputDirs()).hasSize(1);
assertThat(result.inputFile("src/sample.xoo").type()).isEqualTo(InputFile.Type.MAIN);
assertThat(result.inputFile("src/sample.xoo").relativePath()).isEqualTo("src/sample.xoo");
assertThat(result.inputDir("src").relativePath()).isEqualTo("src");
}
Aggregations