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);
}
Aggregations