Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFApplicationDetail getStack

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFApplicationDetail getStack

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFApplicationDetail getStack.

Prototype

String getStack();

Source Link

Usage

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

@Test
public void testGetApplicationStack() throws Exception {
    String appName = appHarness.randomAppName();
    String stackName = "cflinuxfs2";

    CFPushArguments params = new CFPushArguments();
    params.setAppName(appName);/*from ww w  . j  a va2  s.co m*/
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");
    params.setStack(stackName);
    push(params);

    //Note we try to get the app two different ways because retrieving the info in
    // each case is slightly different.

    {
        CFApplicationDetail app = client.getApplication(appName);
        assertEquals(stackName, app.getStack());
    }

    {
        List<CFApplication> allApps = client.getApplicationsWithBasicInfo();
        CFApplication app = null;
        for (CFApplication a : allApps) {
            if (a.getName().equals(appName)) {
                app = a;
            }
        }
        assertEquals(stackName, app.getStack());
    }
}