51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 464|回复: 3
打印 上一主题 下一主题

运行junit单元测试求助!

[复制链接]
  • TA的每日心情
    无聊
    4 天前
  • 签到天数: 530 天

    连续签到: 2 天

    [LV.9]测试副司令

    跳转到指定楼层
    1#
    发表于 2022-3-24 09:59:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    1测试积点
    运行junit单元测试,Caused by: java.lang.ClassNotFoundException: RequestMappingHandlerAdapter


    1. java.lang.IllegalStateException: Failed to load ApplicationContext

    2.     at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
    3.     at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
    4.     at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
    5.     at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
    6.     at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
    7.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
    8.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
    9.     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    10.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
    11.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
    12.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    13.     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    14.     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    15.     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    16.     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    17.     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    18.     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    19.     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    20.     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    21.     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    22.     at com.taobao.pandora.boot.test.junit4.PandoraBootRunner.run(PandoraBootRunner.java:111)
    23.     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    24.     at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    25.     at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    26.     at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    27.     at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    28.     at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    29.     at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
    30. Caused by: java.lang.TypeNotPresentException: Type org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter not present
    31.     at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
    32.     at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
    33.     at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    34.     at sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
    35.     at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
    36.     at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    37.     at sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:90)
    38.     at java.lang.Class.getGenericSuperclass(Class.java:777)
    39.     at com.alibaba.spring.beans.factory.config.GenericBeanPostProcessorAdapter.<init>(GenericBeanPostProcessorAdapter.java:23)
    40.     at com.alibaba.security.spring.component.jsonp.JsonpSecurityBeanDefinitionRegistryPostProcessor.<init>(JsonpSecurityBeanDefinitionRegistryPostProcessor.java:51)
    41.     at com.alibaba.security.spring.context.FrameworkServletApplicationContextInitializer.configureBeanFactoryPostProcessors(FrameworkServletApplicationContextInitializer.java:66)
    42.     at com.alibaba.security.spring.context.FrameworkServletApplicationContextInitializer.initialize(FrameworkServletApplicationContextInitializer.java:48)
    43.     at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:623)
    44.     at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
    45.     at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
    46.     at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:121)
    47.     at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
    48.     at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
    49.     ... 27 more
    50. Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
    51.     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    52.     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    53.     at com.taobao.pandora.boot.loader.ReLaunchURLClassLoader.doLoadClass(ReLaunchURLClassLoader.java:216)
    54.     at com.taobao.pandora.boot.loader.ReLaunchURLClassLoader.loadClass(ReLaunchURLClassLoader.java:169)
    55.     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    56.     at java.lang.Class.forName0(Native Method)
    57.     at java.lang.Class.forName(Class.java:348)
    58.     at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
    59.     ... 44 more

    复制代码



    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    该用户从未签到

    2#
    发表于 2022-3-24 20:28:17 | 只看该作者
    太牛了,可惜没有视频教程
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    6 小时前
  • 签到天数: 2819 天

    连续签到: 1 天

    [LV.Master]测试大本营

    3#
    发表于 2022-3-25 14:19:35 | 只看该作者
    感觉调的不对呢
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    4 小时前
  • 签到天数: 669 天

    连续签到: 1 天

    [LV.9]测试副司令

    4#
    发表于 2022-3-25 16:48:47 | 只看该作者
    所以呢?
    回复

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-25 13:25 , Processed in 0.066168 second(s), 21 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表