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

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

Introduction

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

Prototype

@Deprecated
String getSshUser(UUID appGuid, int instance) throws Exception;

Source Link

Document

Deprecated because it is not supported with V2.

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.j  av 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));
}