use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonarqube by SonarSource.
the class ModuleSensorOptimizerTest 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 sonar-web by SonarSource.
the class HtmlSensorTest method test_descriptor_sonarqube_9_3.
@Test
public void test_descriptor_sonarqube_9_3() {
final boolean[] called = { false };
DefaultSensorDescriptor sensorDescriptor = new DefaultSensorDescriptor() {
public SensorDescriptor processesFilesIndependently() {
called[0] = true;
return this;
}
};
SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(9, 3), SonarQubeSide.SCANNER, SonarEdition.COMMUNITY);
new HtmlSensor(sonarRuntime, null, null, new CheckFactory(new DefaultActiveRules(Collections.emptyList()))).describe(sensorDescriptor);
assertThat(sensorDescriptor.name()).isEqualTo("HTML");
assertThat(sensorDescriptor.languages()).isEmpty();
assertTrue(called[0]);
}
use of org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor in project sonar-web by SonarSource.
the class HtmlSensorTest method testDescriptor.
@Test
public void testDescriptor() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
sensor.describe(descriptor);
assertThat(descriptor.name()).isEqualTo("HTML");
assertThat(descriptor.languages()).isEmpty();
}
Aggregations