langtools/test/jdk/jshell/T8146368/JShellToolTest8146368.java
author rfield
Tue, 12 Apr 2016 22:23:11 -0700
changeset 37389 9c137b83a8b8
parent 36526 3b41f1c69604
permissions -rw-r--r--
8143955: JShell tool (UX): Output structure 8143956: JShell tool (UX): default prompts Reviewed-by: jlahoda
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
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35359
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
35000
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
35359
f04501964016 8148147: Sync up @modules from jigsaw/jake
alanb
parents: 35000
diff changeset
    28
 * @modules jdk.jshell/jdk.internal.jshell.tool
35000
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    29
 * @library /tools/lib /jdk/jshell
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    30
 * @build ReplToolTesting
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    31
 * @run testng/othervm -Duser.language=ja JShellToolTest8146368
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
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    34
import org.testng.annotations.Test;
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    35
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    36
@Test
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    37
public class JShellToolTest8146368 extends ReplToolTesting {
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    38
    public void test() {
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    39
        test(
37389
9c137b83a8b8 8143955: JShell tool (UX): Output structure
rfield
parents: 36526
diff changeset
    40
                a -> assertCommand(a, "class A extends B {}", "|  created class A, however, it cannot be referenced until class B is declared\n"),
9c137b83a8b8 8143955: JShell tool (UX): Output structure
rfield
parents: 36526
diff changeset
    41
                a -> assertCommand(a, "und m() { return new und(); }", "|  created method m(), however, it cannot be referenced until class und is declared\n")
35000
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
    }
952a7b4652f0 8146368: JShell: couldn't smash the error when it's Japanese locale
rfield
parents:
diff changeset
    44
}