From 61bb701eebb8b6701510dff392f6370a54358e13 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 12 Feb 2016 14:41:44 +0900 Subject: [PATCH] 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 --- .../tst/org/eclipse/jgit/api/MergeCommandTest.java | 7 +++---- 1 file 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"); -- 2.39.5