NutzCN Logo
问答 nutz.0.47版加入mock单元测试,显示报错。
发布于 238天前 作者 qq_6427b776 270 次浏览 复制 上一个帖子 下一个帖子
标签:

兽哥您好:
第一、首先我参照了http://www.nutzam.com/core/testing/junit_testing.html的方法,引用了nutz-plugins-mock0.65和junit4.12两个包。
第二、按例子,写了两个类MyNutTestRunner 和SimpleTest。
第三、出现的报错
org.nutz.lang.born.BorningException: Fail to born 'org.nutz.ioc.loader.annotation.AnnotationIocLoader'
by args: [
@(com.venustech.tsoc.cupid)] becasue:
javax.servlet.jsp.tagext.SimpleTagSupport
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:21)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:85)
at org.nutz.ioc.loader.combo.ComboIocLoader.(ComboIocLoader.java:69)
at org.nutz.mock.NutTestRunner.createIocLoader(NutTestRunner.java:59)
at org.nutz.mock.NutTestRunner.createIoc(NutTestRunner.java:67)
at com.venustech.tsoc.cupid.test.MyNutTestRunner.createIoc(MyNutTestRunner.java:25)
at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:30)
at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:14)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:539)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:761)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:461)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:207)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:18)
... 21 more
Caused by: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/SimpleTagSupport
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.nutz.lang.Lang.loadClass(Lang.java:1693)
at org.nutz.resource.Scans.rs2class(Scans.java:349)
at org.nutz.resource.Scans.scanPackage(Scans.java:250)
at org.nutz.resource.Scans.scanPackage(Scans.java:235)
at org.nutz.ioc.loader.annotation.AnnotationIocLoader.(AnnotationIocLoader.java:43)
... 26 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.SimpleTagSupport
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 43 more

3 回复

自定义了SimpleTagSupport??

不知道,我目前没有用到。

贴报错前的20行日志, 用"插入代码按钮"

添加回复
请先登陆
回到顶部