Package org.projectodd.polyglot.test.as

Examples of org.projectodd.polyglot.test.as.MockDeploymentPhaseContext


    }

    @Test
    public void testDeployment() throws Exception {
       
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo" );
        rubyAppMetaData.attachTo( unit );
       
        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


        appendDeployer( new WebRuntimePoolProcessor() );
    }

    @Test
    public void testPoolMetaDataAttaching() throws Throwable {
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        (new RackMetaData()).attachTo( unit );

        deploy( phaseContext );
View Full Code Here

    }

    @Test
    public void testDeploymentWithNonDefaultRubyCompatibilityVersion() throws Exception {
       
        MockDeploymentPhaseContext phaseContext = createPhaseContext();
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();
       
        RubyRuntimeMetaData metaData = new RubyRuntimeMetaData();
        metaData.setVersion( RubyRuntimeMetaData.Version.V1_9 );
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, metaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        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

    @Test
    public void testPoolingYamlOverride() throws Throwable {
        prependDeployer( new PoolingYamlParsingProcessor() );
        prependDeployer( new TorqueBoxYamlParsingProcessor() );

        MockDeploymentPhaseContext phaseContext = setupResourceAsTorqueboxYml( "pooling.yml" );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        (new RackMetaData()).attachTo( unit );

        deploy( phaseContext );
        List<PoolMetaData> allMetaData = unit.getAttachmentList( PoolMetaData.ATTACHMENTS_KEY );
View Full Code Here

        assertEquals( CompatVersion.RUBY1_9, factory.getRubyVersion() );
    }

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


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        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

    }

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


        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "foo");
        rubyAppMetaData.attachTo( unit );
               
        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

        assertEquals( CompileMode.OFF, factory.getCompileMode() );
    }

    @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 );
               
        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

        assertEquals( CompileMode.FORCE, factory.getCompileMode() );
    }
   
    @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 );
               
        deploy( phaseContext );

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

        assertNotNull( factory );
        assertTrue( factory.isProfileApi() );
View Full Code Here

        assertTrue( factory.isProfileApi() );
    }   
   
    @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 );
               
        deploy( phaseContext );

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

        assertNotNull( factory );
        assertFalse( factory.isProfileApi() );
View Full Code Here

        RackMetaData rackAppMetaData = new RackMetaData();

        rubyAppMetaData.setRoot( this.root );
        rubyAppMetaData.setEnvironmentVariables( environment );

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

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

        deploy( phaseContext );
View Full Code Here

TOP

Related Classes of org.projectodd.polyglot.test.as.MockDeploymentPhaseContext

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.