测试personDAO的时候,输入ant test-dao -Dtestcase=PersonDAO出错,结果输出:
test-dao:
[echo] Testing dao...
[junit] Testsuite: org.appfuse.dao.PersonDAOTest
[junit] Tests run: 3, Failures: 0, Errors: 3, Time elapsed: 0.031 sec
[junit] ------------- Standard Output ---------------
[junit] [myapp] WARN [main] Configurator.configure(126) | No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/soft/appfuse-1.8.1-src/myapp/lib/spring-1.2.1/ehcache-1.1.jar!/ehcache-failsafe.xml
[junit] ------------- ---------------- ---------------
[junit] Testcase: testGetPerson(org.appfuse.dao.PersonDAOTest): Caused an ERROR
[junit] null
郁闷了老半天,最后发现PersonDAOHibernate类忘了实现PersonDAO接口,晕倒,只怪自己太懒惰直接copy教程里面的代码,结果没复制全,主要也是因为自己不懂spring架构的原因。
博客讲述了测试personDAO时,输入ant test - dao - Dtestcase = PersonDAO出错的情况,测试结果显示有3个错误。经排查,发现是PersonDAOHibernate类未实现PersonDAO接口,原因是复制教程代码未复制全,也因对spring架构不了解。
6500

被折叠的 条评论
为什么被折叠?



