String databaseConnectionBeanName = null;
String dataSetLoaderBeanName = null;
Class<? extends DataSetLoader> dataSetLoaderClass = FlatXmlDataSetLoader.class;
Class<? extends DatabaseOperationLookup> databaseOperationLookupClass = DefaultDatabaseOperationLookup.class;
DbUnitConfiguration configuration = testContext.getTestClass().getAnnotation(DbUnitConfiguration.class);
if (configuration != null) {
if (logger.isDebugEnabled()) {
logger.debug("Using @DbUnitConfiguration configuration");
}
databaseConnectionBeanName = configuration.databaseConnection();
dataSetLoaderClass = configuration.dataSetLoader();
dataSetLoaderBeanName = configuration.dataSetLoaderBean();
databaseOperationLookupClass = configuration.databaseOperationLookup();
}
if (!StringUtils.hasLength(databaseConnectionBeanName)) {
databaseConnectionBeanName = getDatabaseConnectionUsingCommonBeanNames(testContext);
}