diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/src/test/java/libcore/java/security/StandardNames.java | 6 | ||||
-rw-r--r-- | support/src/test/java/tests/http/MockWebServer.java | 5 | ||||
-rw-r--r-- | support/src/test/java/tests/resources/hyts_signed_authAttrs.jar | bin | 0 -> 2859 bytes | |||
-rw-r--r-- | support/src/test/java/tests/support/Support_DecimalFormat.java | 51 | ||||
-rw-r--r-- | support/src/test/java/tests/support/Support_Locale.java | 33 | ||||
-rw-r--r-- | support/src/test/java/tests/support/Support_PortManager.java | 2 |
6 files changed, 26 insertions, 71 deletions
diff --git a/support/src/test/java/libcore/java/security/StandardNames.java b/support/src/test/java/libcore/java/security/StandardNames.java index ae25352..bb9aeda 100644 --- a/support/src/test/java/libcore/java/security/StandardNames.java +++ b/support/src/test/java/libcore/java/security/StandardNames.java @@ -31,6 +31,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import javax.crypto.spec.DHPrivateKeySpec; @@ -99,12 +100,12 @@ public final class StandardNames extends Assert { PROVIDER_ALGORITHMS.put(type, algorithms); } assertTrue("Duplicate " + type + " " + algorithm, - algorithms.add(algorithm.toUpperCase())); + algorithms.add(algorithm.toUpperCase(Locale.ROOT))); } private static void unprovide(String type, String algorithm) { Set<String> algorithms = PROVIDER_ALGORITHMS.get(type); assertNotNull(algorithms); - assertTrue(algorithm, algorithms.remove(algorithm.toUpperCase())); + assertTrue(algorithm, algorithms.remove(algorithm.toUpperCase(Locale.ROOT))); if (algorithms.isEmpty()) { assertNotNull(PROVIDER_ALGORITHMS.remove(type)); } @@ -212,6 +213,7 @@ public final class StandardNames extends Assert { provide("SecretKeyFactory", "PBEWithSHA1AndDESede"); provide("SecretKeyFactory", "PBEWithSHA1AndRC2_40"); provide("SecretKeyFactory", "PBKDF2WithHmacSHA1"); + provide("SecretKeyFactory", "PBKDF2WithHmacSHA1And8bit"); provide("SecureRandom", "SHA1PRNG"); provide("Signature", "MD2withRSA"); provide("Signature", "MD5withRSA"); diff --git a/support/src/test/java/tests/http/MockWebServer.java b/support/src/test/java/tests/http/MockWebServer.java index fa01380..1b776b2 100644 --- a/support/src/test/java/tests/http/MockWebServer.java +++ b/support/src/test/java/tests/http/MockWebServer.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Set; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; @@ -54,7 +55,7 @@ import static tests.http.SocketPolicy.DISCONNECT_AT_START; * A scriptable web server. Callers supply canned responses and the server * replays them upon request in sequence. * - * @deprecated prefer com.google.mockwebserver.MockWebServer + * @deprecated Use {@code com.google.mockwebserver.MockWebServer} instead. */ @Deprecated public final class MockWebServer { @@ -345,7 +346,7 @@ public final class MockWebServer { String header; while (!(header = readAsciiUntilCrlf(in)).isEmpty()) { headers.add(header); - String lowercaseHeader = header.toLowerCase(); + String lowercaseHeader = header.toLowerCase(Locale.ROOT); if (contentLength == -1 && lowercaseHeader.startsWith("content-length:")) { contentLength = Integer.parseInt(header.substring(15).trim()); } diff --git a/support/src/test/java/tests/resources/hyts_signed_authAttrs.jar b/support/src/test/java/tests/resources/hyts_signed_authAttrs.jar Binary files differnew file mode 100644 index 0000000..dded44f --- /dev/null +++ b/support/src/test/java/tests/resources/hyts_signed_authAttrs.jar diff --git a/support/src/test/java/tests/support/Support_DecimalFormat.java b/support/src/test/java/tests/support/Support_DecimalFormat.java index 9baa4cc..89e226a 100644 --- a/support/src/test/java/tests/support/Support_DecimalFormat.java +++ b/support/src/test/java/tests/support/Support_DecimalFormat.java @@ -139,37 +139,26 @@ public class Support_DecimalFormat extends Support_Format { Locale us = Locale.US; Locale tr = new Locale("de", "CH"); - if (Support_Locale.isLocaleAvailable(us)) { - // locale dependent test, bug 1943269 + // test number instance + t_Format(1, number, NumberFormat.getNumberInstance(us), getNumberVectorUS()); - // test number instance - t_Format(1, number, NumberFormat.getNumberInstance(us), - getNumberVectorUS()); + // test integer instance + t_Format(2, number, NumberFormat.getIntegerInstance(us), getIntegerVectorUS()); - // test integer instance - t_Format(2, number, NumberFormat.getIntegerInstance(us), - getIntegerVectorUS()); + // test percent instance + t_Format(3, number, NumberFormat.getPercentInstance(us), getPercentVectorUS()); - // test percent instance - t_Format(3, number, NumberFormat.getPercentInstance(us), - getPercentVectorUS()); + // test currency instance with US Locale + t_Format(4, number, NumberFormat.getCurrencyInstance(us), getPositiveCurrencyVectorUS()); - // test currency instance with US Locale - t_Format(4, number, NumberFormat.getCurrencyInstance(us), - getPositiveCurrencyVectorUS()); + // test negative currency instance with US Locale + t_Format(5, negativeNumber, NumberFormat.getCurrencyInstance(us), getNegativeCurrencyVectorUS()); - // test negative currency instance with US Locale - t_Format(5, negativeNumber, NumberFormat.getCurrencyInstance(us), - getNegativeCurrencyVectorUS()); + // test multiple grouping separators + t_Format(6, longNumber, NumberFormat.getNumberInstance(us), getNumberVector2US()); - // test multiple grouping seperators - t_Format(6, longNumber, NumberFormat.getNumberInstance(us), - getNumberVector2US()); - - // test 0 - t_Format(7, zeroNumber, NumberFormat.getNumberInstance(us), - getZeroVector()); - } + // test 0 + t_Format(7, zeroNumber, NumberFormat.getNumberInstance(us), getZeroVector()); // test permille pattern DecimalFormat format = new DecimalFormat("###0.##\u2030"); @@ -183,15 +172,11 @@ public class Support_DecimalFormat extends Support_Format { format = new DecimalFormat("0000.0#E0"); t_Format(10, number, format, getNegativeExponentVector()); - if (Support_Locale.isLocaleAvailable(tr)) { - // test currency instance with TR Locale - t_Format(11, number, NumberFormat.getCurrencyInstance(tr), - getPositiveCurrencyVectorCH()); + // test currency instance with TR Locale + t_Format(11, number, NumberFormat.getCurrencyInstance(tr), getPositiveCurrencyVectorCH()); - // test negative currency instance with TR Locale - t_Format(12, negativeNumber, NumberFormat.getCurrencyInstance(tr), - getNegativeCurrencyVectorCH()); - } + // test negative currency instance with TR Locale + t_Format(12, negativeNumber, NumberFormat.getCurrencyInstance(tr), getNegativeCurrencyVectorCH()); } private static Vector<FieldContainer> getNumberVectorUS() { diff --git a/support/src/test/java/tests/support/Support_Locale.java b/support/src/test/java/tests/support/Support_Locale.java deleted file mode 100644 index 68f01c5..0000000 --- a/support/src/test/java/tests/support/Support_Locale.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package tests.support; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; -import java.util.Set; - -/** - * Helper class for tests that rely on locale data. - */ -public class Support_Locale { - public static boolean isLocaleAvailable(Locale requiredLocale) { - Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(Locale.getAvailableLocales())); - return localeSet.contains(requiredLocale); - } -} diff --git a/support/src/test/java/tests/support/Support_PortManager.java b/support/src/test/java/tests/support/Support_PortManager.java index 9d2fd86..b68a445 100644 --- a/support/src/test/java/tests/support/Support_PortManager.java +++ b/support/src/test/java/tests/support/Support_PortManager.java @@ -27,7 +27,7 @@ import java.util.TimeZone; * network port on the machine; however, it uses strange * logic, so leave it to the OS. * - * @deprecated Use OS to find free ports. + * @deprecated Use the OS to find free ports. */ public class Support_PortManager { |