[rfc][icedtea-web] a new reproducer LiveConnect "overloaded function resolution" tests

Jana Fabrikova jfabriko at redhat.com
Wed Feb 13 09:42:50 PST 2013


Hi Adam and Jiri,

I have modified the JSToJFuncResol in three things:

- using the decodeURIComponent in JS
- comments and different order of the methods and testcases (seems more 
readable to me now)
- adding two new tests:
    * resolving 1.1 -> double or char (the test fails)
    * resolving an instance of OverlaodTestHelper2 -> its parent OTH1 or
      its successor OTH3 (worked fine for me, but maybe different
      results show if the tests are iterated many times)

The new patch is attached to this mail,

I think the calling of java functions with "false" as a boolean/Boolean 
parameter (which should be understood by java as true) can be added into 
the JSToJFuncParam reproducer as new testcases (the second patch),

thank you for any comments,

Jana

On 02/07/2013 06:41 PM, Adam Domurad wrote:
> On 01/23/2013 08:56 AM, Jana Fabrikova wrote:
>> Hello,
>>
>> I have rewritten also the JSToJFuncResol reproducer with respect to
>> Adam's comments, thank you for any comments on the attached patch,
>>
>> Jana
>>
>>
>> 2013-01-23  Jana Fabrikova <jfabriko at redhat.com>
>>
>> *
>> /tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java:
>> adding 11 testcases based on the interactive Liveconnect JS->Java
>> overloaded function resolution tests, tests with JSObject were already
>> included
>>
>> * /tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java:
>> the applet whose methods are invoked from JS during the tests
>>
>> *
>> /tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js:
>> the JavaScript code for calling the applet methods from JS
>>
>> *
>> /tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp:
>> java network launch protocol file for displaying applet in the html page
>>
>> * /tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html:
>> the html page with java applet embedded, displayed in browser during
>> the tests
>>
>
> Thanks for the update!
>
> Adding Jiri to CC because of details relevant to MethodOverloadResolver
> review.
>
> FYI:
> So during MethodOverloadResolver rewrite I came across some issues not
> covered here (These are issues in icedtea-web to be clear - not issues
> with this patch):
>
> 1.)
> The spec says, when converting String->Boolean:
>
> -- The empty string becomes |false|. All other values become |true|.
> However, we also convert "false" into false. This is not consistent with
> the spec.
>
> 2.)
> Merely having this:
>      public void doubleOrChar(double value) {
>          System.out.println("doubleWithShort(" + value + ")");
>      }
>
>      public void doubleOrChar(char value) {
>          System.out.println("doubleWithShort(" + value + ")");
>      }
> And trying to call:
> applet.doubleOrChar(1.1)
>
> Will cause this exception:
> java.lang.NumberFormatException: For input string: "1.1"
>      at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>      at java.lang.Integer.parseInt(Integer.java:492)
>      at java.lang.Integer.valueOf(Integer.java:556)
>      at java.lang.Integer.decode(Integer.java:984)
>      at java.lang.Short.decode(Short.java:281)
>      at
> sun.applet.MethodOverloadResolver.getCostAndCastedObject(MethodOverloadResolver.java:383)
>      at
> sun.applet.MethodOverloadResolver.getMatchingMethod(MethodOverloadResolver.java:194)
>      at
> sun.applet.PluginAppletSecurityContext.handleMessage(PluginAppletSecurityContext.java:653)
>      at
> sun.applet.AppletSecurityContextManager.handleMessage(AppletSecurityContextManager.java:70)
>      at
> sun.applet.PluginStreamHandler.handleMessage(PluginStreamHandler.java:235)
>      at
> sun.applet.PluginMessageHandlerWorker.run(PluginMessageHandlerWorker.java:79)
>
> 3.)
>
> If you add these methods to the test, and pass a OverloadTestHelper3:
>
>      public void ClassToInherited(OverloadTestHelper1 p) {
>          System.out.println("ClassToInherited(OverloadTestHelper1) with
> "+p);
>     }
>      public void ClassToInherited(OverloadTestHelper2 p) {
>          System.out.println("ClassToInherited(OverloadTestHelper2) with
> "+p);
>      }
>
> 'ClassToInherited(OverloadTestHelper2 p)' should be chosen as the
> most-specific overload. Instead the choice is seemingly random (I
> managed to get different results each run).
>
> For Jiri,
>
> IMO my unit tests covered these cases and many more in-depth, and my
> MethodOverloadResolver patch fixes these. It is 'scary' I know, and I
> regret not breaking it up more, but I was very careful writing it to spec.
>
> If not, we'll have to separately add these cases in a unit-test or
> reproducer, it is up to you.
>
> (Funny note, JSObject seems to work correctly due to complete
> serendipity. The C++ side covers everything that is needed to not need
> any special overload cases for JSObject, and the JSObject branches in
> MethodOverloadResolve ATM are just dead-code -- they reference a dummy
> class included in the 'tests'.)
>
>
> Comments inline.
>
>> diff --git
>> a/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html b/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html
>> new file mode 100644
>> --- /dev/null
>> +++
>> b/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html
>> @@ -0,0 +1,27 @@
>> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> +<html lang="en-US">
>> +  <head>
>> +    <title>JavaScript to Java LiveConnect - FuncResol values from
>> applet</title>
>> +    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>> +
>> +    <script language="JavaScript" src="JSToJava_FuncResol.js"></script>
>> +
>> +  </head>
>> +  <body>
>> +
>> + <h2> The JSToJFuncResol html page</h2>
>> +
>> +    <applet code="JSToJFuncResol" width="1000" height="100"
>> id="jstojFuncResolApplet" MAYSCRIPT>
>> +      <param name="jnlp_href" value="jstoj-funcresol.jnlp">
>> +    </applet>
>> +
>> +   <div id="messageDiv"></div>
>> +
>> +    <script type="text/javascript">
>> +
>> +        doFuncResolTests();
>> +
>> +    </script>
>> +
>> +  </body>
>> +</html>
>> diff --git
>> a/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.jsb/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js
>> new file mode 100644
>> --- /dev/null
>> +++
>> b/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js
>> @@ -0,0 +1,37 @@
>> +function doFuncResolTests(){
>> +
>> +    var urlArgs = document.URL.split("?");
>> +    var testParams = urlArgs[1].split(";");
>> +    var applet = document.getElementById('jstojFuncResolApplet');
>> +    var func = testParams[0];
>> +    var value = testParams[1];
>> +
>> +    if( value === "JavaScript" ){
>> +
>
> As I have mentioned in my reply to '[rfc][icedtea-web] a new reproducer
> LiveConnect "function parameters" tests' I believe we can do without
> these special arguments entirely, it should be possible to pass
> arbitrary strings to Javascript through the URL. It will be received
> encoded, but Javascript has a handy function to do the decoding.
>
>> +        if( func === "CtToCt" ){
>> +            value = applet.getNewOverloadTestHelper2();
>> +        }
>> +
>> +        if( func === "CtToSc" ){
>> +            value = applet.getNewOverloadTestHelper2();
>> +        }
>> +
>> +        if( func === "JvToStr" ){
>> +            value = applet.getNewOverloadTestHelper1();
>> +        }
>> +
>> +        if( func === "JsoToArray" ){
>> +            value = new Array();
>> +            value[0] = 10;
>> +        }
>> +
>> +    }else if( value === "Eval" ){
>> +
>> +        value = eval(testParams[2]);
>> +
>> +    }
>> +
>> +    eval('applet.' + func + '(value)');
>
> With the use of the decoding we should be able to simply do
> eval('applet.' + func + '(' + value + ')') and not rely on a special
> 'eval' value to be passed.
>
>> +    applet.writeAfterTests();
>> +}
>> +
>> diff --git
>> a/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp
>> b/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp
>> new file mode 100644
>> --- /dev/null
>> +++
>> b/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp
>> @@ -0,0 +1,23 @@
>> +
>> +<?xml version="1.0" encoding="UTF-8"?>
>> +<jnlp spec="1.0+" codebase="" href="jstoj-funcresol.jnlp">
>> +    <information>
>> +        <title>JavaScript to Java LiveConnect - FuncResol</title>
>> +        <vendor>RedHat</vendor>
>
> Think this should be IcedTea.
>
>> +        <homepage
>> href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
>> +        <description>LiveConnect - tests for overloaded function
>> resolution when calling Java functions from JS.</description>
>> +    </information>
>> +    <resources>
>> +        <!-- Application Resources -->
>> +        <j2se version="1.6+"
>> +              href="http://java.sun.com/products/autodl/j2se"/>
>> +        <jar href="JSToJFuncResol.jar" main="true" />
>> +
>> +    </resources>
>> +    <applet-desc
>> +         name="JS to J FuncResol"
>> +         main-class="JSToJFuncResol"
>> +         width="1000"
>> +         height="100">
>> +     </applet-desc>
>> +</jnlp>
>> diff --git
>> a/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java
>> b/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java
>> new file mode 100644
>> --- /dev/null
>> +++ b/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java
>> @@ -0,0 +1,175 @@
>> +import java.applet.Applet;
>> +import java.awt.Label;
>> +import java.awt.BorderLayout;
>> +import netscape.javascript.JSObject;
>> +
>> +public class JSToJFuncResol extends Applet {
>> +
>> +    private Label statusLabel;
>> +
>> +    /* Numeric type to the analogous Java primitive type */
>> +
>> +    public void NumToNum(int p) {
>> +        System.out.println("NumToNum(int) with "+p);
>> +    }
>
> Can you expand out these method names ? I think these are more readable:
>
> NumToNum -> number
> NullToNonprim -> nullToObjectType
> JsoToJso -> javascriptObject
> CtToCt -> inheritedClass
> MultiPrim -> numberToCastedNumber
> StrToNum -> stringToNumber
> JvToStr -> javaObjectToString
> JsoToSomethingElse -> javascriptObjectToUnrelatedType
> Unsupported -> unsupported
>
> But feel free to go with what you think is best. I just found the
> acryonyms to be hard to discern when you're trying to see what tests are
> supported.
> Maybe also divide each section like you did with ' /****** Not allowed
> resolutions *******/'
> Just as a visual clue.
>
>> +
>> +    // int -> int is lower than:
>> +    // int to double
>> +    public void NumToNum(long p) {
>> +        System.out.println("NumToNum(long) with "+p);
>> +    }
>> +
>> +    // int to String
>> +    public void NumToNum(String p) {
>> +        System.out.println("NumToNum(String) with "+p);
>> +    }
>> +
>> +    /* Null to any non-primitive type */
>> +    public void NullToNonprim(Integer p) {
>> +        System.out.println("NullToNonprim(Integer) with "+p);
>> +    }
>> +
>> +    // Null to non-prim is better than:
>> +    // null -> prim (not allowed)
>> +    public void NullToNonprim(int p) {
>> +        System.out.println("NullToNonprim(int) with "+p);
>> +    }
>> +
>> +    /* JSObject to JSObject */
>> +    public void JsoToJso(JSObject p) {
>> +        System.out.println("JsoToJso(JSObject) with "+p);
>> +    }
>> +
>> +    // JSO -> JSO is better than:
>> +    // JSO -> String
>> +    public void JsoToJso(String p) {
>> +        System.out.println("JsoToJso(String) with "+p);
>> +    }
>> +
>> +    // JSO -> Java array
>> +    public void JsoToJso(String[] p) {
>> +        System.out.println("JsoToJso(String[]) with "+p);
>> +    }
>> +
>> +    // JSO -> Superclass (Object)
>> +    public void JsoToJso(Object p) {
>> +        System.out.println("JsoToJso(Object) with "+p);
>> +    }
>> +
>> +    /* Class type to Class type where the types are equal */
>> +    public void CtToCt(OverloadTestHelper2 p) {
>> +        System.out.println("CtToCt(OverloadTestHelper2) with "+p);
>> +    }
>> +
>> +    // CT -> CT is better than:
>> +    // CT -> Superclass
>> +    public void CtToCt(OverloadTestHelper1 p) {
>> +        System.out.println("CtToCt(OverloadTestHelper1) with "+p);
>> +   }
>> +
>> +    // CT->Subclass
>> +    public void CtToCt(OverloadTestHelper3 p) {
>> +        System.out.println("CtToCt(OverloadTestHelper3) with "+p);
>> +    }
>> +
>> +    /* Numeric type to a different primitive type */
>> +    public void MultiPrim(double p) {
>> +        System.out.println("MultiPrim(double) with "+p);
>> +    }
>> +
>> +    // Num -> Diff. prim. is better than:
>> +    // Better than anything else.. using string as a dummy
>> +    public void MultiPrim(String p) {
>> +        System.out.println("MultiPrim(String) with "+p);
>> +    }
>> +
>> +    /* String to numeric */
>> +    public void StrToNum(double p) {
>> +        System.out.println("StrToNum(double) with "+p);
>> +    }
>> +
>> +    // Str -> Num is better than:
>> +    // Anything else .. using OverloadTestHelper1 as a dummy
>> +    public void StrToNum(OverloadTestHelper1 p) {
>> +        System.out.println("StrToNum(OverloadTestHelper1) with "+p);
>> +    }
>> +
>> +    /* Class type to superclass type (with subclass passed) */
>> +    public void CtToSc(OverloadTestHelper1 p) {
>> +        System.out.println("CtToSc(OverloadTestHelper1) with "+p);
>> +    }
>> +
>> +    // CT -> Superclass is better than CT to String
>> +    public void CtToSc(String p) {
>> +        System.out.println("CtToSc(String) with "+p);
>> +    }
>> +
>> +    /* Any Java value to String */
>> +    public void JvToStr(String p) {
>> +        System.out.println("JvToStr(String) with "+p);
>> +    }
>> +
>> +    // JV -> Str is better than anything else allowed
>> +    public void JvToStr(JSObject p) {
>> +        System.out.println("JvToStr(JSObject) with "+p);
>> +    }
>> +
>> +    /* JSO to Array (lower cost) */
>> +    public void JsoToArray(int[] p) {
>> +        System.out.println("JsoToArray(int[]) with "+p);
>> +    }
>> +
>> +    // JSO to array is better than:
>> +    // something not possible
>> +    public void JsoToArray(Integer p) {
>> +        System.out.println("JsoToArray(Integer) with "+p);
>> +    }
>> +
>> +    /****** Not allowed resolutions *******/
>> +
>> +    /* null to primitive */
>> +    public void NullToPrim(int p) {
>> +        System.out.println("NullToPrim(int) with "+p);
>> +    }
>> +
>> +    /* JSObject to something else */
>> +    public void JsoToSomethingElse(OverloadTestHelper1 p) {
>> + System.out.println("JsoToSomethingElse(OverloadTesthelper1) with "+p);
>> +    }
>> +
>> +    /* Any other conversion not described ... e.g. sending non-array
>> to array */
>> +    public void Unsupported(Object[] p) {
>> +        System.out.println("Unsupported(Object[]) with "+p);
>> +    }
>> +
>> +    public void init() {
>> +        setLayout(new BorderLayout());
>> +        statusLabel = new Label();
>> +        add(statusLabel);
>> +        String initStr = "JSToJFuncResol applet initialized.";
>> +        System.out.println(initStr);
>> +        statusLabel.setText(initStr);
>
> I don't think the label is necessary
>
>> +    }
>> +
>> +    public void writeAfterTests(){
>> +        System.out.println("afterTests");
>> +    }
>> +
>> +    //dummy classes for passing objects as function parameters
>> +    public class OverloadTestHelper1 {};
>> +    public class OverloadTestHelper2 extends OverloadTestHelper1 {};
>> +    public class OverloadTestHelper3 extends  OverloadTestHelper2 {};
>> +
>> +    public OverloadTestHelper1 getNewOverloadTestHelper1(){
>> +        return new OverloadTestHelper1();
>> +    }
>> +
>> +    public OverloadTestHelper2 getNewOverloadTestHelper2(){
>> +        return new OverloadTestHelper2();
>> +    }
>> +
>> +    public OverloadTestHelper3 getNewOverloadTestHelper3(){
>> +        return new OverloadTestHelper3();
>> +    }
>> +
>> +}
>> diff --git
>> a/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.javab/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java
>> new file mode 100644
>> --- /dev/null
>> +++
>> b/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java
>> @@ -0,0 +1,158 @@
>> +/* JSToJFuncResolTest.java
>> +Copyright (C) 2012 Red Hat, Inc.
>> +
>> +This file is part of IcedTea.
>> +
>> +IcedTea is free software; you can redistribute it and/or
>> +modify it under the terms of the GNU General Public License as
>> published by
>> +the Free Software Foundation, version 2.
>> +
>> +IcedTea is distributed in the hope that it will be useful,
>> +but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> +General Public License for more details.
>> +
>> +You should have received a copy of the GNU General Public License
>> +along with IcedTea; see the file COPYING.  If not, write to
>> +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
>> Boston, MA
>> +02110-1301 USA.
>> +
>> +Linking this library statically or dynamically with other modules is
>> +making a combined work based on this library.  Thus, the terms and
>> +conditions of the GNU General Public License cover the whole
>> +combination.
>> +
>> +As a special exception, the copyright holders of this library give you
>> +permission to link this library with independent modules to produce an
>> +executable, regardless of the license terms of these independent
>> +modules, and to copy and distribute the resulting executable under
>> +terms of your choice, provided that you also meet, for each linked
>> +independent module, the terms and conditions of the license of that
>> +module.  An independent module is a module which is not derived from
>> +or based on this library.  If you modify this library, you may extend
>> +this exception to your version of the library, but you are not
>> +obligated to do so.  If you do not wish to do so, delete this
>> +exception statement from your version.
>> + */
>> +
>> +import net.sourceforge.jnlp.ProcessResult;
>> +import net.sourceforge.jnlp.ServerAccess;
>> +import net.sourceforge.jnlp.browsertesting.BrowserTest;
>> +import net.sourceforge.jnlp.browsertesting.Browsers;
>> +import net.sourceforge.jnlp.closinglisteners.CountingClosingListener;
>> +import net.sourceforge.jnlp.annotations.NeedsDisplay;
>> +import net.sourceforge.jnlp.annotations.TestInBrowsers;
>> +import org.junit.Assert;
>> +import org.junit.Test;
>> +
>> +public class JSToJFuncResolTest extends BrowserTest {
>> +
>> +    private final String initStr = "JSToJFuncResol applet initialized.";
>> +    private final String afterStr = "afterTests";
>> +
>> +    private class CountingClosingListenerImpl extends
>> CountingClosingListener {
>> +
>> +        @Override
>> +        protected boolean isAlowedToFinish(String s) {
>> +
>> +            return (s.contains(initStr) && s.contains(afterStr));
>> +        }
>> +    }
>> +
>> +    private void evaluateStdoutContents(String expectedStdout,
>> ProcessResult pr) {
>> +        // Assert that the applet was initialized.
>> +        Assert.assertTrue("JSToJFuncResol: the stdout should contain
>> " + initStr
>> +                + ", but it didnt.", pr.stdout.contains(initStr));
>> +
>> +        // Assert that the values set by JavaScript are ok
>> +        Assert.assertTrue("JSToJFuncResol: the output should include:
>> "+expectedStdout+", but it didnt.",
>> +        pr.stdout.contains(expectedStdout));
>> +
>> +    }
>> +
>> +    private void jsToJavaFuncResolTest(String expectedStdout, String
>> methodStr, String valueStr) throws Exception {
>> +        String strURL = "/JSToJFuncResol.html?" + methodStr + ";" +
>> valueStr;
>> +        ProcessResult pr = server.executeBrowser(strURL, new
>> CountingClosingListenerImpl(), new CountingClosingListenerImpl());
>> +        evaluateStdoutContents(expectedStdout, pr);
>> +    }
>> +
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_NullToNonprim_Test() throws
>> Exception {
>> +        jsToJavaFuncResolTest("NullToNonprim(Integer) with null",
>> "NullToNonprim", "Eval;null");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_JsoToJso_Test() throws Exception {
>> +        jsToJavaFuncResolTest("JsoToJso(JSObject) with [object
>> Window]", "JsoToJso", "Eval;window");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_CtToCt_Test() throws Exception {
>> +        jsToJavaFuncResolTest("CtToCt(OverloadTestHelper2) with
>> JSToJFuncResol$OverloadTestHelper2@", "CtToCt", "JavaScript");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_MultiPrim_Test() throws Exception {
>> +        jsToJavaFuncResolTest("MultiPrim(double) with 1.1",
>> "MultiPrim", "Eval;1.1");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_StrToNum_Test() throws Exception {
>> +        jsToJavaFuncResolTest("StrToNum(double) with 1.1",
>> "StrToNum", "1.1");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_CtToSc_Test() throws Exception {
>> +        jsToJavaFuncResolTest("CtToSc(OverloadTestHelper1) with
>> JSToJFuncResol$OverloadTestHelper2@", "CtToSc", "JavaScript");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_JvToStr_Test() throws Exception {
>> +        jsToJavaFuncResolTest("JvToStr(String) with
>> JSToJFuncResol$OverloadTestHelper1@", "JvToStr", "JavaScript");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_JsoToArray_Test() throws Exception {
>> +        jsToJavaFuncResolTest("JsoToArray(int[]) with [I@",
>> "JsoToArray", "JavaScript");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_NullToPrim_Test() throws Exception {
>> +        jsToJavaFuncResolTest("Error on Java side: No suitable method
>> named NullToPrim with matching args found", "NullToPrim", "Eval;null");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_JsoToSomethingElse_Test()
>> +            throws Exception {
>> +        jsToJavaFuncResolTest("Error on Java side: No suitable method
>> named JsoToSomethingElse with matching args found",
>> "JsoToSomethingElse", "Eval;window");
>> +    }
>> +
>> +    @Test
>> +    @TestInBrowsers(testIn = { Browsers.all })
>> +    @NeedsDisplay
>> +    public void AppletJSToJFuncResol_Unsupported_Test() throws
>> Exception {
>> +        jsToJavaFuncResolTest("Error on Java side: No suitable method
>> named Unsupported with matching args found", "Unsupported", "Eval;25");
>> +    }
>> +
>> +}
>
> Hopefully you'll be able to get rid of the special 'Javascript' value
> and have all data + expectations encoded in the test itself.
>
> Final clarifications: I am unsure whether the problems I pointed out
> should be added to this reproducer --- probably should to be on the safe
> side. Jiri may have some comments here.
> If you cannot get rid of the special 'Javascript' value you pass from
> the test it should still be OK, but let me know what problems you run
> into :-)
>
> Great work though. Look forward to having it in, it is much better.
>
> -Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: modifiing_JSToJFuncResol_version2.patch
Type: text/x-patch
Size: 19369 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130213/9aba7cb1/modifiing_JSToJFuncResol_version2.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adding_testcases_JSToJFuncParam_falseStr.patch
Type: text/x-patch
Size: 907 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130213/9aba7cb1/adding_testcases_JSToJFuncParam_falseStr.patch 


More information about the distro-pkg-dev mailing list