robert.varttinen
unread,Nov 30, 2009, 10:45:13 AM11/30/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PowerMock
Hi everybody!
We are trying to execute test cases with Tycho/Maven. Executing the
"pure" JUnit cases, i.e. JUnit only, test cases execute as expected.
When it comes to those using PowerMock ( @RunWith
( PowerMockRunner.class ) ) it results in ClassCastExceptions being
thrown.
We are using the latest release of PowerMock; 1.3.1 and the
corresponding JUnit 4.7. Any ideas? Have we missed something obvious?
Something we should check, but missed? Any pointers are appreciated.
Thanks in advance,
Robert
P.S. The stacktrace;
java.lang.ClassCastException:
org.powermock.modules.junit4.PowerMockRunner cannot be cast to
org.junit.runner.Runner
at org.junit.internal.builders.AnnotatedBuilder.buildRunner
(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass
(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass
(RunnerBuilder.java:57)
at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass
(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass
(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner
(ClassRequest.java:24)
at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>
(JUnit4TestSet.java:45)
at
org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet
(JUnit4DirectoryTestSuite.java:56)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets
(AbstractDirectoryTestSuite.java:96)
at org.apache.maven.surefire.Surefire.createSuiteFromDefinition
(Surefire.java:209)
at org.apache.maven.surefire.Surefire.run(Surefire.java:156)
at org.codehaus.tycho.surefire.osgibooter.OsgiSurefireBooter.run
(OsgiSurefireBooter.java:68)
at org.codehaus.tycho.surefire.osgibooter.HeadlessTestApplication.run
(HeadlessTestApplication.java:11)
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:597)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException
(EclipseAppContainer.java:574)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run
(EclipseAppHandle.java:195)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)