Ejemplo n.º 1
0
 @Test
 public void testDialectNotFound() {
   Map properties = Collections.EMPTY_MAP;
   try {
     dialectFactory.buildDialect(properties, Mocks.createConnection("NoSuchDatabase", 666));
     fail();
   } catch (HibernateException e) {
     assertNull(e.getCause());
   }
 }
Ejemplo n.º 2
0
 private void testDetermination(
     String databaseName,
     int majorVersion,
     int minorVersion,
     Class clazz,
     DialectResolver resolver) {
   dialectFactory.setDialectResolver(resolver);
   Properties properties = new Properties();
   Connection conn = Mocks.createConnection(databaseName, majorVersion, minorVersion);
   assertEquals(clazz, dialectFactory.buildDialect(properties, conn).getClass());
 }