test/script/basic/JDK-8134939.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1827
1bd585e65406
permissions
-rw-r--r--

Merge

attila@1539 1 /*
sundar@1827 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
attila@1539 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@1539 4 *
attila@1539 5 * This code is free software; you can redistribute it and/or modify it
attila@1539 6 * under the terms of the GNU General Public License version 2 only, as
attila@1539 7 * published by the Free Software Foundation.
attila@1539 8 *
attila@1539 9 * This code is distributed in the hope that it will be useful, but WITHOUT
attila@1539 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
attila@1539 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
attila@1539 12 * version 2 for more details (a copy is included in the LICENSE file that
attila@1539 13 * accompanied this code).
attila@1539 14 *
attila@1539 15 * You should have received a copy of the GNU General Public License version
attila@1539 16 * 2 along with this work; if not, write to the Free Software Foundation,
attila@1539 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@1539 18 *
attila@1539 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
attila@1539 20 * or visit www.oracle.com if you need additional information or have any
attila@1539 21 * questions.
attila@1539 22 */
attila@1539 23
attila@1539 24 /**
attila@1539 25 * JDK-8134939: Improve toString method of Dynalink OverloadedDynamicMethod
attila@1539 26 *
attila@1539 27 * @test
attila@1539 28 * @run
attila@1539 29 */
attila@1539 30
attila@1539 31 var overloadedSetter = new (Java.type("jdk.nashorn.test.models.OverloadedSetter"));
attila@1539 32
attila@1539 33 Assert.assertEquals(String(overloadedSetter.foo),
attila@1539 34 "[jdk.internal.dynalink.beans.OverloadedDynamicMethod\n" +
attila@1539 35 " String jdk.nashorn.test.models.OverloadedSetter.foo(String)\n" +
attila@1539 36 " void jdk.nashorn.test.models.OverloadedSetter.foo(int)\n" +
attila@1539 37 "]");
attila@1539 38
attila@1539 39 Assert.assertEquals(String(overloadedSetter.setColor),
attila@1539 40 "[jdk.internal.dynalink.beans.OverloadedDynamicMethod\n" +
attila@1539 41 " void jdk.nashorn.test.models.OverloadedSetter.setColor(int)\n" +
attila@1539 42 " void jdk.nashorn.test.models.OverloadedSetter.setColor(String)\n" +
attila@1539 43 "]");

mercurial