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.SecurityException #70

evdzhan opened this issue Sep 22, 2014 · 1 comment

java.lang.SecurityException #70

evdzhan opened this issue Sep 22, 2014 · 1 comment


Copy link

@evdzhan evdzhan commented Sep 22, 2014

Hi there!

I am getting the following exception

java.lang.SecurityException: AWTEvent is missing AccessControlContext

It happens when running the following piece of code with JMockit 1.12 . However, when I use JMockit 1.9 , it works just fine. My conclusions after I debugged the code are that AWTEvent doesn't get mocked, which invokes code that is not supposed to be invoked.

Environment Win7 64 bit
JDK 1.7.0_51 32 bit
JMockit 1.12

import mockit.Deencapsulation;
import mockit.Mocked;
import mockit.integration.junit4.JMockit;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.awt.*;

public class Main {
public void test(@mocked final AWTEvent awtevent) {
Deencapsulation.invoke(awtevent, "getAccessControlContext");

@rliesenfeld rliesenfeld self-assigned this Sep 22, 2014
Copy link

@rliesenfeld rliesenfeld commented Sep 22, 2014

It's due to the fix for issue #30. But it can probably be improved.

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

No branches or pull requests

2 participants