summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-02-24 12:07:20 (EST)
committerSteffen Pingel2012-02-24 12:07:20 (EST)
commitc04f8f262fa49407fd6dff4420f4644ec8470fdd (patch)
tree7fe0e43eb899d3096a82d765b2b9b8526c48cfad
parentb4988ce002db49e0e83bfa52dcfb8a2da8c84a78 (diff)
downloadorg.eclipse.mylyn.commons-c04f8f262fa49407fd6dff4420f4644ec8470fdd.zip
org.eclipse.mylyn.commons-c04f8f262fa49407fd6dff4420f4644ec8470fdd.tar.gz
org.eclipse.mylyn.commons-c04f8f262fa49407fd6dff4420f4644ec8470fdd.tar.bz2
RESOLVED - bug 372432: fix tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372432 Change-Id: I58e9b2c10895701cc7b01c6c7d4e6ee01aec76d1
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/core/storage/CommonStoreTest.java5
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java9
2 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/core/storage/CommonStoreTest.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/core/storage/CommonStoreTest.java
index 6795f3f..e5afd08 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/core/storage/CommonStoreTest.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/core/storage/CommonStoreTest.java
@@ -17,6 +17,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collections;
+import java.util.List;
import junit.framework.TestCase;
@@ -147,7 +148,9 @@ public class CommonStoreTest extends TestCase {
} catch (CoreException expected) {
File sourceFile = new File(location, "source");
File targetFile = new File(location, "target");
- assertEquals(Arrays.asList(sourceFile, targetFile), Arrays.asList(location.listFiles()));
+ List<File> list = Arrays.asList(location.listFiles());
+ Collections.sort(list);
+ assertEquals(Arrays.asList(sourceFile, targetFile), list);
assertEquals(Collections.singletonList(new File(targetFile, "handle2")),
Arrays.asList(targetFile.listFiles()));
}
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
index 86ad29f..5ca92b9 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/support/UiTestUtil.java
@@ -19,6 +19,8 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -76,7 +78,12 @@ public class UiTestUtil {
}
public static void closeAllEditors() {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ page.closeAllEditors(false);
+ }
+ }
}
}