Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg2014-03-30 14:09:20 +0000
committerRobin Rosenberg2014-05-17 08:09:22 +0000
commit19ac1f75ab6a5100144e52760cb29c6484ed3c96 (patch)
treed8f3c25644c49b351148026a42f7ccda9e359196
parent2aa2b3af31e95b90c20794c727fc2e48b5f448e9 (diff)
downloadjgit-19ac1f75ab6a5100144e52760cb29c6484ed3c96.tar.gz
jgit-19ac1f75ab6a5100144e52760cb29c6484ed3c96.tar.xz
jgit-19ac1f75ab6a5100144e52760cb29c6484ed3c96.zip
Fix failing ConfigTest on Windows
Trust the detection of features and just test CoreConfig. Change-Id: I37f838d270a221a75d0d3842ba2f3f90aa1d6f01
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java30
1 files changed, 7 insertions, 23 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
index 3c62e85502..aefdff185c 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java
@@ -42,15 +42,15 @@
*/
package org.eclipse.jgit.pgm;
-import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.CLIRepositoryTestCase;
+import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.SystemReader;
import org.junit.Before;
import org.junit.Test;
@@ -77,28 +77,12 @@ public class ConfigTest extends CLIRepositoryTestCase {
if (isMac)
expect.add("core.precomposeunicode=true");
expect.add("core.repositoryformatversion=0");
- if (SystemReader.getInstance().isWindows() && osVersion() < 6
- || javaVersion() < 1.7) {
+ if (!FS.DETECTED.supportsSymlinks())
expect.add("core.symlinks=false");
- }
expect.add(""); // ends with LF (last line empty)
- assertArrayEquals("expected default configuration", expect.toArray(),
- output);
+ assertEquals("expected default configuration",
+ Arrays.asList(expect.toArray()).toString(),
+ Arrays.asList(output).toString());
}
- private static float javaVersion() {
- String versionString = System.getProperty("java.version");
- Matcher matcher = Pattern.compile("(\\d+\\.\\d+).*").matcher(
- versionString);
- matcher.matches();
- return Float.parseFloat(matcher.group(1));
- }
-
- private static float osVersion() {
- String versionString = System.getProperty("os.version");
- Matcher matcher = Pattern.compile("(\\d+\\.\\d+).*").matcher(
- versionString);
- matcher.matches();
- return Float.parseFloat(matcher.group(1));
- }
}

Back to the top