langtools/test/jdk/jshell/T8146368/JShellToolTest8146368.java
author rfield
Mon, 11 Jan 2016 19:32:36 -0800
changeset 35000 952a7b4652f0
child 35359 f04501964016
permissions -rw-r--r--
8146368: JShell: couldn't smash the error when it's Japanese locale Reviewed-by: rfield Contributed-by: bitterfoxc@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35000
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     1
/*
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     4
 *
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     7
 * published by the Free Software Foundation.
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     8
 *
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    13
 * accompanied this code).
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    14
 *
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    18
 *
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    21
 * questions.
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    22
 */
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    23
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    24
/*
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    25
 * @test
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    26
 * @bug 8146368
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    27
 * @summary Test Smashing Error when user language is Japanese
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    28
 * @library /tools/lib /jdk/jshell
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    29
 * @build ReplToolTesting
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    30
 * @run testng/othervm -Duser.language=ja JShellToolTest8146368
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    31
 */
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    32
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    33
import org.testng.annotations.Test;
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    34
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    35
@Test
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    36
public class JShellToolTest8146368 extends ReplToolTesting {
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    37
    public void test() {
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    38
        test(
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    39
                a -> assertCommand(a, "class A extends B {}", "|  Added class A, however, it cannot be referenced until class B is declared\n"),
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    40
                a -> assertCommand(a, "und m() { return new und(); }", "|  Added method m(), however, it cannot be referenced until class und is declared\n")
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    41
        );
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    42
    }
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    43
}