Source Code Cross Referenced for TestSecurityContext.java in  » Database-ORM » openjpa » org » apache » openjpa » persistence » kernel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » openjpa » org.apache.openjpa.persistence.kernel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * TestSecurityContext.java
003:         *
004:         * Created on October 13, 2006, 5:25 PM
005:         *
006:         * To change this template, choose Tools | Template Manager
007:         * and open the template in the editor.
008:         */
009:        /*
010:         * Licensed to the Apache Software Foundation (ASF) under one
011:         * or more contributor license agreements.  See the NOTICE file
012:         * distributed with this work for additional information
013:         * regarding copyright ownership.  The ASF licenses this file
014:         * to you under the Apache License, Version 2.0 (the
015:         * "License"); you may not use this file except in compliance
016:         * with the License.  You may obtain a copy of the License at
017:         *
018:         * http://www.apache.org/licenses/LICENSE-2.0
019:         *
020:         * Unless required by applicable law or agreed to in writing,
021:         * software distributed under the License is distributed on an
022:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
023:         * KIND, either express or implied.  See the License for the
024:         * specific language governing permissions and limitations
025:         * under the License.    
026:         */
027:        package org.apache.openjpa.persistence.kernel;
028:
029:        import java.io.FileDescriptor;
030:        import java.net.InetAddress;
031:        import java.security.Permission;
032:
033:        import org.apache.openjpa.persistence.kernel.common.apps.RuntimeTest1;
034:
035:        import org.apache.openjpa.persistence.OpenJPAEntityManager;
036:
037:        public class TestSecurityContext extends BaseKernelTest {
038:
039:            private SecurityManager oldManager;
040:            private StrictSecurityManager ssm;
041:
042:            /**
043:             * Creates a new instance of TestSecurityContext
044:             */
045:            public TestSecurityContext() {
046:            }
047:
048:            public TestSecurityContext(String name) {
049:                super (name);
050:            }
051:
052:            public void setUp() {
053:                oldManager = System.getSecurityManager();
054:                // System.setSecurityManager (ssm = new StrictSecurityManager ());
055:            }
056:
057:            public void tearDown() throws Exception {
058:                System.setSecurityManager(oldManager);
059:                oldManager = null;
060:                super .tearDown();
061:            }
062:
063:            public void testInSecureClassLoader() {
064:                OpenJPAEntityManager pm = getPM();
065:                startTx(pm);
066:                pm.createExtent(RuntimeTest1.class, true).iterator().hasNext();
067:                endTx(pm);
068:                endEm(pm);
069:            }
070:
071:            public class StrictSecurityManager extends SecurityManager {
072:
073:                private void debug(String msg) {
074:                    // log.debug (msg);
075:                }
076:
077:                public void checkAccept(String host, int port) {
078:                    debug("checkAccept: " + host + "," + port);
079:                    super .checkAccept(host, port);
080:                }
081:
082:                public void checkAccess(Thread t) {
083:                    debug("checkAccess: " + t);
084:                    super .checkAccess(t);
085:                }
086:
087:                public void checkAccess(ThreadGroup g) {
088:                    debug("checkAccess: " + g);
089:                    super .checkAccess(g);
090:                }
091:
092:                public void checkAwtEventQueueAccess() {
093:                    debug("checkAwtEventQueueAccess");
094:                    super .checkAwtEventQueueAccess();
095:                }
096:
097:                public void checkConnect(String host, int port) {
098:                    debug("checkConnect: " + host + "," + port);
099:                    super .checkConnect(host, port);
100:                }
101:
102:                public void checkConnect(String host, int port, Object context) {
103:                    debug("checkConnect: " + host + "," + port + "," + context);
104:                    super .checkConnect(host, port, context);
105:                }
106:
107:                public void checkCreateClassLoader() {
108:                    debug("checkCreateClassLoader");
109:                    super .checkCreateClassLoader();
110:                }
111:
112:                public void checkDelete(String file) {
113:                    debug("checkDelete: " + file);
114:                    super .checkDelete(file);
115:                }
116:
117:                public void checkExec(String cmd) {
118:                    debug("checkExec: " + cmd);
119:                    super .checkExec(cmd);
120:                }
121:
122:                public void checkExit(int status) {
123:                    debug("checkExit: " + status);
124:                    super .checkExit(status);
125:                }
126:
127:                public void checkLink(String lib) {
128:                    debug("checkLink: " + lib);
129:                    super .checkLink(lib);
130:                }
131:
132:                public void checkListen(int port) {
133:                    debug("checkListen: " + port);
134:                    super .checkListen(port);
135:                }
136:
137:                public void checkMemberAccess(Class clazz, int which) {
138:                    debug("checkMemberAccess: " + clazz + "," + which);
139:                    super .checkMemberAccess(clazz, which);
140:                }
141:
142:                public void checkMulticast(InetAddress maddr) {
143:                    debug("checkMulticast: " + maddr);
144:                    super .checkMulticast(maddr);
145:                }
146:
147:                public void checkMulticast(InetAddress maddr, byte ttl) {
148:                    debug("checkMulticast: " + maddr + "," + ttl);
149:                    super .checkMulticast(maddr, ttl);
150:                }
151:
152:                public void checkPackageAccess(String pkg) {
153:                    debug("checkPackageAccess: " + pkg);
154:                    super .checkPackageAccess(pkg);
155:                }
156:
157:                public void checkPackageDefinition(String pkg) {
158:                    debug("checkPackageDefinition: " + pkg);
159:                    super .checkPackageDefinition(pkg);
160:                }
161:
162:                public void checkPermission(Permission perm) {
163:                    debug("checkPermission: " + perm);
164:                    super .checkPermission(perm);
165:                }
166:
167:                public void checkPermission(Permission perm, Object context) {
168:                    debug("checkPermission: " + perm + "," + context);
169:                    super .checkPermission(perm, context);
170:                }
171:
172:                public void checkPrintJobAccess() {
173:                    debug("checkPrintJobAccess");
174:                    super .checkPrintJobAccess();
175:                }
176:
177:                public void checkPropertiesAccess() {
178:                    debug("checkPropertiesAccess");
179:                    super .checkPropertiesAccess();
180:                }
181:
182:                public void checkPropertyAccess(String key) {
183:                    debug("checkPropertyAccess: " + key);
184:                    super .checkPropertyAccess(key);
185:                }
186:
187:                public void checkRead(FileDescriptor fd) {
188:                    debug("checkRead: " + fd);
189:                    super .checkRead(fd);
190:                }
191:
192:                public void checkRead(String file) {
193:                    debug("checkRead: " + file);
194:                    super .checkRead(file);
195:                }
196:
197:                public void checkRead(String file, Object context) {
198:                    debug("checkRead: " + file + "," + context);
199:                    super .checkRead(file, context);
200:                }
201:
202:                public void checkSecurityAccess(String target) {
203:                    debug("checkSecurityAccess: " + target);
204:                    super .checkSecurityAccess(target);
205:                }
206:
207:                public void checkSetFactory() {
208:                    debug("checkSetFactory");
209:                    super .checkSetFactory();
210:                }
211:
212:                public void checkSystemClipboardAccess() {
213:                    debug("checkSystemClipboardAccess");
214:                    super .checkSystemClipboardAccess();
215:                }
216:
217:                public boolean checkTopLevelWindow(Object window) {
218:                    debug("checkTopLevelWindow: " + window);
219:                    return super .checkTopLevelWindow(window);
220:                }
221:
222:                public void checkWrite(FileDescriptor fd) {
223:                    debug("checkWrite: " + fd);
224:                    super .checkWrite(fd);
225:                }
226:
227:                public void checkWrite(String file) {
228:                    debug("checkWrite: " + file);
229:                    super .checkWrite(file);
230:                }
231:
232:                protected int classDepth(String name) {
233:                    debug("classDepth: " + name);
234:                    return super .classDepth(name);
235:                }
236:
237:                protected int classLoaderDepth() {
238:                    debug("classLoaderDepth");
239:                    return super .classLoaderDepth();
240:                }
241:
242:                protected ClassLoader currentClassLoader() {
243:                    debug("currentClassLoader");
244:                    return super .currentClassLoader();
245:                }
246:
247:                protected Class currentLoadedClass() {
248:                    debug("currentLoadedClass");
249:                    return super .currentLoadedClass();
250:                }
251:
252:                protected Class[] getClassContext() {
253:                    debug("getClassContext");
254:                    return super .getClassContext();
255:                }
256:
257:                public boolean getInCheck() {
258:                    debug("getInCheck");
259:                    return super .getInCheck();
260:                }
261:
262:                public Object getSecurityContext() {
263:                    debug("getSecurityContext");
264:                    return super .getSecurityContext();
265:                }
266:
267:                public ThreadGroup getThreadGroup() {
268:                    debug("getThreadGroup");
269:                    return super .getThreadGroup();
270:                }
271:
272:                protected boolean inClass(String name) {
273:                    debug("inClass: " + name);
274:                    return super .inClass(name);
275:                }
276:
277:                protected boolean inClassLoader() {
278:                    debug("inClassLoader");
279:                    return super.inClassLoader();
280:                }
281:            }
282:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.