Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-07-01 21:26:57 +0000
committerAndrey Loskutov2015-07-01 21:26:57 +0000
commit12e4f112c1ac3915e95bcbc77ddbd78c11f76bed (patch)
tree2b554ed07950a253f28b14f6aa128449872135ae /org.eclipse.egit.ui.test
parent66e2132430c164c868aeb7e8b44c8085d7116267 (diff)
downloadegit-12e4f112c1ac3915e95bcbc77ddbd78c11f76bed.tar.gz
egit-12e4f112c1ac3915e95bcbc77ddbd78c11f76bed.tar.xz
egit-12e4f112c1ac3915e95bcbc77ddbd78c11f76bed.zip
Test fixes: BranchAndResetActionTest, LinkedResourcesTest
Next round of test stability fixes... Change-Id: Ia9d93652b2a855245c922dbf921f9ee44f0a00d3 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java24
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java1
3 files changed, 21 insertions, 9 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
index 3b25eec6b6..050a5ab063 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
@@ -169,12 +169,15 @@ public abstract class LocalRepositoryTestCase extends EGitTestCase {
@After
public void resetWorkspace() throws Exception {
+ TestUtil.processUIEvents();
// close all editors/dialogs
new Eclipse().reset();
+ TestUtil.processUIEvents();
// cleanup
for (IProject project : ResourcesPlugin.getWorkspace().getRoot()
- .getProjects())
+ .getProjects()) {
project.delete(false, false, null);
+ }
shutDownRepositories();
TestUtil.waitForJobs(50, 5000);
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java
index 528515ffda..2d62129dab 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java
@@ -13,6 +13,8 @@ package org.eclipse.egit.ui.internal.actions;
import static org.eclipse.jgit.junit.JGitTestUtil.write;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -28,6 +30,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jgit.util.FileUtils;
@@ -102,22 +105,27 @@ public class LinkedResourcesTest extends LocalRepositoryTestCase {
write(standaloneFile, "Something");
// Create linked file in project that points the file above
IFile linkedFile = project.getFile(LINKED_FILE);
+ assertFalse(linkedFile.exists());
linkedFile.createLink(standaloneFile.toURI(),
IResource.ALLOW_MISSING_LOCAL, null);
+
// Prepare a mixed selection
Object[] mixedSelection = { linkedFile,
project.getFile(FILE1), project.getFile(FILE2) };
for (RepositoryActionHandler handler : handlers) {
+ assertTrue(linkedFile.exists());
+ assertTrue(linkedFile.isLinked(IResource.CHECK_ANCESTORS));
+ assertNotNull(linkedFile.getLocation());
+ assertNull(RepositoryMapping.getMapping(linkedFile.getLocation()));
+
handler.setSelection(new StructuredSelection(linkedFile));
- assertFalse(
- handler.getClass().getSimpleName()
- + " is enabled on a linked resource pointing outside any project and repository.",
- handler.isEnabled());
+ assertFalse(handler.getClass().getSimpleName()
+ + " is enabled on a linked resource pointing outside any project and repository: "
+ + linkedFile.getLocation(), handler.isEnabled());
handler.setSelection(new StructuredSelection(mixedSelection));
- assertFalse(
- handler.getClass().getSimpleName()
- + " is enabled when selection contains a linked resource pointing outside any project and repository.",
- handler.isEnabled());
+ assertFalse(handler.getClass().getSimpleName()
+ + " is enabled when selection contains a linked resource pointing outside any project and repository: "
+ + linkedFile.getLocation(), handler.isEnabled());
}
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
index d1f1f29d34..f304f732ee 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/BranchAndResetActionTest.java
@@ -329,6 +329,7 @@ public class BranchAndResetActionTest extends LocalRepositoryTestCase {
createBranchDialog.bot()
.checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
createBranchDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
+ TestUtil.waitForJobs(100, 5000);
ObjectId resolvedBranch = repo.resolve("branch-from-tag");
ObjectId resolvedTagCommit = repo.resolve("SomeTag^{commit}");

Back to the top