测试报错,抱类无法找到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

0
0

weixin_慕哥7129914

提问者

2019-03-25

run as 选择 Maven test 将测试需要的类加载到target文件夹test-classes中

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程