Skip to content

Commit

Permalink
HHH-11635 - MySQLSkipAutoCommitTest fails when run on MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Apr 14, 2017
1 parent 3ba49e7 commit a630809
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -10,12 +10,13 @@

import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.PostgreSQL81Dialect;

import org.hibernate.testing.RequiresDialect;
import org.hibernate.test.util.ReflectionUtil;


/**
* @author Vlad Mihalcea
*/
Expand All @@ -25,6 +26,9 @@ public class MySQLSkipAutoCommitTest extends AbstractSkipAutoCommitTest {
@Override
protected DataSource dataSource() {
DataSource dataSource = ReflectionUtil.newInstance( "com.mysql.cj.jdbc.MysqlDataSource" );
if ( getDialect() instanceof MariaDBDialect ) {
dataSource = ReflectionUtil.newInstance( "org.mariadb.jdbc.MariaDbDataSource" );
}
ReflectionUtil.setProperty( dataSource, "url", Environment.getProperties().getProperty( AvailableSettings.URL ) );
ReflectionUtil.setProperty( dataSource, "user", Environment.getProperties().getProperty( AvailableSettings.USER ) );
ReflectionUtil.setProperty( dataSource, "password", Environment.getProperties().getProperty( AvailableSettings.PASS ) );
Expand Down

0 comments on commit a630809

Please sign in to comment.