HHH-13910 : Added and corrected tests

This commit is contained in:
Gail Badner 2020-03-26 20:59:55 -07:00
parent a54d657d98
commit caded6cd40
1 changed files with 20 additions and 6 deletions

View File

@ -13,8 +13,8 @@ import org.junit.Test;
import java.sql.SQLException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* Unit test of the {@link StandardDialectResolver} class.
@ -44,7 +44,7 @@ public class StandardDialectResolverTest extends BaseUnitTestCase {
@Test
public void testResolveDialectInternalForSQLServer2012()
throws SQLException {
runSQLServerDialectTest( 11, SQLServer2008Dialect.class );
runSQLServerDialectTest( 11, SQLServer2012Dialect.class );
}
@Test
@ -93,7 +93,7 @@ public class StandardDialectResolverTest extends BaseUnitTestCase {
@Test
public void testResolveDialectInternalForPostgres92() throws SQLException {
runPostgresDialectTest( 9, 2, PostgreSQL9Dialect.class );
runPostgresDialectTest( 9, 2, PostgreSQL92Dialect.class );
}
@Test
@ -131,6 +131,17 @@ public class StandardDialectResolverTest extends BaseUnitTestCase {
runMySQLDialectTest( 5, 7, MySQL57Dialect.class );
}
@Test
public void testResolveDialectInternalForMySQL6() throws SQLException {
runMySQLDialectTest( 6, 0, MySQL57Dialect.class );
}
@Test
public void testResolveDialectInternalForMySQL7() throws SQLException {
runMySQLDialectTest( 7, 0, MySQL57Dialect.class );
}
@Test
public void testResolveDialectInternalForMySQL8() throws SQLException {
runMySQLDialectTest( 8, 0, MySQL8Dialect.class );
@ -188,8 +199,11 @@ public class StandardDialectResolverTest extends BaseUnitTestCase {
String dbms = builder.toString();
assertNotNull( "Dialect for " + dbms + " should not be null", dialect );
assertTrue( "Dialect for " + dbms + " should be "
+ expectedDialect.getSimpleName(),
expectedDialect.isInstance( dialect ) );
// Make sure to test that the actual dialect class is as expected
// (not just an instance of the expected dialect.
assertEquals( "Dialect for " + dbms + " should be " + expectedDialect.getSimpleName(),
expectedDialect,
dialect.getClass()
);
}
}