use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarqube by SonarSource.
the class SensorOptimizerTest method should_run_analyzer_with_no_metadata.
@Test
public void should_run_analyzer_with_no_metadata() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarqube by SonarSource.
the class SensorOptimizerTest method should_optimize_on_language.
@Test
public void should_optimize_on_language() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor().onlyOnLanguages("java", "php");
assertThat(optimizer.shouldExecute(descriptor)).isFalse();
fs.add(new TestInputFileBuilder("foo", "src/Foo.java").setLanguage("java").build());
assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarlint-core by SonarSource.
the class SensorOptimizerTest method should_optimize_on_type.
@Test
public void should_optimize_on_type() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor().onlyOnFileType(InputFile.Type.MAIN);
assertThat(optimizer.shouldExecute(descriptor)).isFalse();
fs.add(new TestInputFileBuilder("foo", "tests/FooTest.java").setType(InputFile.Type.TEST).build());
assertThat(optimizer.shouldExecute(descriptor)).isFalse();
fs.add(new TestInputFileBuilder("foo", "src/Foo.java").setType(InputFile.Type.MAIN).build());
assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarqube by SonarSource.
the class OneIssuePerLineSensorTest method testDescriptor.
@Test
public void testDescriptor() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
sensor.describe(descriptor);
assertThat(descriptor.ruleRepositories()).containsOnly(XooRulesDefinition.XOO_REPOSITORY, XooRulesDefinition.XOO2_REPOSITORY);
}
use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarqube by SonarSource.
the class OneQuickFixPerLineSensorTest method testDescriptor.
@Test
public void testDescriptor() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
sensor.describe(descriptor);
assertThat(descriptor.ruleRepositories()).containsOnly(XooRulesDefinition.XOO_REPOSITORY, XooRulesDefinition.XOO2_REPOSITORY);
}
Aggregations