JDK-8146641 : Webview unit test failure with Jake
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 9-repo-jigsaw
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-01-07
  • Updated: 2018-10-10
  • Resolved: 2016-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
This line is failing with Jake and not with 9-dev.
  Object r = web.executeScript("alist.toArray(iarr)");

I am attaching a standalone test that demonstrates the problem.

I am running the test with jake using the command:

JFX_JAKE=/home/ddhill/sb/jake/jfx/rt/

$JDK9_HOME/bin/java \
   -Xpatch:$JFX_JAKE/build/testing/modules \
   -Djava.library.path=$JFX_JAKE/build/sdk/lib/amd64 \
   -cp Tests.jar ToArrayTestFailure



The affected junit test is:

test.javafx.scene.web.JavaScriptBridgeTest > testBridgeExplicitOverloading FAILED
    java.lang.AssertionError: expected same:<[Ljava.lang.Integer;@cdfd500> was not:<undefined>
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.failNotSame(Assert.java:639)
        at org.junit.Assert.assertSame(Assert.java:578)
        at org.junit.Assert.assertSame(Assert.java:591)
        at test.javafx.scene.web.JavaScriptBridgeTest.lambda$testBridgeExplicitOverloading$108(JavaScriptBridgeTest.java:419)
Comments
I see. So this was the result of a fragile test. Thanks for fixing it. I wonder if the fix should go into 9-dev as well to avoid the possibility of drift (or copying a bad pattern).
14-01-2016

Changeset: 4a8966adeeb0 Author: vadim Date: 2016-01-14 16:36 +0300 URL: http://hg.openjdk.java.net/openjfx/sandbox-9-jake/rt/rev/4a8966adeeb0
14-01-2016

In jake the order of methods in the ArrayList was changed (the order is not guaranteed) so first method with the name "toArray" is now "public java.lang.Object[] java.util.ArrayList.toArray()" and not "public java.lang.Object[] java.util.ArrayList.toArray(java.lang.Object[])".
14-01-2016

I wanted to test that I did get a fully clean test run. This is my patch, which could be used if this bug starts to get in the way of nightly test runs (which are not happening yet). diff -r 6dae178c49a4 modules/web/src/test/java/test/javafx/scene/web/JavaScriptBridgeTest.java --- a/modules/web/src/test/java/test/javafx/scene/web/JavaScriptBridgeTest.java Fri Jan 08 09:56:18 2016 -0500 +++ b/modules/web/src/test/java/test/javafx/scene/web/JavaScriptBridgeTest.java Fri Jan 08 10:43:23 2016 -0500 @@ -30,6 +30,7 @@ import netscape.javascript.JSObject; import static org.junit.Assert.*; import org.junit.Test; +import org.junit.Ignore; import org.w3c.dom.Document; public class JavaScriptBridgeTest extends TestBase { @@ -377,6 +378,7 @@ }); } + @Ignore("TODO: Please remove ignore annotation after 8146641 is fixed.") public @Test void testBridgeExplicitOverloading() throws InterruptedException { final WebEngine web = getEngine();
08-01-2016