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 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)
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"))
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?
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.
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
The text was updated successfully, but these errors were encountered: