Browse Source

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>
tags/v4.3.0.201603230630-rc1
David Pursehouse 8 years ago
parent
commit
61bb701eeb

+ 3
- 4
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/MergeCommandTest.java View File

@@ -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");

Loading…
Cancel
Save