You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by lv...@apache.org on 2008/04/18 12:47:48 UTC
svn commit: r649456 - in
/harmony/enhanced/classlib/branches/java6/modules/text/src:
main/java/java/text/ main/java/org/apache/harmony/text/
test/java/org/apache/harmony/text/tests/java/text/ test/resources/provider/
test/resources/provider/correct/ te...
Author: lvjing
Date: Fri Apr 18 03:47:43 2008
New Revision: 649456
URL: http://svn.apache.org/viewvc?rev=649456&view=rev
Log:
Apply patch for HARMONY-5753, [java6][classlib][text] - implements getAvailableLocales(), getInstance() and getInstance(Locale) in DateFormatSymbols and DecimalFormatSymbols
Added:
harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java (with props)
harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java (with props)
harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java (with props)
harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java (with props)
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DateFormatSymbolsProvider
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DateFormatSymbolsProvider
harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
Modified:
harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java
harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java?rev=649456&r1=649455&r2=649456&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DateFormatSymbols.java Fri Apr 18 03:47:43 2008
@@ -18,10 +18,14 @@
package java.text;
import java.io.Serializable;
+import java.text.spi.DateFormatSymbolsProvider;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Locale;
+import java.util.Set;
-import org.apache.harmony.luni.util.NotImplementedException;
+import org.apache.harmony.text.LocaleServiceProviderLoader;
/**
* DateFormatSymbols holds the Strings used in the formating and parsing of
@@ -37,6 +41,12 @@
String[][] zoneStrings;
+ private static Set<Locale> buildinLocales;
+
+ private static HashMap<ClassLoader, Object> providersCache = new HashMap<ClassLoader, Object>();
+
+ private static final String PROVIDER_CONFIGURATION_FILE_NAME = "META-INF/services/java.text.spi.DateFormatSymbolsProvider"; //$NON-NLS-1$
+
/**
* Constructs a new DateFormatSymbols containing the symbols for the default
* Locale.
@@ -75,7 +85,33 @@
* @return array of locales
*/
public static Locale[] getAvailableLocales() {
- throw new NotImplementedException();
+ Locale[] icuLocales = com.ibm.icu.text.DateFormatSymbols
+ .getAvailableLocales();
+ if (buildinLocales == null) {
+ initBuildInLocales(icuLocales);
+ }
+
+ Locale[] providerLocales = LocaleServiceProviderLoader
+ .getProviderSupportLocales(providersCache,
+ PROVIDER_CONFIGURATION_FILE_NAME);
+
+ if (providerLocales == null) {
+ return icuLocales;
+ }
+
+ Locale[] locales = new Locale[icuLocales.length
+ + providerLocales.length];
+ System.arraycopy(icuLocales, 0, locales, 0, icuLocales.length);
+ System.arraycopy(providerLocales, 0, locales, icuLocales.length,
+ providerLocales.length);
+ return locales;
+ }
+
+ private static synchronized void initBuildInLocales(Locale[] icuLocales) {
+ buildinLocales = new HashSet<Locale>(icuLocales.length);
+ for (Locale locale : icuLocales) {
+ buildinLocales.add(locale);
+ }
}
/**
@@ -86,13 +122,13 @@
* @since 1.6
*/
public static final DateFormatSymbols getInstance() {
- throw new NotImplementedException();
+ return new DateFormatSymbols();
}
/**
- * Return the DateFormatSymbols for the specified locale. This method
- * return DateFormatSymbols instances for locales supported by the Java
- * runtime and installed DateFormatSymbols implementations.
+ * Return the DateFormatSymbols for the specified locale. This method return
+ * DateFormatSymbols instances for locales supported by the Java runtime and
+ * installed DateFormatSymbols implementations.
*
* @param locale
* locale for the returned DateFormatSymbols instance
@@ -105,7 +141,30 @@
* @since 1.6
*/
public static final DateFormatSymbols getInstance(Locale locale) {
- throw new NotImplementedException();
+ if (null == locale) {
+ throw new NullPointerException();
+ }
+
+ if (buildinLocales == null) {
+ initBuildInLocales(com.ibm.icu.text.DateFormatSymbols
+ .getAvailableLocales());
+ }
+
+ if (buildinLocales.contains(locale)) {
+ return new DateFormatSymbols(locale);
+ }
+
+ DateFormatSymbolsProvider provider = (DateFormatSymbolsProvider) LocaleServiceProviderLoader
+ .getProviderByLocale(providersCache, locale,
+ PROVIDER_CONFIGURATION_FILE_NAME);
+
+ if (provider != null) {
+ return provider.getInstance(locale);
+ }
+
+ // return DateFormatSymbols using default locale
+ return new DateFormatSymbols();
+
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java?rev=649456&r1=649455&r2=649456&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/DecimalFormatSymbols.java Fri Apr 18 03:47:43 2008
@@ -22,20 +22,31 @@
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.Serializable;
+import java.text.spi.DecimalFormatSymbolsProvider;
import java.util.Arrays;
import java.util.Currency;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Locale;
+import java.util.Set;
import org.apache.harmony.luni.util.NotImplementedException;
+import org.apache.harmony.text.LocaleServiceProviderLoader;
/**
* DecimalFormatSymbols holds the symbols used in the formating and parsing of
* numbers.
*/
-public final class DecimalFormatSymbols implements Cloneable, Serializable {
+public class DecimalFormatSymbols implements Cloneable, Serializable {
private static final long serialVersionUID = 5772796243397350300L;
+ private static Set<Locale> buildinLocales;
+
+ private static final String PROVIDER_CONFIGURATION_FILE_NAME = "META-INF/services/java.text.spi.DecimalFormatSymbolsProvider"; //$NON-NLS-1$
+
+ private static HashMap<ClassLoader, Object> providersCache = new HashMap<ClassLoader, Object>();
+
private final int ZeroDigit = 0, Digit = 1, DecimalSeparator = 2,
GroupingSeparator = 3, PatternSeparator = 4, Percent = 5,
PerMill = 6, Exponent = 7, MonetaryDecimalSeparator = 8,
@@ -101,7 +112,33 @@
* @return array of locales
*/
public static Locale[] getAvailableLocales() {
- throw new NotImplementedException();
+ Locale[] icuLocales = com.ibm.icu.text.DecimalFormatSymbols
+ .getAvailableLocales();
+ if (buildinLocales == null) {
+ initBuildInLocales(icuLocales);
+ }
+
+ Locale[] providerLocales = LocaleServiceProviderLoader
+ .getProviderSupportLocales(providersCache,
+ PROVIDER_CONFIGURATION_FILE_NAME);
+
+ if (providerLocales == null) {
+ return icuLocales;
+ }
+
+ Locale[] locales = new Locale[icuLocales.length
+ + providerLocales.length];
+ System.arraycopy(icuLocales, 0, locales, 0, icuLocales.length);
+ System.arraycopy(providerLocales, 0, locales, icuLocales.length,
+ providerLocales.length);
+ return locales;
+ }
+
+ private static synchronized void initBuildInLocales(Locale[] icuLocales) {
+ buildinLocales = new HashSet<Locale>(icuLocales.length);
+ for (Locale locale : icuLocales) {
+ buildinLocales.add(locale);
+ }
}
/**
@@ -112,7 +149,7 @@
* @since 1.6
*/
public static final DecimalFormatSymbols getInstance() {
- throw new NotImplementedException();
+ return new DecimalFormatSymbols();
}
/**
@@ -131,7 +168,28 @@
* @since 1.6
*/
public static final DecimalFormatSymbols getInstance(Locale locale) {
- throw new NotImplementedException();
+ if (null == locale) {
+ throw new NullPointerException();
+ }
+
+ if (buildinLocales == null) {
+ initBuildInLocales(com.ibm.icu.text.DecimalFormatSymbols
+ .getAvailableLocales());
+ }
+
+ if (buildinLocales.contains(locale)) {
+ return new DecimalFormatSymbols(locale);
+ }
+
+ DecimalFormatSymbolsProvider provider = (DecimalFormatSymbolsProvider) LocaleServiceProviderLoader
+ .getProviderByLocale(providersCache, locale,
+ PROVIDER_CONFIGURATION_FILE_NAME);
+
+ if (provider != null) {
+ return provider.getInstance(locale);
+ }
+ // return DecimalFormatSymbols using default locale
+ return new DecimalFormatSymbols();
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java?rev=649456&r1=649455&r2=649456&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/java/text/SimpleDateFormat.java Fri Apr 18 03:47:43 2008
@@ -450,7 +450,6 @@
int beginPosition = buffer.length();
Field dateFormatField = null;
-System.out.println("index:"+index);
switch (index) {
case ERA_FIELD:
dateFormatField = Field.ERA;
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java Fri Apr 18 03:47:43 2008
@@ -0,0 +1,258 @@
+/*
+ * 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 org.apache.harmony.text;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.ServiceConfigurationError;
+import java.util.Set;
+import java.util.spi.LocaleServiceProvider;
+
+/**
+ * This class is the helper to service provider for
+ * <code>DateFormatSymbolsProvider</code> and
+ * <code>DecimalFormatSymbolsProvider</code>.
+ *
+ */
+public class LocaleServiceProviderLoader {
+ /**
+ * The comment string used in configuration files
+ */
+ public static final String PROVIDER_CONFIGURATION_FILE_COMMENT = "#"; //$NON-NLS-1$
+
+ private static ClassLoader systemClassLoader;
+
+ /**
+ * Get provider that support specified locale. If there is no provider
+ * found, return <code>null</code>.
+ *
+ * @param cache
+ * cached providers
+ * @param locale
+ * the specified locale
+ * @param providerFileName
+ * provider configuration file name
+ * @return <code>LocaleServiceProvider</code> that support the locale
+ */
+ public static LocaleServiceProvider getProviderByLocale(
+ HashMap<ClassLoader, Object> cache, Locale locale,
+ String providerFileName) {
+ HashMap<LocaleServiceProvider, Set<Locale>> providers = getProviders(
+ cache, providerFileName);
+ // no provider installed
+ if (providers == null || providers.size() == 0) {
+ return null;
+ }
+
+ // find provider
+ for (LocaleServiceProvider provider : providers.keySet()) {
+ if (providers.get(provider).contains(locale)) {
+ return provider;
+ }
+ }
+
+ // no provider found
+ return null;
+ }
+
+ /**
+ * Return all locales supported by the installed providers. If no provider
+ * installed return <code>null</code>.
+ *
+ * @param cache
+ * cached providers
+ * @param providerFileName
+ * provider configuration file name
+ * @return all locales supported by the installed providers
+ */
+ public static Locale[] getProviderSupportLocales(
+ HashMap<ClassLoader, Object> cache, String providerFileName) {
+
+ HashMap<LocaleServiceProvider, Set<Locale>> providers = getProviders(
+ cache, providerFileName);
+
+ if (providers == null || providers.size() == 0) {
+ return null;
+ }
+
+ List<Locale> locales = new ArrayList<Locale>();
+ for (Set<Locale> element : providers.values()) {
+ locales.addAll(element);
+ }
+
+ return locales.toArray(new Locale[0]);
+ }
+
+ /**
+ * Load all installed providers.
+ *
+ * @param cache
+ * cached providers
+ * @param providerFileName
+ * provider configuration file name
+ * @return all installed providers and locales supported by them
+ */
+ private static synchronized HashMap<LocaleServiceProvider, Set<Locale>> getProviders(
+ HashMap<ClassLoader, Object> cache, String providerFileName) {
+ ClassLoader classLoader = getClassLoader();
+
+ HashMap<LocaleServiceProvider, Set<Locale>> providers = null;
+ if (cache.containsKey(classLoader)) {
+ providers = (HashMap<LocaleServiceProvider, Set<Locale>>) cache
+ .get(classLoader);
+ } else {
+ Enumeration<URL> e = null;
+ try {
+ e = classLoader.getResources(providerFileName);
+ } catch (IOException ex) {
+ // Unexpected ClassLoader exception, ignore
+ return null;
+ }
+
+ // Examine each configuration file
+ providers = new HashMap<LocaleServiceProvider, Set<Locale>>();
+ while (e.hasMoreElements()) {
+ loadProviderLocales(e.nextElement(), classLoader, providers);
+ }
+ cache.put(classLoader, providers);
+ }
+ return providers;
+ }
+
+ private static ClassLoader getClassLoader() {
+ ClassLoader classLoader = getContextClassLoader();
+ if (null == classLoader) {
+ classLoader = getSystemClassLoader();
+ }
+ return classLoader;
+ }
+
+ /*
+ * Use privileged code to get the context class loader.
+ */
+ private static ClassLoader getContextClassLoader() {
+ final Thread t = Thread.currentThread();
+ return AccessController
+ .doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return t.getContextClassLoader();
+ }
+ });
+ }
+
+ /*
+ * Use privileged code to get the system class loader.
+ */
+ private static ClassLoader getSystemClassLoader() {
+ if (null == systemClassLoader) {
+ systemClassLoader = AccessController
+ .doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return ClassLoader.getSystemClassLoader();
+ }
+ });
+ }
+ return systemClassLoader;
+ }
+
+ /**
+ * Load providers from configuration file.
+ *
+ * @param configFile
+ * <code>URL</code> of provider configuration file
+ * @param classLoader
+ * <code>ClassLoader</code> used for load configuration file
+ * @param providers
+ * has loaded providers by the same class loader
+ */
+ private static void loadProviderLocales(URL configFile,
+ ClassLoader classLoader,
+ HashMap<LocaleServiceProvider, Set<Locale>> providers) {
+ BufferedReader reader = null;
+ try {
+ InputStream is = configFile.openStream();
+ // Read each line for DateFormatSymbols provider class names
+ reader = new BufferedReader(new InputStreamReader(is));
+ String providerClassName = reader.readLine();
+ while (null != providerClassName) {
+ providerClassName = trimClassName(providerClassName);
+ // Skip comments and blank lines
+ if (providerClassName.length() > 0) {
+ // Load the provider
+ Object cp = null;
+ try {
+ Class<?> c = Class.forName(providerClassName, true,
+ classLoader);
+ cp = c.newInstance();
+ } catch (Exception ex) {
+ throw new ServiceConfigurationError(ex.getMessage(), ex);
+ }
+
+ // Put the locales supported by this provider into the map
+ LocaleServiceProvider provider = (LocaleServiceProvider) cp;
+ Locale[] locales = provider.getAvailableLocales();
+ if (locales != null && locales.length > 0) {
+ HashSet<Locale> localesSet = new HashSet<Locale>();
+ for (Locale locale : locales) {
+ if (!localesSet.contains(locale)) {
+ localesSet.add(locale);
+ }
+ }
+ providers.put(provider, localesSet);
+ }
+ }
+ // Read the next line of the config file
+ providerClassName = reader.readLine();
+ }
+ } catch (IOException ex) {
+ // Can't read this configuration file, ignore
+ } finally {
+ try {
+ if (null != reader) {
+ reader.close();
+ }
+ } catch (IOException ex) {
+ // Ignore closing exception
+ }
+ }
+ }
+
+ /*
+ * Trim comment string, and then trim white spaces.
+ */
+ private static String trimClassName(String name) {
+ String trimedName = name;
+ int index = name.indexOf(PROVIDER_CONFIGURATION_FILE_COMMENT);
+ // Trim comments
+ if (index != -1) {
+ trimedName = name.substring(0, index);
+ }
+ return trimedName.trim();
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/main/java/org/apache/harmony/text/LocaleServiceProviderLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java?rev=649456&r1=649455&r2=649456&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DateFormatSymbolsTest.java Fri Apr 18 03:47:43 2008
@@ -16,9 +16,14 @@
*/
package org.apache.harmony.text.tests.java.text;
+import java.io.File;
+import java.net.URL;
import java.text.DateFormatSymbols;
import java.util.Arrays;
import java.util.Locale;
+import java.util.ServiceConfigurationError;
+
+import org.apache.harmony.text.tests.java.text.MockedDateFormatSymbolsProvider.MockedDateFormatSymbols;
public class DateFormatSymbolsTest extends junit.framework.TestCase {
@@ -39,6 +44,171 @@
public void test_ConstructorLjava_util_Locale() {
// Test for method java.text.DateFormatSymbols(java.util.Locale)
new DateFormatSymbols(new Locale("en", "us"));
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_no_provider() throws Exception {
+ Locale[] locales = DateFormatSymbols.getAvailableLocales();
+ assertNotNull(locales);
+ // must contain Locale.US
+ boolean flag = false;
+ for (Locale locale : locales) {
+ if (locale.equals(Locale.US)) {
+ flag = true;
+ break;
+ }
+ }
+ assertTrue(flag);
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_correct_provider() throws Exception {
+ URL path = new File("src/test/resources/provider/correct").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ Locale[] locales = DateFormatSymbols.getAvailableLocales();
+ assertNotNull(locales);
+ // must contain mock Locale
+ boolean flag = false;
+ for (Locale locale : locales) {
+ if (locale.getLanguage().equals("mock")) {
+ flag = true;
+ break;
+ }
+ }
+ assertTrue(flag);
+ }
+
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_wrong_provider() throws Exception {
+ URL path = new File("src/test/resources/provider/wrong").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ try {
+ DateFormatSymbols.getAvailableLocales();
+ fail("Should throw ServiceConfigurationError");
+ } catch (ServiceConfigurationError e) {
+ // expected
+ }
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getInstance()
+ */
+ public void test_getInstance() {
+ DateFormatSymbols.getInstance();
+ assertEquals(new DateFormatSymbols(), DateFormatSymbols.getInstance());
+ assertEquals(new DateFormatSymbols(Locale.getDefault()),
+ DateFormatSymbols.getInstance());
+
+ assertNotSame(DateFormatSymbols.getInstance(), DateFormatSymbols.getInstance());
+ }
+
+ public void test_getInstanceLjava_util_Locale() {
+ try {
+ DateFormatSymbols.getInstance(null);
+ fail("Should throw NullPointerException");
+ } catch (NullPointerException e) {
+ // expected
+ }
+
+ assertEquals(new DateFormatSymbols(Locale.GERMANY), DateFormatSymbols
+ .getInstance(Locale.GERMANY));
+
+ Locale locale = new Locale("not exist language", "not exist country");
+ DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
+ assertNotNull(symbols);
+ assertEquals(DateFormatSymbols.getInstance(), symbols);
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_no_provider() {
+ try {
+ DateFormatSymbols.getInstance(null);
+ fail("Should throw NullPointerException");
+ } catch (NullPointerException e) {
+ // expected
+ }
+
+ assertEquals(new DateFormatSymbols(Locale.GERMANY), DateFormatSymbols
+ .getInstance(Locale.GERMANY));
+
+ Locale locale = new Locale("not exist language", "not exist country");
+ DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
+ assertNotNull(symbols);
+ assertEquals(DateFormatSymbols.getInstance(), symbols);
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_correct_provider()
+ throws Exception {
+ URL path = new File("src/test/resources/provider/correct").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ DateFormatSymbols symbols = DateFormatSymbols
+ .getInstance(new Locale("Mock"));
+ assertTrue(symbols instanceof MockedDateFormatSymbols);
+
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DateFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_wrong_provider()
+ throws Exception {
+ URL path = new File("src/test/resources/provider/wrong").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ try {
+ DateFormatSymbols symbols = DateFormatSymbols
+ .getInstance(new Locale("Mock"));
+ fail("Should throw ServiceConfigurationError");
+ } catch (ServiceConfigurationError e) {
+ // expected
+ }
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
}
/**
Modified: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java?rev=649456&r1=649455&r2=649456&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/DecimalFormatSymbolsTest.java Fri Apr 18 03:47:43 2008
@@ -19,16 +19,21 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Currency;
import java.util.Locale;
+import java.util.ServiceConfigurationError;
import junit.framework.TestCase;
+import org.apache.harmony.text.tests.java.text.MockedDecimalFormatSymbolsProvider.MockedDecimalFormatSymbols;
+
public class DecimalFormatSymbolsTest extends TestCase {
DecimalFormatSymbols dfs;
@@ -52,6 +57,174 @@
assertEquals("Returned incorrect symbols", '%', dfs.getPercent());
}
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_no_provider() throws Exception {
+ Locale[] locales = DecimalFormatSymbols.getAvailableLocales();
+ assertNotNull(locales);
+ // must contain Locale.US
+ boolean flag = false;
+ for (Locale locale : locales) {
+ if (locale.equals(Locale.US)) {
+ flag = true;
+ break;
+ }
+ }
+ assertTrue(flag);
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_correct_provider() throws Exception {
+ URL path = new File("src/test/resources/provider/correct").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ Locale[] locales = DecimalFormatSymbols.getAvailableLocales();
+ assertNotNull(locales);
+ // must contain mock Locale
+ boolean flag = false;
+ for (Locale locale : locales) {
+ if (locale.getLanguage().equals("mock")) {
+ flag = true;
+ break;
+ }
+ }
+ assertTrue(flag);
+ }
+
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getAvailableLocales()
+ */
+ public void test_getAvailableLocales_wrong_provider() throws Exception {
+ URL path = new File("src/test/resources/provider/wrong").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ try {
+ DecimalFormatSymbols.getAvailableLocales();
+ fail("Should throw ServiceConfigurationError");
+ } catch (ServiceConfigurationError e) {
+ // expected
+ }
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getInstance()
+ */
+ public void test_getInstance() {
+ assertEquals(new DecimalFormatSymbols(), DecimalFormatSymbols.getInstance());
+ assertEquals(new DecimalFormatSymbols(Locale.getDefault()),
+ DecimalFormatSymbols.getInstance());
+
+ assertNotSame(DecimalFormatSymbols.getInstance(), DecimalFormatSymbols.getInstance());
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale() {
+ try {
+ DecimalFormatSymbols.getInstance(null);
+ fail("Should throw NullPointerException");
+ } catch (NullPointerException e) {
+ // expected
+ }
+
+ assertEquals(new DecimalFormatSymbols(Locale.GERMANY), DecimalFormatSymbols
+ .getInstance(Locale.GERMANY));
+
+ Locale locale = new Locale("not exist language", "not exist country");
+ DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale);
+ assertNotNull(symbols);
+ assertEquals(DecimalFormatSymbols.getInstance(), symbols);
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_no_provider() {
+ try {
+ DecimalFormatSymbols.getInstance(null);
+ fail("Should throw NullPointerException");
+ } catch (NullPointerException e) {
+ // expected
+ }
+
+ assertEquals(new DecimalFormatSymbols(Locale.GERMANY), DecimalFormatSymbols
+ .getInstance(Locale.GERMANY));
+
+ Locale locale = new Locale("not exist language", "not exist country");
+ DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale);
+ assertNotNull(symbols);
+ assertEquals(DecimalFormatSymbols.getInstance(), symbols);
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_correct_provider()
+ throws Exception {
+ URL path = new File("src/test/resources/provider/correct").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ DecimalFormatSymbols symbols = DecimalFormatSymbols
+ .getInstance(new Locale("Mock"));
+ assertTrue(symbols instanceof MockedDecimalFormatSymbols);
+
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
+ /**
+ * @tests java.text.DecimalFormatSymbols#getInstance(Locale)
+ */
+ public void test_getInstanceLjava_util_Locale_wrong_provider()
+ throws Exception {
+ URL path = new File("src/test/resources/provider/wrong").toURL();
+ LoadLocaleProviderTestHelper helper = new LoadLocaleProviderTestHelper(
+ new URL[] { path }) {
+ @Override
+ public void test() {
+ try {
+ DecimalFormatSymbols symbols = DecimalFormatSymbols
+ .getInstance(new Locale("Mock"));
+ fail("Should throw ServiceConfigurationError");
+ } catch (ServiceConfigurationError e) {
+ // expected
+ }
+ }
+ };
+
+ if (helper.getThrowable() != null) {
+ throw new Exception(helper.getThrowable());
+ }
+ }
+
/**
* @tests java.text.DecimalFormatSymbols#equals(java.lang.Object)
*/
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java Fri Apr 18 03:47:43 2008
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.harmony.text.tests.java.text;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+public abstract class LoadLocaleProviderTestHelper implements Runnable {
+ private Throwable throwable;
+
+ public LoadLocaleProviderTestHelper(URL[] classpathes)
+ throws InterruptedException {
+ URLClassLoader loader = new URLClassLoader(classpathes);
+ Thread thread = new Thread(this);
+ thread.setContextClassLoader(loader);
+ thread.start();
+ thread.join();
+ }
+
+ public Throwable getThrowable() {
+ return throwable;
+ }
+
+ public void run() {
+ try {
+ test();
+ } catch (Throwable t) {
+ throwable = t;
+ }
+ }
+
+ public abstract void test();
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/LoadLocaleProviderTestHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java Fri Apr 18 03:47:43 2008
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.harmony.text.tests.java.text;
+
+import java.text.DateFormatSymbols;
+import java.text.spi.DateFormatSymbolsProvider;
+import java.util.Locale;
+
+public class MockedDateFormatSymbolsProvider extends DateFormatSymbolsProvider {
+ private static Locale supportLocale = new Locale("mock");
+
+ @Override
+ public DateFormatSymbols getInstance(Locale locale) {
+ if (locale == null) {
+ throw new NullPointerException();
+ }
+ if (!locale.equals(supportLocale)) {
+ throw new IllegalArgumentException();
+ }
+
+ return new MockedDateFormatSymbols();
+ }
+
+ @Override
+ public Locale[] getAvailableLocales() {
+ return new Locale[] { supportLocale };
+ }
+
+ public static class MockedDateFormatSymbols extends DateFormatSymbols {
+
+ }
+}
+
Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDateFormatSymbolsProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java Fri Apr 18 03:47:43 2008
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.harmony.text.tests.java.text;
+
+import java.text.DecimalFormatSymbols;
+import java.text.spi.DecimalFormatSymbolsProvider;
+import java.util.Locale;
+
+public class MockedDecimalFormatSymbolsProvider extends
+ DecimalFormatSymbolsProvider {
+ private static Locale supportLocale = new Locale("mock");
+
+ @Override
+ public DecimalFormatSymbols getInstance(Locale locale) {
+ if (locale == null) {
+ throw new NullPointerException();
+ }
+ if (!locale.equals(supportLocale)) {
+ throw new IllegalArgumentException();
+ }
+
+ return new MockedDecimalFormatSymbols();
+ }
+
+ @Override
+ public Locale[] getAvailableLocales() {
+ return new Locale[] { supportLocale };
+ }
+
+ public static class MockedDecimalFormatSymbols extends DecimalFormatSymbols {
+
+ }
+}
Propchange: harmony/enhanced/classlib/branches/java6/modules/text/src/test/java/org/apache/harmony/text/tests/java/text/MockedDecimalFormatSymbolsProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DateFormatSymbolsProvider
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DateFormatSymbolsProvider?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DateFormatSymbolsProvider (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DateFormatSymbolsProvider Fri Apr 18 03:47:43 2008
@@ -0,0 +1,21 @@
+# 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.
+#
+
+# a.b.c
+
+ org.apache.harmony.text.tests.java.text.MockedDateFormatSymbolsProvider #this is correct provider
+
+# this is comment
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/correct/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider Fri Apr 18 03:47:43 2008
@@ -0,0 +1,21 @@
+# 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.
+#
+
+# a.b.c
+
+ org.apache.harmony.text.tests.java.text.MockedDecimalFormatSymbolsProvider #this is correct provider
+
+# this is comment
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DateFormatSymbolsProvider
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DateFormatSymbolsProvider?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DateFormatSymbolsProvider (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DateFormatSymbolsProvider Fri Apr 18 03:47:43 2008
@@ -0,0 +1,16 @@
+# 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.
+#
+ a.b.c # not exist provider
Added: harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider?rev=649456&view=auto
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider (added)
+++ harmony/enhanced/classlib/branches/java6/modules/text/src/test/resources/provider/wrong/META-INF/services/java.text.spi.DecimalFormatSymbolsProvider Fri Apr 18 03:47:43 2008
@@ -0,0 +1,16 @@
+# 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.
+#
+ a.b.c # not exist provider