Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse2016-02-12 05:41:44 +0000
committerDavid Pursehouse2016-02-12 05:41:44 +0000
commit61bb701eebb8b6701510dff392f6370a54358e13 (patch)
tree1d08e01ba632d436b1ca1454c05de504fee46a6c
parent03987f980b7336786a1d63fe39425a41b27eb0eb (diff)
downloadjgit-61bb701eebb8b6701510dff392f6370a54358e13.tar.gz
jgit-61bb701eebb8b6701510dff392f6370a54358e13.tar.xz
jgit-61bb701eebb8b6701510dff392f6370a54358e13.zip
MergeCommandTest: Use JUnit's assume to check preconditions
Using the assume method, instead of just returning, will cause the test to be marked as skipped rather than passed on systems where the precondition is not satisfied. Change-Id: I13672371f6cd3c481a0a6247e0eaed3aac6d766e Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
index b51c2beff5..cb3dbf1bc2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java
@@ -50,6 +50,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.io.File;
import java.util.Iterator;
@@ -1221,9 +1222,8 @@ public class MergeCommandTest extends RepositoryTestCase {
@Test
public void testFileModeMerge() throws Exception {
- if (!FS.DETECTED.supportsExecute())
- return;
// Only Java6
+ assumeTrue(FS.DETECTED.supportsExecute());
try (Git git = new Git(db)) {
writeTrashFile("mergeableMode", "a");
setExecutable(git, "mergeableMode", false);
@@ -1260,9 +1260,8 @@ public class MergeCommandTest extends RepositoryTestCase {
@Test
public void testFileModeMergeWithDirtyWorkTree() throws Exception {
- if (!FS.DETECTED.supportsExecute())
- return;
// Only Java6 (or set x bit in index)
+ assumeTrue(FS.DETECTED.supportsExecute());
try (Git git = new Git(db)) {
writeTrashFile("mergeableButDirty", "a");

Back to the top