Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client SshClientSupport getSshHost

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client SshClientSupport getSshHost

Introduction

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

Prototype

SshHost getSshHost() throws Exception;

Source Link

Usage

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);//from   w  ww  . jav a 2  s  . c  o  m
    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));
}