Search in sources :

Example 1 with StatusDetection

use of org.sonar.scanner.scan.filesystem.StatusDetection in project sonarqube by SonarSource.

the class StatusDetectionFactoryTest method testCreate.

@Test
public void testCreate() throws Exception {
    StatusDetectionFactory factory = new StatusDetectionFactory(mock(ProjectRepositories.class));
    StatusDetection detection = factory.create();
    assertThat(detection).isNotNull();
}
Also used : StatusDetectionFactory(org.sonar.scanner.scan.filesystem.StatusDetectionFactory) StatusDetection(org.sonar.scanner.scan.filesystem.StatusDetection) ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) Test(org.junit.Test)

Example 2 with StatusDetection

use of org.sonar.scanner.scan.filesystem.StatusDetection in project sonarqube by SonarSource.

the class StatusDetectionTest method detect_status.

@Test
public void detect_status() {
    Table<String, String, String> t = ImmutableTable.of();
    ProjectRepositories ref = new ProjectRepositories(t, createTable(), null);
    StatusDetection statusDetection = new StatusDetection(ref);
    assertThat(statusDetection.status("foo", "src/Foo.java", "ABCDE")).isEqualTo(InputFile.Status.SAME);
    assertThat(statusDetection.status("foo", "src/Foo.java", "XXXXX")).isEqualTo(InputFile.Status.CHANGED);
    assertThat(statusDetection.status("foo", "src/Other.java", "QWERT")).isEqualTo(InputFile.Status.ADDED);
}
Also used : StatusDetection(org.sonar.scanner.scan.filesystem.StatusDetection) ProjectRepositories(org.sonar.scanner.repository.ProjectRepositories) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ProjectRepositories (org.sonar.scanner.repository.ProjectRepositories)2 StatusDetection (org.sonar.scanner.scan.filesystem.StatusDetection)2 StatusDetectionFactory (org.sonar.scanner.scan.filesystem.StatusDetectionFactory)1