Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFApplication getName

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFApplication getName

Introduction

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

Prototype

String getName();

Source Link

Usage

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

@Test
public void testGetBoundServices() throws Exception {
    RetryUtil.retryWhen("testGetBoundServices", 5, FLAKY_SERVICE_BROKER, () -> {
        String service1 = services.createTestService();
        String service2 = services.createTestService();
        String service3 = services.createTestService();

        String appName = appHarness.randomAppName();
        CFPushArguments params = new CFPushArguments();
        params.setAppName(appName);//from   ww w.  java2  s. com
        params.setApplicationData(getTestZip("testapp"));
        params.setBuildpack("staticfile_buildpack");
        params.setServices(ImmutableList.of(service1, service2));
        push(params);

        List<CFApplication> allApps = client.getApplicationsWithBasicInfo();
        CFApplication app = null;
        for (CFApplication a : allApps) {
            if (a.getName().equals(appName)) {
                app = a;
            }
        }
        assertEquals(ImmutableSet.of(service1, service2), ImmutableSet.copyOf(app.getServices()));

        app = client.getApplication(appName);
        assertEquals(ImmutableSet.of(service1, service2), ImmutableSet.copyOf(app.getServices()));
    });
}

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

@Test
public void testGetApplicationBuildpack() throws Exception {
    String appName = appHarness.randomAppName();

    CFPushArguments params = new CFPushArguments();
    params.setAppName(appName);//from   w  w  w. j  ava  2 s. co  m
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");
    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("staticfile_buildpack", app.getBuildpackUrl());
    }

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

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);/*ww  w.j a  v a  2s. c o  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());
    }
}

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

@Test
public void testGetApplicationTimeout() throws Exception {
    String appName = appHarness.randomAppName();
    int timeout = 67;

    CFPushArguments params = new CFPushArguments();
    params.setAppName(appName);/*  ww w  .j ava 2 s  .  c  o m*/
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");
    params.setTimeout(timeout);
    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(timeout, (int) app.getTimeout());
    }

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

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

@Test
public void testGetApplicationCommand() throws Exception {
    String appName = appHarness.randomAppName();
    String command = "something interesting";

    CFPushArguments params = new CFPushArguments();
    params.setAppName(appName);//from   w  w  w  . j  a v  a  2s  . c  om
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");
    params.setCommand(command);
    params.setNoStart(true); // Our command is bogus so starting won't work
    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(command, app.getCommand());
    }

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