测试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架构的原因。