java - Unitils / DBunit / Oracle - how to insert dataset in oracle views? -
it seems simple question. have unitils tests in spring application. database contains oracle views , want insert dataset these views. know possible set options dbunit (table type properties). find nothing unitils.
is there unitils properties inserting dataset views ?
thank help
ok think find way configure unitils. needs java code. have tested solution, seems work.
first find properties in unitils (unitils.properties):
unitils.module.dbunit.classname=org.unitils.dbunit.dbunitmodule unitils.module.dbunit.runafter= unitils.module.dbunit.enabled=true
so seems possible override dbunitmodule this
public class dbunitmodule extends org.unitils.dbunit.dbunitmodule implements module { /* * (non-javadoc) * * @see org.unitils.dbunit.dbunitmodule#getdbunitdatabaseconnection(java.lang.string) */ @override public dbunitdatabaseconnection getdbunitdatabaseconnection(final string schemaname) { dbunitdatabaseconnection dbconnection = super.getdbunitdatabaseconnection(schemaname); dbconnection.getconfig().setproperty("http://www.dbunit.org/properties/tabletype", new string[] { "view", "table" }); return dbconnection; } }
and modify configuration in unitils.properties.
Comments
Post a Comment