Package org.torquebox.core.runtime

Examples of org.torquebox.core.runtime.RubyRuntimeFactory


        service.stop();
        service.destroy();
    }
   
    protected Ruby createRuby() throws Exception {
        RubyRuntimeFactory factory = new RubyRuntimeFactory();

        if (System.getProperty( "gem.path" ) != null) {
            factory.setGemPath( System.getProperty( "gem.path" ) );
        } else {
            factory.setGemPath( "target/rubygems" );
        }
        factory.setUseJRubyHomeEnvVar( false );

        Ruby ruby = factory.createInstance( getClass().getSimpleName() );

        ruby.evalScriptlet( "require %q(rubygems)" );
        return ruby;
    }
View Full Code Here


import org.torquebox.core.runtime.RubyRuntimeFactory;

public class TestRubyFactory {

    public static Ruby createRuby() throws Exception {
        RubyRuntimeFactory factory = new RubyRuntimeFactory();

        if (System.getProperty( "gem.path" ) != null) {
            factory.setGemPath( System.getProperty( "gem.path" ) );
        } else {
            factory.setGemPath( "target/rubygems" );
        }
        factory.setUseJRubyHomeEnvVar( false );

        Ruby ruby = factory.createInstance( "test" );

        ruby.evalScriptlet( "require %q(rubygems)" );
        return ruby;
    }
View Full Code Here

    private RubyRuntimeFactory factory;
    private Ruby ruby;

    @Before
    public void setUpRuby() throws Exception {
        this.factory = new RubyRuntimeFactory();
        this.ruby = this.factory.createInstance( getClass().getSimpleName() );
    }
View Full Code Here

    private RubyRuntimeFactory factory;
    private Ruby ruby;

    @Before
    public void setUpRuby() throws Exception {
        this.factory = new RubyRuntimeFactory();
        this.ruby = this.factory.createInstance( getClass().getSimpleName() );
    }
View Full Code Here

        return this;
    }

    @Override
    public void startAsync(final StartContext context) throws Exception {
        this.factory = new RubyRuntimeFactory();
        this.factory.setClassLoader( getClass().getClassLoader() );
        this.factory.create();
        this.runtime = this.factory.createInstance( "global" );
        this.runtime.useAsGlobalRuntime();
    }
View Full Code Here

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertNull( factory.getRubyVersion() );
    }
View Full Code Here

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertEquals( CompatVersion.RUBY1_9, factory.getRubyVersion() );
    }
View Full Code Here

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertEquals( CompileMode.JIT, factory.getCompileMode() );

    }
View Full Code Here

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertEquals( CompileMode.OFF, factory.getCompileMode() );
    }
View Full Code Here

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertEquals( CompileMode.FORCE, factory.getCompileMode() );
    }
View Full Code Here

TOP

Related Classes of org.torquebox.core.runtime.RubyRuntimeFactory

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.