jdk/test/java/text/Format/NumberFormat/Bug8132125.java
author amlu
Fri, 18 Nov 2016 14:39:03 +0800
changeset 42166 5582c83b1156
parent 40679 5378433ac23f
permissions -rw-r--r--
8169836: ProblemList update for java/lang/management/MemoryMXBean/PendingAllGC.sh Reviewed-by: mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32015
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     1
/*
40679
5378433ac23f 8164859: Fix module dependences in java/text tests
shurailine
parents: 32015
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
32015
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     4
 *
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     7
 * published by the Free Software Foundation.
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     8
 *
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    13
 * accompanied this code).
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    14
 *
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    18
 *
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    21
 * questions.
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    22
 */
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    23
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    24
/*
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    25
 * @test
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    26
 * @bug 8132125
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    27
 * @summary Checks Swiss' number elements
40679
5378433ac23f 8164859: Fix module dependences in java/text tests
shurailine
parents: 32015
diff changeset
    28
 * @modules jdk.localedata
32015
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    29
 */
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    30
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    31
import java.text.*;
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    32
import java.util.*;
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    33
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    34
public class Bug8132125 {
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    35
    public static void main(String[] args) {
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    36
        Locale deCH = new Locale("de", "CH");
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    37
        NumberFormat nf = NumberFormat.getInstance(deCH);
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    38
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    39
        String expected = "54'839'483.142"; // i.e. "." as decimal separator, "'" as grouping separator
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    40
        String actual = nf.format(54839483.1415);
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    41
        if (!actual.equals(expected)) {
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    42
            throw new RuntimeException("correct for de_CH: " + expected + " vs. actual " + actual);
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    43
        }
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    44
    }
eda394dcd1aa 8129881: JDK-8008577 breaks Nashorn test
naoto
parents:
diff changeset
    45
}