This is the security policy from jboss-test.
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/test/trunk/sr...
Specifically:
| // Is this a test location?
| File file = new File(url.toString());
| String name = file.getName();
| if (name.indexOf("tests") != -1 ||
name.indexOf("test-classes") != -1 || name.indexOf("-test.jar") !=
-1)
| {
|
Your AOPTestDelegate class will be in target/test-classes so it gets no permissions.
If you can't figure out how to do it properly, you can workaround the problem with a
hack.
You can't suspend the security manager, but there is somebody who can. ;-)
| import org.jboss.test.AbstractTestCaseWithSetup;
|
| // turn off security
| SecurityManager sm = AbstractTestCaseWithSetup.suspendSecurity();
| try
| {
| // do bad things here
| }
| finally
| {
| // resume security
| AbstractTestCaseWithSetup.resumeSecurity(sm);
| }
|
This is only intended for test infrastructure.
The point of testing with a security manager enabled is to determine which parts
of the code need privileged blocks to work correctly.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110281#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...