use of org.sonar.api.config.PropertyDefinitions in project sonarqube by SonarSource.
the class GenericTestExecutionSensorTest method logWhenDeprecatedPropsAreUsed.
@Test
public void logWhenDeprecatedPropsAreUsed() throws IOException {
File basedir = temp.newFolder();
File report = new File(basedir, "report.xml");
FileUtils.write(report, "<unitTest version=\"1\"><file path=\"A.java\"><testCase name=\"test1\" duration=\"500\"/></file></unitTest>");
SensorContextTester context = SensorContextTester.create(basedir);
Settings settings = new MapSettings(new PropertyDefinitions(GenericTestExecutionSensor.properties()));
settings.setProperty(GenericTestExecutionSensor.OLD_UNIT_TEST_REPORT_PATHS_PROPERTY_KEY, "report.xml");
context.setSettings(settings);
new GenericTestExecutionSensor(mock(TestPlanBuilder.class)).execute(context);
assertThat(logTester.logs(LoggerLevel.WARN)).contains("Using 'unitTest' as root element of the report is deprecated. Please change to 'testExecutions'.", "Property 'sonar.genericcoverage.unitTestReportPaths' is deprecated. Please use 'sonar.testExecutionReportPaths' instead.");
assertThat(logTester.logs(LoggerLevel.INFO)).contains("Imported test execution data for 0 files", "Test execution data ignored for 1 unknown files, including:\nA.java");
}
use of org.sonar.api.config.PropertyDefinitions in project sonarqube by SonarSource.
the class GlobalSettingsTest method should_log_warn_msg_for_each_jdbc_property_if_present.
@Test
public void should_log_warn_msg_for_each_jdbc_property_if_present() {
when(settingsLoader.load(null)).thenReturn(ImmutableMap.of("sonar.jdbc.url", SOME_VALUE, "sonar.jdbc.username", SOME_VALUE, "sonar.jdbc.password", SOME_VALUE));
new GlobalSettings(bootstrapProps, new PropertyDefinitions(), settingsLoader, mode);
assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly("Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.", "Property 'sonar.jdbc.username' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.", "Property 'sonar.jdbc.password' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.");
}
use of org.sonar.api.config.PropertyDefinitions in project sonarqube by SonarSource.
the class IssueInclusionPatternInitializerTest method init.
@Before
public void init() {
settings = new MapSettings(new PropertyDefinitions(IssueExclusionProperties.all()));
patternsInitializer = new IssueInclusionPatternInitializer(settings);
}
use of org.sonar.api.config.PropertyDefinitions in project sonarqube by SonarSource.
the class CoverageExclusionsTest method prepare.
@Before
public void prepare() {
settings = new MapSettings(new PropertyDefinitions(ExclusionProperties.all()));
coverageExclusions = new CoverageExclusions(settings);
}
Aggregations