在我的项目中,使用UnitilsJUnit4TestClassRunner通过Unitils测试运行时,排除/包含不起作用. 我的脚本层次结构:unitils/ 01_create/ <lots of scripts here> 02_lkups/ <lots of scripts here> 03_#testdata/01_#testdata_master/05_#testdata_master_rate_offer.sql 我的unitils.properties文件具有:updateDataBaseSchema.enabled=truedbMaintainer.script.locations=unitilsdbMaintainer.qualifiers=testdata dbMaintainer.excludedQualifiers=testdata 我希望排除05_#testdata_master_rate_offer.sql.但是它正在运行. 在此先感谢您的帮助. 解决方案在以下unitils论坛上,由unitils开发人员提供了解答: http://sourceforge.net/projects/unitils/forums/forum/570578/topic/4546980 限定词是 dbmaintain. Unitils 3.1仍包含 它自己的dbmaintainer仍然会日期 从分离之前 dbmaintain. Unitils 4.0具有此功能 模块替换为对 dbmaintain,但此版本不是 发布了.我建议 直到4.0发布,您才致电 dbmaintain直接从您的Java 代码.希望这对您有帮助,Filip I am using unitils (and its dbMaintain module) to maintain the state of my local database. dbMaintain has an option to exclude/include scripts based on a qualifier. See http://www.dbmaintain.org/tutorial.html#Qualifier_inclusion__exclusion.In my project, excludes/includes do not work when running from a Unitils test with the UnitilsJUnit4TestClassRunner. My script hierarchy: unitils/ 01_create/ <lots of scripts here> 02_lkups/ <lots of scripts here> 03_#testdata/01_#testdata_master/05_#testdata_master_rate_offer.sql My unitils.properties file has: updateDataBaseSchema.enabled=truedbMaintainer.script.locations=unitilsdbMaintainer.qualifiers=testdata dbMaintainer.excludedQualifiers=testdata I would expect 05_#testdata_master_rate_offer.sql to be excluded. But it is being run. Thanks in advance for any help. 解决方案 Answered by one of the unitils developers on the unitils forums here: http://sourceforge.net/projects/unitils/forums/forum/570578/topic/4546980 Qualifiers are a feature of dbmaintain. Unitils 3.1still contains its own dbmaintainer which still dates from before the split-off of dbmaintain. Unitils 4.0 has this module replaced by a dependency to dbmaintain, but this version is not released yet. I would suggest that, until 4.0 is released, you call dbmaintain directly from your java code. Hope this helps, Filip 这篇关于使用unitils/dbMaintain维护数据库,如何从运行中排除脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 14:04