ZeroCodeUnitRunner throws NoSuchMethodException
See original GitHub issueHello,
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:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Hi @authorjapps!
If this task is still open, I can look at this.