}
}
}
public void TODO_testSecurityManagerCanPreventOperations() throws MalformedURLException, ClassNotFoundException {
NanoContainer parentContainer = new DefaultNanoContainer();
String testcompJarFileName = System.getProperty("testcomp.jar");
// Paul's path to TestComp. PLEASE do not take out.
//testcompJarFileName = "D:/OSS/PN/java/nanocontainer/src/test-comp/TestComp.jar";
assertNotNull("The testcomp.jar system property should point to nano/reflection/src/test-comp/TestComp.jar", testcompJarFileName);
File testCompJar = new File(testcompJarFileName);
assertTrue(testCompJar.isFile());
parentContainer.registerComponentImplementation("foo", "org.nanocontainer.testmodel.DefaultWebServerConfig");
Object fooWebServerConfig = parentContainer.getPico().getComponentInstance("foo");
assertEquals("org.nanocontainer.testmodel.DefaultWebServerConfig", fooWebServerConfig.getClass().getName());
NanoContainer childContainer = new DefaultNanoContainer(parentContainer);
childContainer.addClassLoaderURL(testCompJar.toURL());
//TODO childContainer.setPermission(some permission list, that includes the preventing of general file access);
// Or shoud this be done in the ctor for DRCA ?
// or should it a parameter in the addClassLoaderURL(..) method
childContainer.registerComponentImplementation("bar", "org.nanocontainer.testmodel.FileSystemUsing");
try {
parentContainer.getPico().getComponentInstance("bar");
fail("Should have barfed");
} catch (java.security.AccessControlException e) {