@Test public void testSkipEntityStartIfRunningWhenAlreadyRunning() throws Exception { app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class) .configure(VanillaSoftwareProcess.SKIP_ENTITY_START_IF_RUNNING, true) .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand") .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand") .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand") .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand") .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand") .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand") .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand") .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand") .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand") .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand") .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand")); app.start(ImmutableList.of(loc)); assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of( "checkRunningCommand")); assertExecsNotContains(RecordingSshTool.getExecCmds(), ImmutableList.of( "launchCommand")); }
@Test public void testSkipInstallation() throws Exception { app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class) .configure(VanillaSoftwareProcess.SKIP_INSTALLATION, true) .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand") .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand") .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand") .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand") .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand") .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand") .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand") .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand") .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand") .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand") .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand")); app.start(ImmutableList.of(loc)); assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of( "preCustomizeCommand", "customizeCommand", "postCustomizeCommand", "preLaunchCommand", "launchCommand", "postLaunchCommand", "checkRunningCommand")); assertExecsNotContains(RecordingSshTool.getExecCmds(), ImmutableList.of( "preInstallCommand", "installCommand", "postInstallCommand")); }
@Test public void testAllCmds() throws Exception { app.createAndManageChild(EntitySpec.create(VanillaSoftwareProcess.class) .configure(VanillaSoftwareProcess.PRE_INSTALL_COMMAND, "preInstallCommand") .configure(VanillaSoftwareProcess.INSTALL_COMMAND, "installCommand") .configure(VanillaSoftwareProcess.POST_INSTALL_COMMAND, "postInstallCommand") .configure(VanillaSoftwareProcess.PRE_CUSTOMIZE_COMMAND, "preCustomizeCommand") .configure(VanillaSoftwareProcess.CUSTOMIZE_COMMAND, "customizeCommand") .configure(VanillaSoftwareProcess.POST_CUSTOMIZE_COMMAND, "postCustomizeCommand") .configure(VanillaSoftwareProcess.PRE_LAUNCH_COMMAND, "preLaunchCommand") .configure(VanillaSoftwareProcess.LAUNCH_COMMAND, "launchCommand") .configure(VanillaSoftwareProcess.POST_LAUNCH_COMMAND, "postLaunchCommand") .configure(VanillaSoftwareProcess.CHECK_RUNNING_COMMAND, "checkRunningCommand") .configure(VanillaSoftwareProcess.STOP_COMMAND, "stopCommand")); app.start(ImmutableList.of(loc)); assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of( "preInstallCommand", "installCommand", "postInstallCommand", "preCustomizeCommand", "customizeCommand", "postCustomizeCommand", "preLaunchCommand", "launchCommand", "postLaunchCommand", "checkRunningCommand")); app.stop(); assertExecContains(RecordingSshTool.getLastExecCmd(), "stopCommand"); }
app.start(ImmutableList.of(loc)); assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of( "checkRunningCommand", "preInstallCommand", "installCommand", "postInstallCommand",
.get(); assertExecsContain(RecordingSshTool.getExecCmds(), ImmutableList.of( "checkRunningCommand", "stopCommand", "preLaunchCommand", "launchCommand", "postLaunchCommand",