SQLUnit quick start guide
上面的单元测试是对oracle的存储过程进行测试的,因此在运行前需要将oracle驱动的jar文件放入sqlunit的lib目录下,或安装oracle客户端。
一切准备妥当后,首先将sqlunit目录下的build.xml中的
避免由于测试的失败造成报表也无法生成。<sqlunit testfile="${testfile}" haltOnFailure="true" debug="${debug}" logfile="${output.file}" logformat="${log.format}" /> 修改为: <sqlunit testfile="${testfile}" haltOnFailure="false" debug="${debug}" logfile="${output.file}" logformat="${log.format}" />
修改完毕后可进入命令行,进入sqlunit的目录,运行如下命令:
ant -Dlog.format=canoo -Doutput.file=demotest.xml -Dtestfile=demo.xml sqlunit-flat canoo2html
运行完毕后,就可在sqlunit下的output目录中找到demotest.html,打开就可看到此次单元测试运行的报告了,如发现报告中未生成单元测试失败的详细信息,则需要把lib目录下的sqlunit-5.0.jar删除或移至其他目录。
原文地址
0
相关文章