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

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

Introduction

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

Prototype

List<String> getUris();

Source Link

Usage

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

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

    for (int i = 0; i < 2; i++) {
        //Why this loop? Because there was bug which CF V2 that made second push fail to bind to
        // map a host that was previously mapped.
        if (i > 0) {
            System.out.println("Delete app");
            client.deleteApplication(appName);
        }//from w  w  w .j ava 2 s.c om

        System.out.println("Pushing " + (i + 1));
        CFPushArguments params = new CFPushArguments();
        params.setAppName(appName);
        params.setApplicationData(getTestZip("testapp"));
        params.setBuildpack("staticfile_buildpack");
        params.setRoutes(ImmutableList.of(appName + "." + CFAPPS_IO()));

        push(params);
    }

    System.out.println("Pushing SUCCESS");

    CFApplicationDetail app = client.getApplication(appName);
    assertNotNull("Expected application to exist after push: " + appName, app);

    assertEquals(ImmutableSet.of(appName + "." + CFAPPS_IO()), ImmutableSet.copyOf(app.getUris()));
}

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

@Test
public void testPushAndBindMultipleHosts() throws Exception {
    String[] hostNames = { appHarness.randomAppName(), appHarness.randomAppName() };
    String appName = hostNames[0];

    CFPushArguments params = new CFPushArguments();
    params.setAppName(hostNames[0]);// w ww  .ja v  a2 s . c o  m
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");

    Set<String> routes = ImmutableSet
            .copyOf(Stream.of(hostNames).map((host) -> host + "." + CFAPPS_IO()).collect(Collectors.toList()));
    params.setRoutes(routes);

    push(params);

    System.out.println("Pushing SUCCESS");

    CFApplicationDetail app = client.getApplication(appName);
    assertNotNull("Expected application to exist after push: " + appName, app);

    assertEquals(routes, ImmutableSet.copyOf(app.getUris()));
}

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

@Test
public void testPushAndSetRoutes() throws Exception {
    String[] hostNames = { appHarness.randomAppName(), appHarness.randomAppName() };
    String appName = hostNames[0];

    CFPushArguments params = new CFPushArguments();
    params.setAppName(hostNames[0]);/* w w  w  .  j  a v  a 2 s . co m*/
    params.setApplicationData(getTestZip("testapp"));
    params.setBuildpack("staticfile_buildpack");

    Set<String> routes = ImmutableSet
            .copyOf(Stream.of(hostNames).map((host) -> host + "." + CFAPPS_IO()).collect(Collectors.toList()));
    params.setRoutes(routes);

    push(params);

    System.out.println("Pushing SUCCESS");

    {
        CFApplicationDetail app = client.getApplication(appName);
        assertNotNull("Expected application to exist after push: " + appName, app);
        assertEquals(routes, ImmutableSet.copyOf(app.getUris()));
    }

    doSetRoutesTest(appName, ImmutableSet.of());

    for (String route : routes) {
        doSetRoutesTest(appName, ImmutableSet.of(route));
    }

}

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

private void doSetRoutesTest(String appName, ImmutableSet<String> routes) throws Exception {
    ReactorUtils.get(client.setRoutes(appName, routes));
    CFApplicationDetail app = client.getApplication(appName);
    assertEquals(routes, ImmutableSet.copyOf(app.getUris()));
}