Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client.v2 CFPushArguments setBuildpack

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client.v2 CFPushArguments setBuildpack

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client.v2 CFPushArguments setBuildpack.

Prototype

public void setBuildpack(String buildpack) 

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   w ww  .  j av  a2s  .  c om*/
    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);//w  ww .j  a  va2 s  . c  om
    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);//  www.j  a  v  a2  s  .com
    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());
    }
}

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

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

    CFPushArguments params = new CFPushArguments();
    params.setAppName(appName);//w w  w  .ja  v a2 s  . c om
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");
    push(params);

    SshClientSupport sshSupport = client.getSshClientSupport();
    SshHost sshHost = sshSupport.getSshHost();
    System.out.println(sshHost);
    assertEquals(getExpectedSshHost(), sshHost.getHost());
    assertEquals(2222, sshHost.getPort());
    assertTrue(StringUtil.hasText(sshHost.getFingerPrint()));

    assertTrue(StringUtil.hasText(sshSupport.getSshCode()));
    UUID appGuid = client.getApplication(appName).getGuid();
    String sshUser = sshSupport.getSshUser(appGuid, 0);
    System.out.println("sshUser = " + sshUser);
    assertTrue(StringUtil.hasText(sshUser));

    String code = sshSupport.getSshCode();
    System.out.println("sshCode = " + code);
    assertTrue(StringUtil.hasText(code));
}