NutzCN Logo
问答 NutTestRunner 的 runChild 方法中,找不到 isIgnored 这个方法
发布于 2340天前 作者 佐蓝 1960 次浏览 复制 上一个帖子 下一个帖子
标签:

下面代码中的 isIgnored 找不到

    @Override
    protected void runChild(FrameworkMethod method, RunNotifier notifier) {
        if (isIgnored(method)) {
            super.runChild(method, notifier);
            return;
        }
        Ioc ioc = createIoc();
        try {
            iocHolder.set(ioc);
            super.runChild(method, notifier);
        } finally {
            iocHolder.remove();
            ioc.depose();
        }
    }

运行单元测试时报错如下

java.lang.NoSuchMethodError: org.nutz.mock.NutTestRunner.isIgnored(Lorg/junit/runners/model/FrameworkMethod;)Z

	at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:26)
	at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:14)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
1 回复
添加回复
请先登陆
回到顶部