Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.VerifyError when trying to use uispec4j #122

Closed
johanhaleby opened this issue Jul 23, 2015 · 3 comments
Closed

java.lang.VerifyError when trying to use uispec4j #122

johanhaleby opened this issue Jul 23, 2015 · 3 comments

Comments

@johanhaleby
Copy link
Collaborator

From manie...@googlemail.com on May 11, 2009 10:41:32

What steps will reproduce the problem? 1. Create simple test case that use uispec4j and powermock (the test shall
invoke UISpec4J.init() in static initializer).
2. Run test case. What is the expected output? What do you see instead? Successful start of test case execution. What version of the product are you using? On what operating system? powermock 1.2.5 or 1.2
uispec4j 2.0 RC3 for JDK6.x (uispec4j-jdk6-2.0-RC3.jar) Please provide any additional information below. java.lang.VerifyError: (class: javax/swing/plaf/metal/MetalLookAndFeel,
method: getLayoutStyle signature: ()Ljavax/swing/LayoutStyle;) Wrong return
type in function at
javax.swing.UIManager.setLookAndFeel(UIManager.java:581) at
javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1343) at
javax.swing.UIManager.initialize(UIManager.java:1432) at
javax.swing.UIManager.maybeInitialize(UIManager.java:1420) at
javax.swing.UIManager.getDefaults(UIManager.java:660) at
javax.swing.UIManager.put(UIManager.java:989) at
org.uispec4j.interception.ui.UISpecLF.init(UISpecLF.java:11) at
org.uispec4j.UISpec4J.init(UISpec4J.java:32) at
com.mot.ios.atia.ui.BinaryInputPanelTest.setUpClass(BinaryInputPanelTest.java:44)
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.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:56) at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:43)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:128)
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
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Original issue: http://code.google.com/p/powermock/issues/detail?id=102

@johanhaleby
Copy link
Collaborator Author

From johan.ha...@gmail.com on May 11, 2009 03:34:58

Could you try to "ignore" the UISpec framework by using the @PowerMockIgnore
annotation to see if it makes any difference? (e.g. @PowerMockIgnore("org.x.y.uispec"))

@johanhaleby
Copy link
Collaborator Author

From manie...@googlemail.com on May 12, 2009 07:10:41

Hi Johan,

It seems that using @PowerMockIgnore as you suggested solved the problem. Thanks for
help. However, the problem was due to "javax" package which I had to add as a value
to @PowerMockIgnore annotation. Do you know if this is an intended behavior of PowerMock?

@johanhaleby
Copy link
Collaborator Author

From johan.ha...@gmail.com on May 12, 2009 07:38:51

Well I wouldn't say its the intended behavior but it's a known side-effect when using
PowerMock in cases where a class instantiates a class that is prepared for test using
reflection. Then the class is instantiated by the wrong classloader if not ignored
(there are other ways of getting around the problem as well but using PowerMockIgnore
is the easiest in most cases I think).

Btw, I would encourage you to please use our mailing list next time instead of filing
a bug directly. That way we can discuss if it's really a bug or not and also more
people can see the outcome of the discussion.

Thanks for using PowerMock and taking the time to bring this up. Glad you got it working.

Status: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant