@Test
 public void testDialectNotFound() {
   Map properties = Collections.EMPTY_MAP;
   try {
     dialectFactory.buildDialect(properties, Mocks.createConnection("NoSuchDatabase", 666));
     fail();
   } catch (HibernateException e) {
     assertNull(e.getCause());
   }
 }
 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());
 }