FileDocCategorySizeDatePackage
MockSecurityManager.javaAPI DocAndroid 1.5 API1890Wed May 06 22:41:04 BST 2009org.apache.harmony.prefs.tests.java.util.prefs

MockSecurityManager

public class MockSecurityManager extends SecurityManager
utility class for java.util.prefs test

Fields Summary
SecurityManager
dflt
Constructors Summary
public MockSecurityManager()

        super();
        dflt = System.getSecurityManager();
    
Methods Summary
public voidcheckPermission(java.security.Permission perm)

        if (perm instanceof RuntimePermission
                && perm.getName().equals("preferences")) {
            throw new SecurityException();
        } else if (dflt != null) {
            dflt.checkPermission(perm);
        }
    
public voidcheckPermission(java.security.Permission perm, java.lang.Object ctx)

        if (perm instanceof RuntimePermission
                && perm.getName().equals("preferences")) {
            throw new SecurityException();
        } else if (dflt != null) {
            dflt.checkPermission(perm, ctx);
        }
    
public voidinstall()

        System.setSecurityManager(this);
    
public voidrestoreDefault()

        System.setSecurityManager(dflt);