5621N/A/*
5621N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
5621N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5621N/A *
5621N/A * This code is free software; you can redistribute it and/or modify it
5621N/A * under the terms of the GNU General Public License version 2 only, as
5621N/A * published by the Free Software Foundation.
5621N/A *
5621N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5621N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5621N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5621N/A * version 2 for more details (a copy is included in the LICENSE file that
5621N/A * accompanied this code).
5621N/A *
5621N/A * You should have received a copy of the GNU General Public License version
5621N/A * 2 along with this work; if not, write to the Free Software Foundation,
5621N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5621N/A *
5621N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5621N/A * or visit www.oracle.com if you need additional information or have any
5621N/A * questions.
5621N/A */
5621N/A
5621N/A/*
5621N/A * @test
5621N/A * @bug 8005277
5621N/A * @summary verify that Bidi.getRunLevel() returns a corect level.
5621N/A */
5621N/Aimport java.text.Bidi;
5621N/A
5621N/Apublic class Bug8005277 {
5621N/A
5621N/A public static void main(String[] args) {
5621N/A boolean err = false;
5621N/A String string = "\u05D0\u05D1\u05D2";
5621N/A Bidi bidi = new Bidi(string, Bidi.DIRECTION_LEFT_TO_RIGHT);
5621N/A
5621N/A int result = bidi.getRunCount();
5621N/A if (result != 1) {
5621N/A System.err.println("Incorrect run count: " + result);
5621N/A err = true;
5621N/A }
5621N/A
5621N/A result = bidi.getRunStart(0);
5621N/A if (result != 0) {
5621N/A System.err.println("Incorrect run start: " + result);
5621N/A err = true;
5621N/A }
5621N/A
5621N/A result = bidi.getRunLimit(0);
5621N/A if (result != 3) {
5621N/A System.err.println("Incorrect run limit: " + result);
5621N/A err = true;
5621N/A }
5621N/A
5621N/A result = bidi.getRunLevel(0);
5621N/A if (result != 1) {
5621N/A System.err.println("Incorrect run level: " + result);
5621N/A err = true;
5621N/A }
5621N/A
5621N/A if (err) {
5621N/A throw new RuntimeException("Failed.");
5621N/A }
5621N/A }
5621N/A
5621N/A}