List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getName
@Override
public String getName()
From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudAppDashElement.java
@Override public void delete(UserInteractions ui) { CloudFoundryBootDashModel model = getCloudModel(); CloudAppDashElement cloudElement = this; cloudElement.cancelOperations();/* w ww .j a va2 s . co m*/ CancelationToken cancelToken = cloudElement.createCancelationToken(); CloudApplicationOperation operation = new CloudApplicationOperation("Deleting: " + cloudElement.getName(), model, cloudElement.getName(), cancelToken) { @Override protected void doCloudOp(IProgressMonitor monitor) throws Exception, OperationCanceledException { // Delete from CF first. Do it outside of synch block to avoid // deadlock model.getRunTarget().getClient().deleteApplication(appName); model.getElementConsoleManager().terminateConsole(cloudElement.getName()); model.removeApplication(cloudElement.getName()); cloudElement.setProject(null); } }; // Allow deletions to occur concurrently with any other application // operation operation.setSchedulingRule(null); getCloudModel().runAsynch(operation, ui); }
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java
@Test public void simpleDeployWithDefaultManualManifest() throws Exception { CFClientParams targetParams = CfTestTargetParams.fromEnv(); MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName()); CloudFoundryBootDashModel model = harness.createCfTarget(targetParams); IProject project = projects.createBootProject("to-deploy", withStarters("actuator", "web")); final String appName = project.getName(); harness.answerDeploymentPrompt(ui, (dialog) -> { dialog.okPressed();//from w w w . ja v a2s.c o m }); model.performDeployment(ImmutableSet.of(project), ui, RunState.RUNNING); waitForApps(model, appName); CloudAppDashElement app = model.getApplication(appName); waitForState(app, RunState.RUNNING, 10000); assertEquals((Integer) 1, space.getPushCount(appName).getValue()); assertNull(app.getDeploymentManifestFile()); assertEquals(1024, (int) app.getMemory()); assertEquals(appName, app.getName()); }