1914N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1914N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1914N/A *
1914N/A * This code is free software; you can redistribute it and/or modify it
1914N/A * under the terms of the GNU General Public License version 2 only, as
1914N/A * published by the Free Software Foundation.
1914N/A *
1914N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1914N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1914N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1914N/A * version 2 for more details (a copy is included in the LICENSE file that
1914N/A * accompanied this code).
1914N/A *
1914N/A * You should have received a copy of the GNU General Public License version
1914N/A * 2 along with this work; if not, write to the Free Software Foundation,
1914N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1914N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1914N/A */
1914N/A
1914N/A/*
1914N/A * @test
1914N/A * @bug 6842557
1914N/A * @summary confirm that an instance which is created with new Enum ranges is
1914N/A * equivalent to another instance which is created with equivalent traditional
1914N/A * ranges or the same Enum ranges.
1914N/A */
1914N/A
1914N/Aimport java.awt.font.NumericShaper;
1914N/Aimport java.util.EnumSet;
1914N/Aimport static java.awt.font.NumericShaper.*;
1914N/A
1914N/Apublic class EqualsTest {
1914N/A public static void main(String[] args) {
1914N/A NumericShaper ns1 = getContextualShaper(ARABIC | TAMIL, TAMIL);
1914N/A NumericShaper ns2 = getContextualShaper(
1914N/A EnumSet.of(Range.ARABIC, Range.TAMIL),
1914N/A Range.TAMIL);
1914N/A NumericShaper ns3 = getContextualShaper(
1914N/A EnumSet.of(Range.ARABIC, Range.TAMIL),
1914N/A Range.TAMIL);
1914N/A NumericShaper ns4 = getContextualShaper(
1914N/A EnumSet.of(Range.ARABIC, Range.TAMIL),
1914N/A Range.ARABIC);
1914N/A
1914N/A if (!ns1.equals(ns2)) {
1914N/A throw new RuntimeException("ns1 != ns2: ns1=" + ns1 + ", ns2=" + ns2);
1914N/A }
1914N/A if (!ns2.equals(ns1)) {
1914N/A throw new RuntimeException("ns2 != ns1: ns1=" + ns1 + ", ns2=" + ns2);
1914N/A }
1914N/A if (!ns2.equals(ns3)) {
1914N/A throw new RuntimeException("ns2 != ns3: ns2=" + ns2 + ", ns3=" + ns3);
1914N/A }
1914N/A if (ns1.equals(ns4)) {
1914N/A throw new RuntimeException("ns1 == ns4: ns1=" + ns1 + ", ns4=" + ns4);
1914N/A }
1914N/A if (ns2.equals(ns4)) {
1914N/A throw new RuntimeException("ns2 == ns4: ns2=" + ns2 + ", ns4=" + ns4);
1914N/A }
1914N/A }
1914N/A}