Package org.torquebox.core.runtime

Examples of org.torquebox.core.runtime.RubyRuntimeMetaData


    @Test
    public void testDeploymentWithFORCECompileMode() throws Exception {
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();
       
        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setCompileMode( RubyRuntimeMetaData.CompileMode.FORCE );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
View Full Code Here


    @Test
    public void testDeploymentTrueProfileAPI() throws Exception {
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();
       
        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setProfileApi( true );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
View Full Code Here

    @Test
    public void testDeploymentFalseProfileAPI() throws Exception {
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();
       
        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setProfileApi( false );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
View Full Code Here

        rubyAppMetaData.attachTo( unit );
        rackAppMetaData.attachTo( unit );

        deploy( phaseContext );
       
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( this.root, runtimeMetaData.getBaseDir() );
        assertTrue( runtimeMetaData.getEnvironment().containsKey( "SOME_VAR" ) );
        assertTrue( runtimeMetaData.getRuntimeInitializer() instanceof RackRuntimeInitializer );
        assertEquals( RubyRuntimeMetaData.RuntimeType.RACK, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

        rubyAppMetaData.setRoot( this.root );

        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData originalRuntimeMD = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, originalRuntimeMD );
        rubyAppMetaData.attachTo( unit );
        rackAppMetaData.attachTo( unit );

        deploy( phaseContext );

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( originalRuntimeMD, runtimeMetaData );
        assertEquals( this.root, runtimeMetaData.getBaseDir() );
        assertEquals( RubyRuntimeMetaData.RuntimeType.RACK, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

        rubyAppMetaData.setRoot( this.root );
       
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData originalRuntimeMD = new RubyRuntimeMetaData();
        originalRuntimeMD.setRuntimeType( RubyRuntimeMetaData.RuntimeType.BARE );

        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, originalRuntimeMD );
        rubyAppMetaData.attachTo( unit );
        rackAppMetaData.attachTo( unit );

        deploy( phaseContext );

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( originalRuntimeMD, runtimeMetaData );
        assertNull( runtimeMetaData.getBaseDir() );
        assertEquals( RubyRuntimeMetaData.RuntimeType.BARE, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

        rubyAppMetaData.attachTo( unit );
               
        deploy( phaseContext );

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( this.root, runtimeMetaData.getBaseDir() );
        assertTrue( runtimeMetaData.getEnvironment().containsKey( "SOME_VAR" ) );
        assertEquals( RubyRuntimeMetaData.RuntimeType.BARE, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

    public void testWithExistingRubyRuntimeMD() throws Exception {
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "app_name");

        rubyAppMetaData.setRoot( this.root );

        RubyRuntimeMetaData existingRuntimeMD = new RubyRuntimeMetaData();
       
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, existingRuntimeMD );
        rubyAppMetaData.attachTo( unit );

        deploy( phaseContext );

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( existingRuntimeMD, runtimeMetaData );
        assertEquals( this.root, runtimeMetaData.getBaseDir() );
        assertEquals( RubyRuntimeMetaData.RuntimeType.BARE, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

        rubyAppMetaData.setRoot( this.root );

        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();
       
        RubyRuntimeMetaData existingRuntimeMD = new RubyRuntimeMetaData();
        existingRuntimeMD.setRuntimeType( RubyRuntimeMetaData.RuntimeType.RACK );

        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, existingRuntimeMD );
        rubyAppMetaData.attachTo( unit );
       
        deploy( phaseContext );

        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );
        assertNotNull( runtimeMetaData );
        assertEquals( existingRuntimeMD, runtimeMetaData );
        assertNull( runtimeMetaData.getBaseDir() );
        assertEquals( RubyRuntimeMetaData.RuntimeType.RACK, runtimeMetaData.getRuntimeType() );
    }
View Full Code Here

        if ( rubyAppMetaData == null || rackAppMetaData == null || railsAppMetaData == null ) {
            return;
        }
       
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY );
       
        if ( runtimeMetaData != null && runtimeMetaData.getRuntimeType() != null ) {
            return;
        }
       
        if (runtimeMetaData == null) {
            runtimeMetaData = new RubyRuntimeMetaData();
            unit.putAttachmentRubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );
        }
       
        runtimeMetaData.setBaseDir( rubyAppMetaData.getRoot() );
        runtimeMetaData.setEnvironment( rubyAppMetaData.getEnvironmentVariables() );
        runtimeMetaData.setRuntimeType( RubyRuntimeMetaData.RuntimeType.RAILS );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( rubyAppMetaData.getRoot() ) );
        runtimeMetaData.appendLoadPath( new RubyLoadPathMetaData( new File( rubyAppMetaData.getRoot(), "lib" ) ) );
       
        RuntimeInitializer initializer = new RailsRuntimeInitializer( rubyAppMetaData, rackAppMetaData, railsAppMetaData );
        RuntimePreparer preparer = new BundlerAwareRuntimePreparer( rubyAppMetaData );
        runtimeMetaData.setRuntimeInitializer( initializer );
        runtimeMetaData.setRuntimePreparer( preparer );
    }
View Full Code Here

TOP

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

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.