@Test public void shouldRunPrepareScript() throws Exception { final String packageUri = "http: final String cookbookTemplateName = "jar"; final String expectedCommand = ". chef-solo/prepare_deployment.sh " + packageUri + " " + cookbookTemplateName + " no-qos"; NodePreparer preparer = new NodePreparer(node); preparer.sshWaiter = waiter; String instanceId = preparer.prepareNodeForDeployment(packageUri, cookbookTemplateName); assertEquals(INSTANCE_ID, instanceId); verify(ssh).runCommand(expectedCommand); }
public String prepareNodeForDeployment(String packageUri, String cookbookTemplateName) throws NodeNotPreparedException { DeploymentPreparerInvokerTask task = new DeploymentPreparerInvokerTask(packageUri, cookbookTemplateName); Future<String> future = singleThreadExecutor.submit(task); String instanceId = checkFuture(future); return instanceId; }
NodePreparer { public String prepareNodeForDeployment(String packageUri, String cookbookTemplateName) throws NodeNotPreparedException { DeploymentPreparerInvokerTask task = new DeploymentPreparerInvokerTask(packageUri, cookbookTemplateName); Future<String> future = singleThreadExecutor.submit(task); String instanceId = checkFuture(future); return instanceId; } }
NodePreparer { public String prepareNodeForDeployment(String packageUri, String cookbookTemplateName) throws NodeNotPreparedException { DeploymentPreparerInvokerTask task = new DeploymentPreparerInvokerTask(packageUri, cookbookTemplateName); Future<String> future = singleThreadExecutor.submit(task); String instanceId = checkFuture(future); return instanceId; } NodePreparer(CloudNode node); }
NodePreparer { public String prepareNodeForDeployment(String packageUri, String cookbookTemplateName) throws NodeNotPreparedException { DeploymentPreparerInvokerTask task = new DeploymentPreparerInvokerTask(packageUri, cookbookTemplateName); Future<String> future = singleThreadExecutor.submit(task); String instanceId = checkFuture(future); return instanceId; } NodePreparer(CloudNode node); String prepareNodeForDeployment(String packageUri, String cookbookTemplateName); void prepareNodeForUndeployment(String instanceId); }
NodePreparer { public String prepareNodeForDeployment(String packageUri, String cookbookTemplateName) throws NodeNotPreparedException { DeploymentPreparerInvokerTask task = new DeploymentPreparerInvokerTask(packageUri, cookbookTemplateName); Future<String> future = singleThreadExecutor.submit(task); String instanceId = checkFuture(future); return instanceId; } NodePreparer(CloudNode node); String prepareNodeForDeployment(String packageUri, String cookbookTemplateName); void prepareNodeForUndeployment(String instanceId);  }