[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Property replacement
alesj
do-not-reply at jboss.com
Tue Jan 23 10:39:25 EST 2007
How do I get pass this:
| access denied (java.util.PropertyPermission test.property.value write)
| java.security.AccessControlException: access denied (java.util.PropertyPermission test.property.value write)
| at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
| at java.security.AccessController.checkPermission(AccessController.java:427)
| at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
| at java.lang.System.setProperty(System.java:699)
| at org.jboss.test.kernel.config.test.PropertyTestCase$1.run(PropertyTestCase.java:64)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.test.kernel.config.test.PropertyTestCase.testPropertyWithPropertyValue(PropertyTestCase.java:60)
| at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
| at junit.extensions.TestSetup.run(TestSetup.java:23)
|
My code:
public void testPropertyWithPropertyValue() throws Throwable
| {
| // set property to be replaced
| final String CONST = "PropertyReplaceTestCase";
|
| AbstractTestDelegate delegate = getDelegate();
| delegate.enableSecurity = false;
| AccessController.doPrivileged(new PrivilegedAction<Object>()
| {
| public Object run()
| {
| System.setProperty("test.property.value", CONST);
| return null;
| }
| });
|
| // get property
| Object value = instantiateReplacePropertyValue();
| assertNotNull(value);
| assertEquals(String.class, value.getClass());
| assertEquals(CONST, value);
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4005348#4005348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4005348
More information about the jboss-dev-forums
mailing list