From 1205d8532f9ea80dee7f445632b51cb8e97eaf1a Mon Sep 17 00:00:00 2001 From: Elliotte Rusty Harold Date: Thu, 8 Dec 2016 15:54:56 -0500 Subject: [PATCH] don't fail test due to timeout in tearDown when deleting project (#1076) --- .../integration/appengine/AbstractProjectTests.java | 7 ++++++- .../appengine/DebugNativeAppEngineStandardProject.java | 4 ++-- .../integration/appengine/DeployPropertyPageTest.java | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/AbstractProjectTests.java b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/AbstractProjectTests.java index 766f2b245b..e525b87048 100644 --- a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/AbstractProjectTests.java +++ b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/AbstractProjectTests.java @@ -23,6 +23,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; +import org.eclipse.swtbot.swt.finder.widgets.TimeoutException; import org.junit.After; import org.junit.BeforeClass; @@ -48,7 +49,11 @@ public void tearDown() { if (project != null) { // ensure there are no jobs SwtBotWorkbenchActions.waitForIdle(bot); - SwtBotProjectActions.deleteProject(bot, project.getName()); + try { + SwtBotProjectActions.deleteProject(bot, project.getName()); + } catch (TimeoutException ex) { + // If this fails it shouldn't fail the test, which has already run + } project = null; } bot.resetWorkbench(); diff --git a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProject.java b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProject.java index 38e0ec5970..e09346e588 100644 --- a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProject.java +++ b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProject.java @@ -74,8 +74,8 @@ public void testDebugLaunch() throws Exception { "app.engine.test"); assertTrue(project.exists()); - SWTBotTreeItem project = SwtBotProjectActions.selectProject(bot, "testapp"); - assertNotNull(project); + SWTBotTreeItem testappProject = SwtBotProjectActions.selectProject(bot, "testapp"); + assertNotNull(testappProject); SwtBotTestingUtilities.performAndWaitForWindowChange(bot, new Runnable() { @Override public void run() { diff --git a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DeployPropertyPageTest.java b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DeployPropertyPageTest.java index 726099236c..34e06c41b9 100644 --- a/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DeployPropertyPageTest.java +++ b/plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DeployPropertyPageTest.java @@ -28,7 +28,6 @@ import org.junit.Test; public class DeployPropertyPageTest extends AbstractProjectTests { - // TODO: add tests for flex project when Create New Flex project wizard is available @Test public void testPropertyPageTitle_standardProject() throws CoreException { String projectName = "foo";