KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > beans > test > TestSecurityManager


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.beans.test;
8
9
10 import java.security.Permission JavaDoc;
11
12
13 /**
14  * This class is a test security manager for testing security
15  * exception stuff
16  *
17  * @author Brian Pontarelli
18  */

19 public class TestSecurityManager extends SecurityManager JavaDoc {
20
21     /**
22      * Throws SecurityException under certain circumstances for testing.
23      */

24     public void checkMemberAccess(Class JavaDoc klass, int which) {
25         throw new SecurityException JavaDoc("Testing security exceptions");
26     }
27
28     /**
29      * Overridden so that we can set back the old security manager later.
30      */

31     public void checkPermission(Permission JavaDoc perm) {
32         // No-op
33
}
34 }
35
Popular Tags