Package org.projectodd.polyglot.test.as

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


        assertEquals( "true", booleanVariable );
    }

    @Test
    public void testTorqueBoxYmlWithEnvInEnvVarsAsRACK_ENV() throws Exception {
        MockDeploymentPhaseContext context = setupResourceAsTorqueboxYml( "RACK_ENV-torquebox.yml" );
        MockDeploymentUnit unit = context.getMockDeploymentUnit();
       
        DeprecationLogger logger = mock( DeprecationLogger.class );
        unit.putAttachment( DeprecationLogger.ATTACHMENT_KEY, logger );

        deploy( context );
View Full Code Here


        assertEquals( "biscuit", rubyAppMetaData.getEnvironmentName() );
    }

    @Test
    public void testTorqueBoxYmlWithEnvInEnvVarsAsRAILS_ENV() throws Exception {
        MockDeploymentPhaseContext context = setupResourceAsTorqueboxYml( "RACK_ENV-torquebox.yml" );
        MockDeploymentUnit unit = context.getMockDeploymentUnit();
       
        DeprecationLogger logger = mock( DeprecationLogger.class );
        unit.putAttachment( DeprecationLogger.ATTACHMENT_KEY, logger );

        deploy( context );
View Full Code Here

        appendDeployer( new RuntimePoolInstaller() );
    }

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

        PoolMetaData poolMetaData = new PoolMetaData( "pool_one" );
        poolMetaData.setMinimumSize( 2 );
        poolMetaData.setMaximumSize( 200 );

        unit.addToAttachmentList( PoolMetaData.ATTACHMENTS_KEY, poolMetaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "test-app");
        rubyAppMetaData.attachTo( unit );
       
        deploy( phaseContext );
       
        ServiceName poolServiceName = CoreServices.runtimePoolName( unit, "pool_one" );
       
        MockServiceBuilder<?> poolServiceBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( poolServiceName );
        Value<?> poolServiceValue = poolServiceBuilder.getValue();
        RestartableRubyRuntimePool poolOne = (RestartableRubyRuntimePool) poolServiceValue.getValue();

        assertNotNull( poolOne );
        assertEquals( "pool_one", poolOne.getName() );
View Full Code Here

        assertEquals( 200, poolOne.getMaximumInstances() );
    }

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

        PoolMetaData poolMetaData = new PoolMetaData( "pool_one" );
        poolMetaData.setInstanceFactoryName( "instance_factory" );
        poolMetaData.setShared();
       
        unit.addToAttachmentList( PoolMetaData.ATTACHMENTS_KEY, poolMetaData );
       
        RubyAppMetaData rubyAppMetaData = new RubyAppMetaData( "test-app");
        rubyAppMetaData.attachTo( unit );
       
        deploy( phaseContext );
       
        ServiceName poolServiceName = CoreServices.runtimePoolName( unit, "pool_one" );
       
        MockServiceBuilder<?> poolServiceBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( poolServiceName );
        Value<?> poolServiceValue = poolServiceBuilder.getValue();
        RestartableRubyRuntimePool poolOne = (RestartableRubyRuntimePool) poolServiceValue.getValue();

        assertNotNull( poolOne );
        assertEquals( "pool_one", poolOne.getName() );
View Full Code Here

        assertEquals( "torquebox", rubyAppMetaData.getApplicationName() );
    }

    @Test
    public void testTorqueBoxYmlWithAppEnv() throws Exception {
        MockDeploymentPhaseContext context = setupResourceAsTorqueboxYml( "app-env-torquebox.yml" );
        MockDeploymentUnit unit = context.getMockDeploymentUnit();
       
        DeprecationLogger logger = mock( DeprecationLogger.class );
        unit.putAttachment( DeprecationLogger.ATTACHMENT_KEY, logger );

        deploy( context );
View Full Code Here

        }
    }

    @Test
    public void testWithRuntimeMetaData18() throws Exception {
        MockDeploymentPhaseContext phaseContext = setupResourceAsTorqueboxYml( "ruby-1.8.yml" );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData runtimeMetaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );

        deploy( phaseContext );
View Full Code Here

        assertEquals( RubyRuntimeMetaData.Version.V1_8, runtimeMetaData.getVersion() );
    }

    @Test
    public void testWithRuntimeMetaData19() throws Exception {
        MockDeploymentPhaseContext phaseContext = setupResourceAsTorqueboxYml( "ruby-1.9.yml" );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData runtimeMetaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );

        deploy( phaseContext );
View Full Code Here

        assertEquals( RubyRuntimeMetaData.Version.V1_9, runtimeMetaData.getVersion() );
    }

    @Test
    public void testWithRuntimeMetaData20() throws Exception {
        MockDeploymentPhaseContext phaseContext = setupResourceAsTorqueboxYml( "ruby-2.0.yml" );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData runtimeMetaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );

        deploy( phaseContext );
View Full Code Here

    }

    @Test
    public void testWithRuntimeMetaDataCompileModeForce() throws Exception {
        URL rubyYml = getClass().getResource( "ruby-compile-mode-force.yml" );
        MockDeploymentPhaseContext phaseContext = createPhaseContext( "torquebox.yml", rubyYml );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData runtimeMetaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );

        deploy( phaseContext );
View Full Code Here

    }

    @Test
    public void testWithRuntimeMetaDataCompileModeJit() throws Exception {
        URL rubyYml = getClass().getResource( "ruby-compile-mode-jit.yml" );
        MockDeploymentPhaseContext phaseContext = createPhaseContext( "torquebox.yml", rubyYml );
        MockDeploymentUnit unit = phaseContext.getMockDeploymentUnit();

        RubyRuntimeMetaData runtimeMetaData = new RubyRuntimeMetaData();
        unit.putAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY, runtimeMetaData );

        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.