jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
465 stars 240 forks source link

java.lang.VerifyError #56

Closed evdzhan closed 10 years ago

evdzhan commented 10 years ago

Hi, yet again!

So I have this issue that I can't debug. I have a custom JDialog which I am trying to mock. When I call it's super constructor and then I try to use try catch block, I am getting a java.lang.VerifyError.

Please note that you have to uncomment the try body in order to get the verifyError with my example.

Java 1.7.0_51 (32 bit). Win7 64 bit JMockit 1.10 If you need any further information let me know.

Regards.

import mockit.Mocked; import mockit.integration.junit4.JMockit; import org.junit.runner.RunWith; import javax.swing.JDialog; import java.awt.Frame;

@RunWith(JMockit.class) public class test { @Mocked private MyJDialog changeManagerDlg = null; @org.junit.Test public void test(){}

private static class MyJDialog extends JDialog
{
    public MyJDialog(Frame theFrame)
    {
        super(theFrame);
        try {

// System.out.println("Uncommenting this line causes java.lang.VerifyError"); } catch (Exception e) { e.printStackTrace(); } } } }

rliesenfeld commented 10 years ago

Yes, I can reproduce the VerifyError on JMockit 1.10; the problem is already fixed in release 1.11 (issue #41).

evdzhan commented 10 years ago

Oh I am sorry!

I should have upgraded to the latest JMockit. Thank you for the quick reply. I will try the with the new version, hope it works.

Regards.