You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem? 1. Create a class to test that calls remote REST endpoing using com.sun.jersey.api.client.WebResource: webResource.path("url").accept(MediaType.APPLICATION_XML_TYPE).get(String.class);
2. Create a unit test for that class with the @PrepareForTest Attribute
3. Run the test
4. Error occurs with "Invalid length XXXX in LocalVariableTable" What is the expected output? What do you see instead? It should not throw an exception What version of the product are you using? On what operating system? OS: Win7
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
org.mockito:mockito-all:1.9.5
org.powermock:powermock-api-mockito:1.5
org.powermock:powermock-module-junit4:1.5
junit:junit:4.8.2
com.sun.jersey:jersey-client:1.9.1:compile Please provide any additional information below. I tried also on Java(TM) SE Runtime Environment (build 1.6.0_33-b03) with the same result
I faced the same issue when I was trying to mock WebResource.Builder class, which is public final inner in jersey-client 1.9.1. Finally I updated jersey to 1.17 where this class is not final any more. Not sure if PowerMock is able to mock final inner classes.
From Svitlana...@gmail.com on April 07, 2013 18:01:53
What steps will reproduce the problem? 1. Create a class to test that calls remote REST endpoing using com.sun.jersey.api.client.WebResource: webResource.path("url").accept(MediaType.APPLICATION_XML_TYPE).get(String.class);
2. Create a unit test for that class with the @PrepareForTest Attribute
3. Run the test
4. Error occurs with "Invalid length XXXX in LocalVariableTable" What is the expected output? What do you see instead? It should not throw an exception What version of the product are you using? On what operating system? OS: Win7
Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
org.mockito:mockito-all:1.9.5
org.powermock:powermock-api-mockito:1.5
org.powermock:powermock-module-junit4:1.5
junit:junit:4.8.2
com.sun.jersey:jersey-client:1.9.1:compile Please provide any additional information below. I tried also on Java(TM) SE Runtime Environment (build 1.6.0_33-b03) with the same result
Similar to https://code.google.com/p/powermock/issues/detail?id=266
Original issue: http://code.google.com/p/powermock/issues/detail?id=438
The text was updated successfully, but these errors were encountered: