summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-03-30 18:12:47 -0700
committerElliott Hughes <enh@google.com>2011-03-30 18:12:47 -0700
commitf049593e9a5160492a0dafb19e5595dac138505e (patch)
tree965d30b5acf20f360b3457013ef038fec57a90a4 /support
parent9acbfdd446646c2dcb30a77c94642aec7357deec (diff)
downloadlibcore-f049593e9a5160492a0dafb19e5595dac138505e.zip
libcore-f049593e9a5160492a0dafb19e5595dac138505e.tar.gz
libcore-f049593e9a5160492a0dafb19e5595dac138505e.tar.bz2
Remove a broken API that encouraged people to make the wrong fix to tests.
Not having Arabic locale data is not a reason to skip German tests. Change-Id: I5062d2a0343e8e040f5766532433ade37569b0c5
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/tests/support/Support_DecimalFormat.java4
-rw-r--r--support/src/test/java/tests/support/Support_Locale.java25
2 files changed, 7 insertions, 22 deletions
diff --git a/support/src/test/java/tests/support/Support_DecimalFormat.java b/support/src/test/java/tests/support/Support_DecimalFormat.java
index 55bea1e..9baa4cc 100644
--- a/support/src/test/java/tests/support/Support_DecimalFormat.java
+++ b/support/src/test/java/tests/support/Support_DecimalFormat.java
@@ -139,7 +139,7 @@ public class Support_DecimalFormat extends Support_Format {
Locale us = Locale.US;
Locale tr = new Locale("de", "CH");
- if (Support_Locale.areLocalesAvailable(us)) {
+ if (Support_Locale.isLocaleAvailable(us)) {
// locale dependent test, bug 1943269
// test number instance
@@ -183,7 +183,7 @@ public class Support_DecimalFormat extends Support_Format {
format = new DecimalFormat("0000.0#E0");
t_Format(10, number, format, getNegativeExponentVector());
- if (Support_Locale.areLocalesAvailable(tr)) {
+ if (Support_Locale.isLocaleAvailable(tr)) {
// test currency instance with TR Locale
t_Format(11, number, NumberFormat.getCurrencyInstance(tr),
getPositiveCurrencyVectorCH());
diff --git a/support/src/test/java/tests/support/Support_Locale.java b/support/src/test/java/tests/support/Support_Locale.java
index 92426e3..68f01c5 100644
--- a/support/src/test/java/tests/support/Support_Locale.java
+++ b/support/src/test/java/tests/support/Support_Locale.java
@@ -22,27 +22,12 @@ import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
-
/**
- * Helper class for {@link Locale} tests
+ * Helper class for tests that rely on locale data.
*/
public class Support_Locale {
-
- /**
- * Helper method to determine if given locales are available.
- *
- * @param requiredLocales - the set of {@link Locale} to check
- *
- * @return true if all requiredLocales are available.
- */
- public static boolean areLocalesAvailable(Locale... requiredLocales) {
- Locale[] availableLocales = Locale.getAvailableLocales();
- Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(availableLocales));
- for (Locale requiredLocale : requiredLocales) {
- if (!localeSet.contains(requiredLocale)) {
- return false;
- }
- }
- return true;
+ public static boolean isLocaleAvailable(Locale requiredLocale) {
+ Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(Locale.getAvailableLocales()));
+ return localeSet.contains(requiredLocale);
}
-} \ No newline at end of file
+}