Search in sources :

Example 1 with Type

use of org.sonar.ce.task.projectanalysis.component.Component.Type in project sonarqube by SonarSource.

the class ScmInfoRepositoryImplTest method allTypeComponentButFile.

@DataProvider
public static Object[][] allTypeComponentButFile() {
    Object[][] res = new Object[Component.Type.values().length - 1][1];
    int i = 0;
    for (Component.Type type : EnumSet.complementOf(EnumSet.of(Component.Type.FILE))) {
        if (type.isReportType()) {
            res[i][0] = ReportComponent.builder(type, i).build();
        } else {
            res[i][0] = ViewsComponent.builder(type, i).build();
        }
        i++;
    }
    return res;
}
Also used : Type(org.sonar.ce.task.projectanalysis.component.Component.Type) ViewsComponent(org.sonar.ce.task.projectanalysis.component.ViewsComponent) Component(org.sonar.ce.task.projectanalysis.component.Component) ReportComponent(org.sonar.ce.task.projectanalysis.component.ReportComponent) DataProvider(com.tngtech.java.junit.dataprovider.DataProvider) UseDataProvider(com.tngtech.java.junit.dataprovider.UseDataProvider)

Example 2 with Type

use of org.sonar.ce.task.projectanalysis.component.Component.Type in project sonarqube by SonarSource.

the class CrawlerDepthLimitTest method LEAVES_is_same_as_FILE_and_PROJECT_VIEW.

@Test
public void LEAVES_is_same_as_FILE_and_PROJECT_VIEW() {
    assertThat(CrawlerDepthLimit.LEAVES.isSameAs(Type.FILE)).isTrue();
    assertThat(CrawlerDepthLimit.LEAVES.isSameAs(Type.PROJECT_VIEW)).isTrue();
    for (Type type : from(asList(Type.values())).filter(not(in(ImmutableSet.of(Type.FILE, Type.PROJECT_VIEW))))) {
        assertThat(CrawlerDepthLimit.LEAVES.isSameAs(type)).isFalse();
    }
}
Also used : Type(org.sonar.ce.task.projectanalysis.component.Component.Type) Test(org.junit.Test)

Aggregations

Type (org.sonar.ce.task.projectanalysis.component.Component.Type)2 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)1 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)1 Test (org.junit.Test)1 Component (org.sonar.ce.task.projectanalysis.component.Component)1 ReportComponent (org.sonar.ce.task.projectanalysis.component.ReportComponent)1 ViewsComponent (org.sonar.ce.task.projectanalysis.component.ViewsComponent)1