Example usage for org.springframework.ide.eclipse.boot.dash.test.mocks MockCFSpace getPushCount

List of usage examples for org.springframework.ide.eclipse.boot.dash.test.mocks MockCFSpace getPushCount

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.test.mocks MockCFSpace getPushCount.

Prototype

public synchronized LiveCounter getPushCount(String name) 

Source Link

Usage

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

@Test
public void simpleDeploy() 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();

    harness.answerDeploymentPrompt(ui, appName, appName);
    model.performDeployment(ImmutableSet.of(project), ui, RunState.RUNNING);
    waitForApps(model, appName);//w ww  .j a va2  s.  c o m

    CloudAppDashElement app = model.getApplication(appName);

    waitForState(app, RunState.RUNNING, 10000);

    assertEquals((Integer) 1, space.getPushCount(appName).getValue());
}

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();/* w w  w.j  av a 2 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());
    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();// w w w .  jav  a 2s  . 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());
    assertNull(app.getDeploymentManifestFile());
    assertEquals(1024, (int) app.getMemory());
    assertEquals(appName, app.getName());
}