question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZeroCodeUnitRunner throws NoSuchMethodException

See original GitHub issue

Hello,

I am trying to use ZeroCode v1.3.16 for load tests on simple Junit 4 tests.

But while using class ZeroCodeUnitRunner, I am facing a NoSuchMethodException on isIgnored (by the way, the exception is catched and hidden by the ParentRunner class, I lost lot of time and finally found it by debugging the lib classes).

It prevents the loader from working or generating the report.

ZeroCodeUnitRunner.class

@Override
    protected void runChild(FrameworkMethod method, RunNotifier notifier) {

        final Description description = describeChild(method);
        JsonTestCase jsonTestCaseAnno = method.getMethod().getAnnotation(JsonTestCase.class);
        if(jsonTestCaseAnno == null){
            jsonTestCaseAnno = evalScenarioToJsonTestCase(method.getMethod().getAnnotation(Scenario.class));
        }

        if (isIgnored(method)) { <-- This does not exist anymore

            notifier.fireTestIgnored(description);

        } else if (jsonTestCaseAnno != null) {

            runLeafJsonTest(notifier, description, jsonTestCaseAnno);

        } else {
            // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            // It is an usual Junit test, not the JSON test case
            // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
            runLeafJUnitTest(methodBlock(method), description, notifier);
        }

    }

ParentRunner.class

    @Override
    public void run(final RunNotifier notifier) {
        EachTestNotifier testNotifier = new EachTestNotifier(notifier,
                getDescription());
        try {
            Statement statement = classBlock(notifier);
            statement.evaluate();
        } catch (AssumptionViolatedException e) {
            testNotifier.fireTestIgnored();
        } catch (StoppedByUserException e) {
            throw e;
        } catch (Throwable e) {
            testNotifier.addFailure(e);  <-- Don't know why, this is hidding the exception
        }
    }

I overrided ZeroCodeUnitRunner to remove the code where isIgnored method is called, and it is working like a charm now.

Could you fix this ? Thank you, Kloe.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Kloe2257commented, Sep 25, 2020

Ok, I finally find out that minimum Junit version to be used is 4.12 (where isIgnored method was added to BlockJUnit4ClassRunner). ZeroCode is not compatible with Junit 4.11. Maybe this should be documented somewhere.

Regards, Kloe.

1reaction
ragcrixcommented, Nov 3, 2019

Hi @authorjapps!

If this task is still open, I can look at this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring junit NoSuchMethodException - java - Stack Overflow
Your error shows that spring-context is trying to call spring-aop 's ScopedProxyUtils.isScopedTarget(String beanName) . That method is present ...
Read more >
Fixing the NoSuchMethodError JUnit Error - Baeldung
In this article, we're going to learn how to fix the NoSuchMethodError and NoClassDefFoundError JUnit errors. Such problems usually occur ...
Read more >
How To Fix java.lang.NoSuchMethodError:org ... - YouTube
In this video, I will tell how to fix java.lang. NoSuchMethodError : org.testng.TestRunner.addListener(Ljava/lang/Object;)V issue.
Read more >
org.junit.runners.model.FrameworkMethod源码实例Demo-ICode联盟
clazz) throws InitializationError, IOException { super(clazz); List<FrameworkMethod> testMethods ... 源代码5 项目: zerocode 文件: ZeroCodeUnitRunner.java.
Read more >
Google Groups
NoSuchMethodError : javassist.CtMethod. ... public void getAllActiveDealUuidsBlacklistTest() throws NoSuchMethodException, InvocationTargetException, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found