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
@RunWith(JMockit.class)
public class Main { @test
public void test(@mocked final AWTEvent awtevent) {
Deencapsulation.invoke(awtevent, "getAccessControlContext");
}
}
The text was updated successfully, but these errors were encountered:
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");
}
}
The text was updated successfully, but these errors were encountered: