Junit4, running one test from IntelliJ test runner, doesn't run setUp

Using 6.0.5 and Junit4 with the annotations.

I have multiple tests in a test class that run fine when I run the whole test class.

When I select an individual test method from the "run" console, the designated "setUp" method doesn't run and subsequently test method gives error.

What do I need to do to ensure when I just want to run one testMethod, the setUp/tearDown designated methods are also executed ?

is this a bug by any chance ?


thanks.

2 comments

here is the stack trace when I try to run one method only

Exception in thread "main" java.lang.NoSuchMethodError: org.junit.internal.runners.MethodValidator.validateAllMethods()Ljava/til/ist;
at com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:39)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

0

Please sign in to leave a comment.