PluginScript implements PluginInterface { @Override public void deploy( Instance instance ) throws PluginException { this.logger.fine( this.agentId + " is deploying instance " + instance ); try { prepareAndExecuteCommand( "deploy", instance, null, null ); } catch( Exception e ) { throw new PluginException( e ); } }  @Override String getPluginName(); @Override void setNames( String applicationName, String scopedInstancePath ); @Override void initialize( Instance instance ); @Override void deploy( Instance instance ); @Override void start( Instance instance ); @Override void update(Instance instance, Import importChanged, InstanceStatus statusChanged); @Override void stop( Instance instance ); @Override void undeploy( Instance instance ); static final String PLUGIN_NAME; }
@Test public void testDeploy() throws Exception { Assume.assumeTrue( isLinuxSystem()); copyResources( "/BashScript" ); File file = new File( OUTPUT_DIR, "BashScriptFile.deploy" ); Assert.assertFalse( file.exists()); this.plugin.deploy( this.inst ); assertTrue( file.exists()); }
@Test( expected = PluginException.class ) public void testDeploy_exception() throws Exception { Assume.assumeTrue( isLinuxSystem()); copyResources( "/BashScriptError" ); this.plugin.deploy( this.inst ); }
@Test public void testDeploy_template() throws Exception { Assume.assumeTrue( isLinuxSystem()); copyResources( "/BashTemplate" ); File file = new File( OUTPUT_DIR, "BashTemplateFile.deploy" ); Assert.assertFalse( file.exists()); this.plugin.deploy( this.inst ); assertTrue( file.exists()); }
@Test( expected = PluginException.class ) public void testInvalidTemplate() throws Exception { Assume.assumeTrue( isLinuxSystem()); copyResources( "/BashTemplateInvalid" ); this.plugin.deploy( this.inst ); }