HHH-11473 - Fix MySQLStorageEngineTest
This commit is contained in:
parent
7c90905d73
commit
bc3032785e
|
@ -12,7 +12,10 @@ import org.hibernate.dialect.MySQL57Dialect;
|
|||
import org.hibernate.testing.junit4.BaseUnitTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.nullValue;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Vlad Mihalcea
|
||||
|
@ -21,19 +24,23 @@ public class MySQLStorageEngineTest extends BaseUnitTestCase {
|
|||
|
||||
@Test
|
||||
public void testDefaultStorage() {
|
||||
assertEquals(" engine=InnoDB", new MySQL57Dialect().getTableTypeString());
|
||||
assertEquals( " engine=InnoDB", new MySQL57Dialect().getTableTypeString() );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOverrideStorage() {
|
||||
String previousValue = System.setProperty( AvailableSettings.STORAGE_ENGINE, "myisam" );
|
||||
try{
|
||||
assertEquals(" engine=MyISAM", new MySQL57Dialect().getTableTypeString());
|
||||
try {
|
||||
assertEquals( " engine=MyISAM", new MySQL57Dialect().getTableTypeString() );
|
||||
}
|
||||
finally {
|
||||
if ( previousValue != null ) {
|
||||
System.setProperty( AvailableSettings.STORAGE_ENGINE, previousValue );
|
||||
}
|
||||
else {
|
||||
System.clearProperty( AvailableSettings.STORAGE_ENGINE );
|
||||
assertThat( System.getProperty( AvailableSettings.STORAGE_ENGINE ), is( nullValue() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue