LocaleTest.java revision 89c1feb0a69a7707b271086e749975b3f7acacf7
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements.  See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License.  You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.apache.harmony.luni.tests.java.util;
18
19import dalvik.annotation.TestInfo;
20import dalvik.annotation.TestLevel;
21import dalvik.annotation.TestTarget;
22import dalvik.annotation.TestTargetClass;
23
24import junit.framework.TestCase;
25
26import java.util.Locale;
27
28@TestTargetClass(Locale.class)
29public class LocaleTest extends TestCase {
30
31    /**
32     * @tests java.util.Locale#getAvailableLocales()
33     */
34    @TestInfo(
35      level = TestLevel.COMPLETE,
36      purpose = "",
37      targets = {
38        @TestTarget(
39          methodName = "getAvailableLocales",
40          methodArgs = {}
41        )
42    })
43    public void test_getAvailableLocales() {
44        Locale[] locales = Locale.getAvailableLocales();
45        // Assumes that there will be a decent number of locales
46        // BEGIN android-changed
47        // this assumption is wrong. Android has a reduced locale repository.
48        // was >100, now it's >10
49        assertTrue("Assert 0: Cannot find locales", locales.length > 10);
50        // END android-changed
51    }
52}
53