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/src/org/eclipse/egit/ui/internal
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/src/org/eclipse/egit/ui/internal')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/actions/LinkedResourcesTest.java24
1 files changed, 16 insertions, 8 deletions
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());
}
}
}

Back to the top