Code example for PrivilegedActionException

Methods: getException

0
import java.io.IOException; 
import java.security.PrivilegedActionException; 
 
@TestTargetClass(PrivilegedActionException.class)
public class PrivilegedActionException2Test extends junit.framework.TestCase {
     
    private static Throwable tCause = new Throwable("Test cause");
 
    /** 
     * @tests java.security.PrivilegedActionException#PrivilegedActionException(java.lang.Exception) 
     */ 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "", 
        method = "PrivilegedActionException", 
        args = {java.lang.Exception.class}
    ) 
    public void test_ConstructorLjava_lang_Exception() { 
        Exception e = new Exception("test exception");
        PrivilegedActionException pe = new PrivilegedActionException(e);
        assertEquals("Did not encapsulate test exception!", e, pe