Hi i also have problems running emma with powermock inside idea. I run
Idea 7.0.4.
Stacktrace:
Exception in thread "main" java.lang.Error: EMMA: runtime controller
could not be started, aborting
at com.vladium.emma.rt.RT.reset(RT.java:233)
at com.vladium.emma.rt.RT.<clinit>(RT.java:540)
at com.mytestclassTest.$VRi(mytestclassTest.java)
at com.mytestclassTest.<clinit>(mytestclassTest.java)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.createTest
(PowerMockJUnit44RunnerDelegateImpl.java:184)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod
(PowerMockJUnit44RunnerDelegateImpl.java:191)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods
(PowerMockJUnit44RunnerDelegateImpl.java:159)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl
$1.run(PowerMockJUnit44RunnerDelegateImpl.java:133)
at org.junit.internal.runners.ClassRoadie.runUnprotected
(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected
(ClassRoadie.java:37)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run
(PowerMockJUnit44RunnerDelegateImpl.java:131)
at
org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run
(JUnit4TestSuiteChunkerImpl.java:112)
at
org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run
(AbstractCommonPowerMockRunner.java:44)
at com.intellij.rt.junit4.Junit4TestMethodAdapter.run
(Junit4TestMethodAdapter.java:58)
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)
Anyone have clue? is this a class loader problem or something else.
Cheers Rikard
On 13 Maj, 22:59, Mike <
mjharri...@gmail.com> wrote:
> Emmacomes builtin to the 8.x Idea deliverable. When you create a run
> profile to run a unit test, there is a tab for code coverage. You can
> selectEmmaor IDEA from there. Neither work with PowerMock.
>
> Also, I have a class which uses the Role object from the Catalina
> JAR. When I put in the @RunWith(PowerMockRunner.class) annotation,
> somehow the class loaders collide, because the test no longer runs and
> a PowerMock reflection error is reported. I remove the @RunWith()
> annotation and the test runs fine. So it appears there is a
> classloader problem as well.
>
> Have you seen any of this? We have verified the problem on two
> separate developer systems here at work.
>
> Mike
>
> On May 13, 8:38 am, Jan Kronquist <
jan.kronqu...@gmail.com> wrote:
>
>
>
> > Hi
>
> > I can't get theemmaplugin to work in IntelliJ and theEmmawebsite
> > list the plugin as no longer supported. I can also see that the plugin
> > is using a quite old version ofEmma.
>
> > However, I also tried runningEmmafrom maven and I successfully got
> > the code coverage. However, there was a glitch with the report
> > generation. For some reason the maven plugin complains when generating
> > a report. The instrumentation and code coverage measurements are
> > performed. From the code coverage measurements I was able to generate
> > a coverage report usingEmmacommand line arguments ie
>
> > java -cpemma-2.0.5312/lib/emma.jaremmareport -r txt,html -in
> > target/coverage.em -in
coverage.ec -sp src/main/java/
>
> > I've also tested cobertura and the maven plugin seems to work without
> > any problems. However, cobertura seems to be a bit confused with
> > PowerMock manipulated class files and does not correctly report code
> > coverage in all cases. For example I had problems getting code
> > coverage when mocking "new" inside a constructor. (This works
> > correctly inEmma) Other than that it seems to work fine.
> > > I am using Intellij IDEA 8.0.1 withemmato collect code coverage