Skip to content

Commit

Permalink
don't fail test due to timeout in tearDown when deleting project (#1076)
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo authored Dec 8, 2016
1 parent a56b4d9 commit 1205d85
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 1205d85

Please sign in to comment.