diff options
author | Robin Stocker | 2013-01-18 17:23:43 +0000 |
---|---|---|
committer | Robin Stocker | 2013-01-18 19:36:18 +0000 |
commit | c22a906c5cdb7ddb23dda06535c2ca8ca60e8988 (patch) | |
tree | 095f67d3e46b1c62c86174613920fe09e512f628 /org.eclipse.egit.ui.test/src/org | |
parent | 4c55ea040373884fed1a0d5988fc618f96ca63c9 (diff) | |
download | egit-c22a906c5cdb7ddb23dda06535c2ca8ca60e8988.tar.gz egit-c22a906c5cdb7ddb23dda06535c2ca8ca60e8988.tar.xz egit-c22a906c5cdb7ddb23dda06535c2ca8ca60e8988.zip |
[syncView] Improve message when tree item is not found in tests
Bug: 371633
Change-Id: Ib1dc70692db8bd610e32c142492d3d1c57e9d2b5
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org')
-rw-r--r-- | org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java index 5ff984bab1..8e39b697b9 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/synchronize/AbstractSynchronizeViewTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; @@ -49,6 +50,7 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepository; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.StringUtils; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView; import org.eclipse.swtbot.swt.finder.SWTBot; @@ -297,17 +299,22 @@ public abstract class AbstractSynchronizeViewTest extends return item; } - throw new RuntimeException("Poject with name " + projectName + + throw new RuntimeException("Project with name " + projectName + " was not found in given tree"); } private SWTBotTreeItem getTreeItemContainingText(SWTBotTreeItem[] items, String text) { - for (SWTBotTreeItem item : items) + List<String> existingItems = new ArrayList<String>(); + for (SWTBotTreeItem item : items) { if (item.getText().contains(text)) return item; + existingItems.add(item.getText()); + } throw new WidgetNotFoundException( - "Tree item elment containing text: test commit was not found"); + "Tree item element containing text \"" + text + + "\" was not found. Existing tree items:\n" + + StringUtils.join(existingItems, "\n")); } } |