summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2017-01-30 07:32:30 -0500
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2017-01-30 07:32:32 -0500
commit25ab5b4d9b0960e374ffd006825c21d08b5cf158 (patch)
tree7dfea9dbd0f6db5615b84221717d26850ffee1e6 /org.eclipse.jgit.test
parentc64412e1f908d054cbd0198c0ac12397aab14c9f (diff)
parenta4feeb01945e039b39a246f96a1a91b0e4836f01 (diff)
downloadjgit-25ab5b4d9b0960e374ffd006825c21d08b5cf158.tar.gz
jgit-25ab5b4d9b0960e374ffd006825c21d08b5cf158.zip
Merge "Don't rely on default locale when using toUpperCase() and toLowerCase()"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java5
2 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
index 80ece1c26a..0adea0baa7 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdTest.java
@@ -49,6 +49,8 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import java.util.Locale;
+
import org.eclipse.jgit.errors.InvalidObjectIdException;
import org.junit.Test;
@@ -122,7 +124,7 @@ public class ObjectIdTest {
public void test011_toString() {
final String x = "0123456789ABCDEFabcdef1234567890abcdefAB";
final ObjectId oid = ObjectId.fromString(x);
- assertEquals(x.toLowerCase(), oid.name());
+ assertEquals(x.toLowerCase(Locale.ROOT), oid.name());
}
@Test(expected = InvalidObjectIdException.class)
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java
index cc5870ebfe..a60bb39cea 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java
@@ -85,6 +85,7 @@ import java.security.Security;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Locale;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
@@ -461,7 +462,7 @@ public class WalkEncryptionTest {
Set<String> source = Security.getAlgorithms("Cipher");
Set<String> target = new TreeSet<String>();
for (String algo : source) {
- algo = algo.toUpperCase();
+ algo = algo.toUpperCase(Locale.ROOT);
if (algo.matches(regex)) {
target.add(algo);
}
@@ -759,7 +760,7 @@ public class WalkEncryptionTest {
for (String source : cipherSet) {
// Standard names are not case-sensitive.
// http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html
- String target = algorithm.toUpperCase();
+ String target = algorithm.toUpperCase(Locale.ROOT);
if (source.equalsIgnoreCase(target)) {
return true;
}