[picocontainer-scm] [jira] Resolved: (PICO-378) Inconsistent Script Behavior When Run in Custom ClassLoader
"Michael Rimov (JIRA)" <jira-yCVjj/[email protected]> Mon, 27 Dec 2010 13:37:57 -0600 (CST)
| Newsgroups | gmane.comp.java.picocontainer.cvs |
|---|---|
| Message-ID | <9038991.14863.1293478677960.JavaMail.haus-jira@codehaus01.managed.contegix.com> |
[ http://jira.codehaus.org/browse/PICO-378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Rimov resolved PICO-378.
--------------------------------
Resolution: Fixed
Fix Version/s: 3.0
Fix checked in!
> Inconsistent Script Behavior When Run in Custom ClassLoader
> -----------------------------------------------------------
>
> Key: PICO-378
> URL: http://jira.codehaus.org/browse/PICO-378
> Project: PicoContainer
> Issue Type: Bug
> Components: PicoContainer Scripting
> Affects Versions: 2.10
> Reporter: Michael Rimov
> Fix For: 3.0
>
>
> When run inside a custom classloader, the scripting behaviors vary from one implementation to another.
> The test case (Jython Example)
> {code}
> @Test
> public void testExecutionWithinCustomClassLoader()
> throws MalformedURLException, ClassNotFoundException {
> Reader script = new StringReader("" +
> "from org.picocontainer import *;\n" +
> "from org.picocontainer.parameters import ComponentParameter;\n" +
> "pico = PicoBuilder().withLifecycle().withCaching().build();\n" +
> "pico.addComponent(\"TestComp\",TestComp\n);"
> );
> File testCompJar = TestHelper.getTestCompJarFile();
> assertTrue(testCompJar.isFile());
> URL compJarURL = testCompJar.toURI().toURL();
> final URLClassLoader cl = new URLClassLoader(new URL[] {compJarURL},
> getClass().getClassLoader());
> assertNotNull(cl.loadClass("TestComp"));
>
> ContainerBuilder containerBuilder = new JythonContainerBuilder(script, cl);
>
> PicoContainer pico = buildContainer(containerBuilder, null, null);
> assertNotNull(pico.getComponent("TestComp"));
> assertEquals("TestComp", pico.getComponent("TestComp").getClass().getName());
>
> }
> {code}
> Status of this bug:
> BeanShell: Ok
> Groovy : Ok
> Rhino : [Failed] but I have it fixed in my local code base and will check in shortly to the Pico 3 codebase.
> Jython : [Failed] and I haven't been able to figure out how to fix it.
> JRuby : Haven't tried it yet.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>