-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP test unit for: 8234959: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV #123
Conversation
…59: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
Hi ronyfla, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user ronyfla" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
/signed |
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
OK, forgot to submit an explanatory text related to this fix. Posted [1] which explains the problem and the suggested solution for discussion. [1] 'Ad suggested test unit for "JDK-8234959 FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV"': https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-February/025104.html |
As this suggested test unit gets added to the 'systemTests' one can run that particular test by issuing:
|
I have two overall comments before I review the specifics:
I will have a few specific comments on the test, so if you want to wait to add the test to PR #122 that would be fine. |
As an FYI, you can run just the one test method you added as follows:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the test quite a bit, and for the most part it only needs cosmetic changes.
I marked this as "changes needed" because it needs to be folded into PR #122. Once you do that, you can close this WIP PR.
@@ -1,5 +1,5 @@ | |||
/* | |||
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. | |||
* Copyright (c) 2017, 2018, 2020, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the year of creation and the year last modified should be listed, so that should be:
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
@@ -274,4 +276,9 @@ public void testModuleFXMLQualOpened() throws Exception { | |||
doTestLaunchModule(modulePath6, "myapp6.AppFXMLQualOpened"); | |||
} | |||
|
|||
@Test (timeout = 15000) | |||
public void testModuleFXMLScriptTest() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend a method name that doesn't start with testModuleFXML
, since it otherwise when looking at a list of tests (e.g., in the test report), it lands in the middle of a set of related tests to which this new test is unrelated. This test really isn't testing modules, so maybe something with "module" in the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant without module in the name...
@@ -0,0 +1,9 @@ | |||
module mymod { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file needs a copyright header
@@ -0,0 +1,37 @@ | |||
/* | |||
* Copyright (c) 2017-2019, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Years should be 2017, 2020,
@@ -0,0 +1,303 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test app should be called something without Test
in the name, since it isn't run by the gradle unit testing framework.
|
||
|
||
public class RgfPseudoScriptEngineFactory implements ScriptEngineFactory | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curly brace on previous line.
final static String ENGINE_NAME = "RgfPseudoScriptLanguage (RPSL) 1.0.0"; | ||
final static String SHORT_ENGINE_NAME = "rpsl"; | ||
final static String ENGINE_VERSION = "100.20200220"; | ||
final static List<String> EXTENSIONS = Arrays.asList("rpsl", "RPSL" ); | ||
final static String LANGUAGE_NAME = "RgfPseudoScriptLanguage"; | ||
final static String LANGUAGE_VERSION = "1.0.0.100.20200220"; | ||
|
||
final static List<String> MIME_TYPES = Arrays.asList("text/rpsl", "application/x-rpsl"); | ||
final static String THREADING = "MULTITHREADED"; | ||
|
||
final static List<String> ENGINE_NAMES = Arrays.asList(SHORT_ENGINE_NAME, "RgfPseudoSL"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example where I think it is fine to line them up. Can you also do that for the last of these?
Also, our general pattern is static final
(static goes first). I probably missed noting that in other places.
|
||
public String getOutputStatement(String toDisplay) { | ||
String tmpDisplay=toStringLiteral(toDisplay); | ||
return "say "+tmpDisplay+" /* Rexx style (duplicate quotes within string) */ "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces around the +
@@ -0,0 +1,2 @@ | |||
pseudoScriptEngine.RgfPseudoScriptEngineFactory | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this extra blank line needed?
@@ -0,0 +1,42 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a copyright header here. See any of the other .fxml
file in tests/system
for an example.
Did apply the changes to the WIP, such that you could look over them here. |
This test unit - after applying the review comments - got merged to https://github.com/openjdk/jfx/pull/122/commits, therefore closing this WIP. |
…59: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
Progress
Download
$ git fetch https://git.openjdk.java.net/jfx pull/123/head:pull/123
$ git checkout pull/123