H2ConnectionFactory implements DbUnitConnectionFactory { @Override public IDatabaseConnection createConnection(final Connection connection, final String schema) throws DatabaseUnitException { return new H2Connection(connection, schema); }  @Override boolean supportsDriver(final String driverClass); @Override IDatabaseConnection createConnection(final Connection connection, final String schema);  }
@Test public void testCreateConnection() throws DatabaseUnitException { final String schema = "foo"; final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema); assertThat(dbConnection, notNullValue()); final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY); assertThat(typeFactory, notNullValue()); assertThat(typeFactory.getClass(), equalTo(H2DataTypeFactory.class)); assertThat(dbConnection.getSchema(), equalTo(schema)); }