JUnit4 Issues: java.lang.ClassCastException

When I try to run a JUnit4 test (MyTest.java) by right clicking the class and choosing "Run MyTest..." I get the following error:

Cannot instantiate test(s): java.lang.ClassCastException: class com.mycompany.MyTest

Since this is a JUnit4 test, I am not extending TestCase-- is IntelliJ trying to cast it to a TestCase?

1 comment
Comment actions Permalink

It looks like this is a known bug. It happens specifically with JUnit 4.2. Perhaps I'll try 4.1 for now.

http://www.jetbrains.net/jira/browse/IDEADEV-13294

-Chris

0

Please sign in to leave a comment.