praveen1503 / powermock

Automatically exported from code.google.com/p/powermock
Apache License 2.0
0 stars 0 forks source link

Powermock agent dies with VerifyError #538

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Have a testclass with some initialization like this:

@PrepareForTest({Track.class,Authenticator.class})
//@RunWith(PowerMockRunner.class)
//@PowerMockIgnore({"org.*","com.sun.*","javax.*"})
public class FileHandlingRouteBuilderTest
        extends CamelTestSupport
{
    static {
        PowerMockAgent.initializeIfNeeded();
    }

    @Rule
    public PowerMockRule powerMockRule = new PowerMockRule();

    @Captor
    private ArgumentCaptor<List<ScrobbleData>> scrobblesCaptor;

    @Override
    protected void doPreSetup() throws Exception {
        PowerMockito.mockStatic(Track.class,Authenticator.class);
        MockitoAnnotations.initMocks(this);
    }

It then fails with:

java.lang.VerifyError: Expecting a stackmap frame at branch target 11
Exception Details:
  Location:
    com/davidkarlsen/traktorscrobbler/LastFmScrobbler.scrobbleNml(Lcom/davidkarlsen/traktorscrobbler/nml/Nml;)V @1: ifnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: 2bc6 000a 2bb6 0048 a700 0dbb 004a 5912
    0x0000010: 4cb7 004d bf2a 2bb6 0051 b700 55b1     

    at com.davidkarlsen.traktorscrobbler.FileHandlingRouteBuilder.configure(FileHandlingRouteBuilder.java:100)
    at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:383)
    at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:324)
    at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:307)
    at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:698)
    at org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:302)
    at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.powermock.modules.junit4.rule.PowerMockStatement.evaluate(PowerMockRule.java:63)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)

Process finished with exit code 255

Original issue reported on code.google.com by davidkar...@gmail.com on 28 Jan 2015 at 6:03