Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement setError

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement setError

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement setError.

Prototype

public void setError(Throwable t) 

Source Link

Usage

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

@Test
public void refreshClearsErrorState() throws Exception {
    final String appName = "foo";
    String projectName = "to-deploy";
    CFClientParams targetParams = CfTestTargetParams.fromEnv();
    MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName());
    space.defApp(appName);/*from w  w w .j  av a 2  s  .  c  o m*/
    final IProject project = projects.createProject(projectName);

    final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams);
    waitForApps(target, appName);
    CloudAppDashElement appElement = target.getApplication(appName);
    appElement.setProject(project);

    waitForState(appElement, RunState.INACTIVE, 3000);
    //The state refressh is asynch so until state becomes 'INACTIVE' it will be unknown.
    appElement.setError(new IOException("Something bad happened"));
    waitForState(appElement, RunState.UNKNOWN, 3000);

    target.refresh(ui);

    waitForState(appElement, RunState.INACTIVE, 3000);
}