Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getDeploymentManifestFile

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getDeploymentManifestFile

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getDeploymentManifestFile.

Prototype

public IFile getDeploymentManifestFile() 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java

@Test
public void simpleDeployWithManifest() 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 = appHarness.randomAppName();

    IFile manifestFile = createFile(project, "manifest.yml",
            "applications:\n" + "- name: " + appName + "\n" + "  memory: 512M\n");

    harness.answerDeploymentPrompt(ui, (dialog) -> {
        dialog.okPressed();//www. j a v a2s  .c om
    });

    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());
    assertEquals(manifestFile, app.getDeploymentManifestFile());
    assertEquals(512, (int) app.getMemory());
}

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  ww  . j  a  v  a2  s.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());
}

From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java

@Test
public void testSelectManifestAction() throws Exception {
    CFClientParams targetParams = CfTestTargetParams.fromEnv();
    MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName());

    IProject project = projects.createProject("pr");

    final String appName = "app";

    IFile manifestFile = createFile(project, "manifest.yml", "applications:\n" + "- name: " + appName + "\n");

    space.defApp(appName);/*ww w .  j  a v  a  2s .  co  m*/

    CloudFoundryBootDashModel model = harness.createCfTarget(targetParams);
    waitForApps(model, appName);

    CloudAppDashElement app = model.getApplication(appName);
    app.setProject(project);

    harness.selection.setElements(ImmutableSet.of(app));

    harness.answerDeploymentPrompt(ui, manifestFile);

    assertNull(app.getDeploymentManifestFile());
    actions.getSelectManifestAction().run();
    waitForJobsToComplete();
    assertEquals(manifestFile, app.getDeploymentManifestFile());

    verify(ui).promptApplicationDeploymentProperties(any());
    verifyNoMoreInteractions(ui);
}