Friday 15 March 2013

dbunit - gradle test doesn't work well -



dbunit - gradle test doesn't work well -

when run test in intellij, works well, if run command line like

gradle test or gradle clean test

it rerurns java.io.filenotfoundexception

string file_path = "sample/src/test/resources/" idataset insertdataset = new flatxmldataset(new fileinputstream(file_path + "com/sample/mst.xml"));

project construction is:

testproject

sample src main test java com sample test.java resources com sample mst.xml wrong, should do?

you should alter file loading code to:

getclass().getclassloader().getresourceasstream("mst.xml")

gradle dbunit

No comments:

Post a Comment