Search in sources :

Example 11 with BatchExtension

use of org.sonar.api.BatchExtension in project sonarqube by SonarSource.

the class ScannerExtensionDictionnaryTest method useClassAnnotationsToSortExtensions.

@Test
public void useClassAnnotationsToSortExtensions() {
    BatchExtension a = new ClassDependedUpon();
    BatchExtension b = new ClassDependsUpon();
    ScannerExtensionDictionnary selector = newSelector(a, b);
    List<BatchExtension> extensions = Lists.newArrayList(selector.select(BatchExtension.class, null, true, null));
    assertThat(extensions).hasSize(2);
    assertThat(extensions.get(0)).isEqualTo(a);
    assertThat(extensions.get(1)).isEqualTo(b);
    // different initial order
    selector = newSelector(b, a);
    extensions = Lists.newArrayList(selector.select(BatchExtension.class, null, true, null));
    assertThat(extensions).hasSize(2);
    assertThat(extensions.get(0)).isEqualTo(a);
    assertThat(extensions.get(1)).isEqualTo(b);
}
Also used : BatchExtension(org.sonar.api.BatchExtension) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 BatchExtension (org.sonar.api.BatchExtension)11 List (java.util.List)2 DefaultInputModule (org.sonar.api.batch.fs.internal.DefaultInputModule)1