I\'ve included fully testable code below, which generates the following error when supplied with a dataset xml
containing empty fields. A sample dataset.xml
for me it's work:
IDatabaseConnection dbConn = new DatabaseDataSourceConnection(getDataSource());
dbConn.getConfig().setProperty(DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS, true);
DatabaseOperation.CLEAN_INSERT.execute(dbConn, getiDataSet(loadDBData.source()));
You must override method setUpDatabaseConfig(DatabaseConfig config) as follows:
@Override
protected void setUpDatabaseConfig(DatabaseConfig config) {
config.setProperty(DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS, true);
}
Hope it helps
I've stumbled upon the correct answer, at least the one which solves my problem. It related to this line all along databaseTester.onSetup()
which could simply be replaced with DatabaseOperation.CLEAN_INSERT.execute(iConn, dataSet);
. Feel free comment on why this seemed to have fixed the error.