Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

ronyfla
Copy link
Contributor

@ronyfla ronyfla commented Feb 22, 2020

…59: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Download

$ git fetch https://git.openjdk.java.net/jfx pull/123/head:pull/123
$ git checkout pull/123

…59: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV
@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Feb 22, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 22, 2020

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 /signed in a comment in this pull request.

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 /covered in a comment in this pull request.

@ronyfla
Copy link
Contributor Author

ronyfla commented Feb 22, 2020

/signed

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 22, 2020

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!

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Feb 22, 2020
@ronyfla
Copy link
Contributor Author

ronyfla commented Feb 23, 2020

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

@ronyfla
Copy link
Contributor Author

ronyfla commented Feb 23, 2020

As this suggested test unit gets added to the 'systemTests' one can run that particular test by issuing:

./gradlew -PFULL_TEST=true :systemTests:test --tests ModuleLauncherTest

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Feb 25, 2020
@kevinrushforth
Copy link
Member

I have two overall comments before I review the specifics:

  1. The overall structure of this test looks good. I can also confirm that it fails without your fix and passes with your fix. So I think it's in good enough shape to review. Which brings me to my next point...
  2. We require that each pull request be associated with a unique bug. So this test should be added to PR 8234959: FXMLLoader does not populate ENGINE_SCOPE Bindings with FILENAME and ARGV #122 as an additional commit.

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.

@kevinrushforth
Copy link
Member

As an FYI, you can run just the one test method you added as follows:

gradle -PFULL_TEST=true :systemTests:test --tests ModuleLauncherTest.testModuleFXMLScriptTest

Copy link
Member

@kevinrushforth kevinrushforth left a 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.
Copy link
Member

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 {
Copy link
Member

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?

Copy link
Member

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 {
Copy link
Member

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.
Copy link
Member

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 @@
/*
Copy link
Member

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
{
Copy link
Member

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.

Comment on lines 38 to 48
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");
Copy link
Member

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) */ ";
Copy link
Member

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

Copy link
Member

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"?>

Copy link
Member

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.

@ronyfla
Copy link
Contributor Author

ronyfla commented Feb 27, 2020

Did apply the changes to the WIP, such that you could look over them here.
Also, afterwards I incorporated it into # 122 per your suggestion, so this WIP could be closed/deleted.

@ronyfla
Copy link
Contributor Author

ronyfla commented Feb 28, 2020

This test unit - after applying the review comments - got merged to https://github.com/openjdk/jfx/pull/122/commits, therefore closing this WIP.

@ronyfla ronyfla closed this Feb 28, 2020
@ronyfla ronyfla deleted the scripttest branch February 28, 2020 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants