[CVS nano] warning on manual operation that is needed b4 test

Paul Hammant <paul-yCVjj/[email protected]> Fri, 6 Feb 2004 15:20:09 -0600
Newsgroups gmane.comp.java.nanocontainer.cvs
Message-ID <[email protected]>
Commit in nano/src/java/org/nanocontainer/script/bsh on MAIN

BeanShellComponentAdapter.java +5 -1 1.4 -> 1.5

warning on manual operation that is needed b4 test

----------

nano /src /java /org /nanocontainer /script /bsh

BeanShellComponentAdapter.java 1.4 -> 1.5

diff -u -r1.4 -r1.5
--- BeanShellComponentAdapter.java 28 Jan 2004 22:50:18 -0000 1.4
+++ BeanShellComponentAdapter.java 6 Feb 2004 21:20:09 -0000 1.5
@@ -45,7 +45,7 @@

*
* @author <a href="mail at leosimons dot com">Leo Simons</a>
* @author Aslak Hellesoy

- * @version $Id: BeanShellComponentAdapter.java,v 1.4 2004/01/28 22:50:18 paul Exp $

+ * @version $Id: BeanShellComponentAdapter.java,v 1.5 2004/02/06 21:20:09 paul Exp $

*/
public class BeanShellComponentAdapter extends AbstractComponentAdapter {
private final Parameter[] parameters;

@@ -71,6 +71,10 @@

i.eval("import " + getComponentImplementation().getName() + ";");

String scriptPath = "/" + getComponentImplementation().getName().replace('.', '/') + ".bsh";

+
+ // Inside IDEA, this relies on the compilation output path being the same directory as the source path.
+ // kludge - copy ScriptableDemoBean.bsh to the same location in the test output compile class path.
+ // the same problem exists for maven, but some custom jelly script will be able to fix that.

URL scriptURL = getComponentImplementation().getResource(scriptPath);
if (scriptURL == null) {
throw new BeanShellScriptInitializationException("Couldn't load script at path " + scriptPath);