Skip to content

java.lang.SecurityException  #70

@evdzhan

Description

@evdzhan

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");
}
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions