Package org.jruby.embed.jsr223

Examples of org.jruby.embed.jsr223.Utils


    @Test
    public void test2JRubyEngineFactoryWithWrongPropertyName() throws Exception {
        System.setProperty( PropertyName.CLASSLOADER.toString(), "something");
        // we do have an instance of "jruby" loaded via some other classloader
        ScriptEngineManager m = new ScriptEngineManager();
        m.registerEngineName( "jruby", new JRubyEngineFactory() );
        ScriptEngine jruby = m.getEngineByName("jruby");
        String result = jruby.eval("$LOAD_PATH" ).toString();
        assertNotNull(result);

        assertEquals(jruby.eval("JRuby.runtime.jruby_class_loader.parent" ), cl );
View Full Code Here


    @Test
    public void test3JRubyEngineFactoryWithNoneClassloaderPropertyName() throws Exception {
        System.setProperty( PropertyName.CLASSLOADER.toString(), "none");
        // we do have an instance of "jruby" loaded via some other classloader
        ScriptEngineManager m = new ScriptEngineManager();
        m.registerEngineName( "jruby", new JRubyEngineFactory() );
        ScriptEngine jruby = m.getEngineByName("jruby");
        String result = jruby.eval("$LOAD_PATH" ).toString();
        assertNotNull(result);

        assertEquals(jruby.eval("JRuby.runtime.jruby_class_loader.parent" ), cl );
View Full Code Here

    @Test
    public void test4JRubyEngineFactory() throws Exception {
        // we do have an instance of "jruby" loaded via some other classloader
        ScriptEngineManager m = new ScriptEngineManager();
        m.registerEngineName( "jruby", new JRubyEngineFactory() );
        ScriptEngine jruby = m.getEngineByName("jruby");
        String result = jruby.eval("$LOAD_PATH" ).toString();
        assertNotNull(result);

        assertEquals(jruby.eval("JRuby.runtime.jruby_class_loader.parent" ), cl );
View Full Code Here

            }
            //are we in OSGi ?
            try {
                ScriptingContainer.class.getClassLoader().loadClass("org.osgi.framework.Bundle");
            } catch (Throwable e) {
                scriptingContainerFactory = new ScriptingContainerFactory();
            }
            try {
                Class<?> _osgiScriptingContainerClass = ScriptingContainer.class.getClassLoader()
                        .loadClass("org.jruby.embed.osgi.internal.OSGiScriptingContainerFactory");
                scriptingContainerFactory = (ScriptingContainerFactory)_osgiScriptingContainerClass.newInstance();
View Full Code Here

TOP

Related Classes of org.jruby.embed.jsr223.Utils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.