// additional checks
if (H2.ID.equals(db.getDialect().getId())) {
- Loggers.get(DatabaseChecker.class).warn("H2 database should be used for evaluation purpose only");
+ Loggers.get(DatabaseChecker.class).warn("H2 database should be used for evaluation purpose only.");
+ } else if (MySql.ID.equals(db.getDialect().getId())) {
+ Loggers.get(DatabaseChecker.class).warn("MySQL support is deprecated and will be dropped soon.");
} else if (Oracle.ID.equals(db.getDialect().getId())) {
checkOracleDriverVersion();
}
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.sonar.api.utils.MessageException;
+import org.sonar.api.utils.log.LogTester;
+import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.db.dialect.Dialect;
import org.sonar.db.dialect.H2;
import org.sonar.db.dialect.MsSql;
@Rule
public ExpectedException expectedException = ExpectedException.none();
+ @Rule
+ public LogTester logTester = new LogTester();
+
@Test
public void requires_oracle_driver_11_2() throws Exception {
Database db = mockDb(new Oracle(), 11, 2, "11.2.0.0.1");
DatabaseChecker checker = new DatabaseChecker(db);
checker.start();
checker.stop();
- // TODO test log
+
+ assertThat(logTester.logs(LoggerLevel.WARN)).contains("H2 database should be used for evaluation purpose only.");
}
@Test
public void test_mysql() throws Exception {
Database db = mockDb(new MySql(), 5, 7, "5.7");
new DatabaseChecker(db).start();
- // no error
+
+ // no error but warning
+ assertThat(logTester.logs(LoggerLevel.WARN)).contains("MySQL support is deprecated and will be dropped soon.");
}
@Test
# H2 embedded database server listening port, defaults to 9092
#sonar.embeddedDatabase.port=9092
-#----- MySQL 5.6 or greater
+#----- DEPRECATED
+#----- MySQL >=5.6 && <8.0
+# Support of MySQL is dropped in Data Center Editions and deprecated in all other editions
# Only InnoDB storage engine is supported (not myISAM).
# Only the bundled driver is supported. It can not be changed.
#sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false