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

Closed
evdzhan opened this issue Sep 22, 2014 · 1 comment
Closed

java.lang.SecurityException #70

evdzhan opened this issue Sep 22, 2014 · 1 comment
Assignees
Labels
bug

Comments

@evdzhan
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.*;

@RunWith(JMockit.class)
public class Main {
@test
public void test(@Mocked final AWTEvent awtevent) {
Deencapsulation.invoke(awtevent, "getAccessControlContext");
}
}

@rliesenfeld rliesenfeld self-assigned this Sep 22, 2014
@rliesenfeld rliesenfeld added the bug label Sep 22, 2014
@rliesenfeld

This comment has been minimized.

Copy link
Member

@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
2 participants
You can’t perform that action at this time.