use of org.dbunit.ext.hsqldb.HsqldbDataTypeFactory in project openmrs-core by openmrs.
the class TestUtil method printOutTableContents.
/**
* Print the contents of the given tableName to system.out<br>
* <br>
* Call this from any {@link BaseContextSensitiveTest} child by:
* TestUtil.printOutTableContents(getConnection(), "encounter");
*
* @param sqlConnection the connection to use
* @param tableNames the name(s) of the table(s) to print out
* @throws Exception
*/
public static void printOutTableContents(Connection sqlConnection, String... tableNames) throws Exception {
for (String tableName : tableNames) {
System.out.println("The contents of table: " + tableName);
IDatabaseConnection connection = new DatabaseConnection(sqlConnection);
DatabaseConfig config = connection.getConfig();
config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());
QueryDataSet outputSet = new QueryDataSet(connection);
outputSet.addTable(tableName);
FlatXmlDataSet.write(outputSet, System.out);
}
}
use of org.dbunit.ext.hsqldb.HsqldbDataTypeFactory in project thingsboard by thingsboard.
the class JpaDbunitTestConfig method databaseConfigBean.
@Bean
public DatabaseConfigBean databaseConfigBean() {
DatabaseConfigBean databaseConfigBean = new DatabaseConfigBean();
databaseConfigBean.setDatatypeFactory(new HsqldbDataTypeFactory());
return databaseConfigBean;
}
Aggregations