Java Code Examples for org.dbunit.ext.mysql.MySqlMetadataHandler

The following examples show how to use org.dbunit.ext.mysql.MySqlMetadataHandler. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jpa-unit   Source File:    License: Apache License 2.0 6 votes vote down vote up
public void testCreateConnection() throws DatabaseUnitException {
    // GIVEN
    final String schema = "foo";

    // WHEN
    final IDatabaseConnection dbConnection = FACTORY.createConnection(connection, schema);

    // THEN
    assertThat(dbConnection, notNullValue());

    final Object typeFactory = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY);
    assertThat(typeFactory, notNullValue());
    assertThat(typeFactory.getClass(), equalTo(MySqlDataTypeFactory.class));

    final Object metadataHandler = dbConnection.getConfig().getProperty(DatabaseConfig.PROPERTY_METADATA_HANDLER);
    assertThat(metadataHandler, notNullValue());
    assertThat(metadataHandler.getClass(), equalTo(MySqlMetadataHandler.class));

    assertThat(dbConnection.getSchema(), equalTo(schema));
Example 2
Source Project: database-rider   Source File:    License: Apache License 2.0 5 votes vote down vote up
private IMetadataHandler getMetadataHandler(DBType dbType) {
    switch (dbType) {
        case MYSQL:
            return new MySqlMetadataHandler();
        case DB2:
            return new Db2MetadataHandler();
            return null;