测试报错,抱类无法找到Class not found com.imooc.o2o.dao.AreaDaoTest
来源:2-7 验证Dao
weixin_慕哥7129914
2019-03-25
Class not found com.imooc.o2o.dao.AreaDaoTest
java.lang.ClassNotFoundException: com.imooc.o2o.dao.AreaDaoTest
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:688)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
2回答
-
翔仔
2019-03-25
同学好,建议同学在没有解决此类问题的能力之前还是跟视频保持一致,用Eclipse右键ut类跑junit test的形式测试,此外,记得让测试类继承BaseTest.java,读入spring-dao.xml
00 -
weixin_慕哥7129914
提问者
2019-03-25
run as 选择 Maven test 将测试需要的类加载到target文件夹test-classes中
00
相似问题