List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudFoundryBootDashModel refresh
@Override public void refresh(UserInteractions ui)
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java
@Test public void testBasicRefreshApps() throws Exception { CFClientParams targetParams = CfTestTargetParams.fromEnv(); MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName()); space.defApp("foo"); space.defApp("bar"); final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams); waitForApps(target, "foo", "bar"); space.defApp("anotherfoo"); space.defApp("anotherbar"); target.refresh(ui); waitForApps(target, "foo", "bar", "anotherfoo", "anotherbar"); }
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java
@Test public void testRefreshAppsRunState() throws Exception { CFClientParams targetParams = CfTestTargetParams.fromEnv(); MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName()); final MockCFApplication foo = space.defApp("foo"); space.defApp("bar"); final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams); waitForApps(target, "foo", "bar"); foo.start(CancelationTokens.NULL);//from w w w. j a va 2 s . co m target.refresh(ui); new ACondition("wait for app states", 3000) { @Override public boolean test() throws Exception { ImmutableSet<String> appNames = getNames(target.getApplications().getValues()); assertEquals(ImmutableSet.of("foo", "bar"), appNames); CloudAppDashElement appElement = harness.getCfTargetModel().getApplication("foo"); assertEquals(RunState.RUNNING, appElement.getRunState()); appElement = harness.getCfTargetModel().getApplication("bar"); assertEquals(RunState.INACTIVE, appElement.getRunState()); return true; } }; }
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java
@Test public void testRefreshAppsHealthCheck() throws Exception { CFClientParams targetParams = CfTestTargetParams.fromEnv(); MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName()); final MockCFApplication foo = space.defApp("foo"); final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams); waitForApps(target, "foo"); CloudAppDashElement appElement = harness.getCfTargetModel().getApplication("foo"); assertEquals(HealthChecks.HC_PORT, appElement.getHealthCheck()); foo.setHealthCheck(HealthChecks.HC_NONE); target.refresh(ui); new ACondition("wait for app health check", 3000) { @Override//from w w w . ja v a 2 s . c o m public boolean test() throws Exception { ImmutableSet<String> appNames = getNames(target.getApplications().getValues()); assertEquals(ImmutableSet.of("foo"), appNames); CloudAppDashElement appElement = harness.getCfTargetModel().getApplication("foo"); assertEquals(HealthChecks.HC_NONE, appElement.getHealthCheck()); return true; } }; }
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java
@Test public void testRefreshServices() throws Exception { CFClientParams targetParams = CfTestTargetParams.fromEnv(); MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName()); space.defApp("foo"); space.defService("elephantsql"); space.defService("cleardb"); final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams); waitForApps(target, "foo"); waitForServices(target, "elephantsql", "cleardb"); waitForElements(target, "foo", "elephantsql", "cleardb"); space.defService("rabbit"); target.refresh(ui); waitForServices(target, "elephantsql", "cleardb", "rabbit"); waitForElements(target, "foo", "elephantsql", "cleardb", "rabbit"); }
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 a v a 2 s.c om*/ 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); }