Re: Question ad creating a testcase that needs a jar on class- or module path

2020-02-17 Thread Kevin Rushforth

Replies inline.

On 2/17/2020 7:40 AM, Rony G. Flatscher wrote:

Over the weekend I was finally able to finalize the test unit in form of a 
module. Kept it as simple
as possible (but it includes a pseudo script engine).

May I just ask a few questions, before proceeding with submitting one or two 
PRs:

   * Every new program needs the Oracle license header at the top?


Yes.


   * Would it be o.k. to dual license (AL 2.0 for the pseudo scripting engine)?

   o If not (it probably would introduce noise and problems) it would not 
be a real problem as I
 always can create a separate package using only the code that was 
authored by myself.


Not for code you commit into the openjfx repo, no. However, since you 
retain the copyright for anything you contribute to OpenJDK, you can 
ship it separately under whatever license you choose.



   * Where shall I explain/document how the test unit works, here in the 
mailing list or with the PR?

   o If the latter, then it would probably be a good idea to submit the 
test unit separately from
 the PR for fixing the bug as that will have its own set of 
explanations/documentations
 (briefly discussing the three scenarious how a script controller may 
define scripts and why
 the filenames were picked the way they are).

   * Maybe the explanations/documentations for the bug fix should be posted 
here upfront for discussion?


I think a mailing list discussion would be a good place to start.

-- Kevin



---rony


On 03.02.2020 15:04, Rony G. Flatscher wrote:


Hi Kevin,

On 31.01.2020 16:38, Kevin Rushforth wrote:

And if you need a modular jar, you might look at ModuleLauncherTest instead.

thank you very much for this important hint as well!

Having no knowledge about gradle it will take me a while to research and 
digest, but this definitely
helps me to jump start to the section where tests get carried out with 
separately configured JVMs.

Would it be o.k. to first submit a pull request for JDK-8234959
 and later, when an 
appropriate test unit using
the SPI dependent pseudo script engine is available submitting the test app 
with different pull
request? Or would it be better to submit both with the same pull request?

---rony




Re: Question ad creating a testcase that needs a jar on class- or module path

2020-02-17 Thread Rony G. Flatscher
Over the weekend I was finally able to finalize the test unit in form of a 
module. Kept it as simple
as possible (but it includes a pseudo script engine).

May I just ask a few questions, before proceeding with submitting one or two 
PRs:

  * Every new program needs the Oracle license header at the top?

  * Would it be o.k. to dual license (AL 2.0 for the pseudo scripting engine)?

  o If not (it probably would introduce noise and problems) it would not be 
a real problem as I
always can create a separate package using only the code that was 
authored by myself.

  * Where shall I explain/document how the test unit works, here in the mailing 
list or with the PR?

  o If the latter, then it would probably be a good idea to submit the test 
unit separately from
the PR for fixing the bug as that will have its own set of 
explanations/documentations
(briefly discussing the three scenarious how a script controller may 
define scripts and why
the filenames were picked the way they are).

  * Maybe the explanations/documentations for the bug fix should be posted here 
upfront for discussion?

---rony


On 03.02.2020 15:04, Rony G. Flatscher wrote:

> Hi Kevin,
>
> On 31.01.2020 16:38, Kevin Rushforth wrote:
>> And if you need a modular jar, you might look at ModuleLauncherTest instead.
> thank you very much for this important hint as well!
>
> Having no knowledge about gradle it will take me a while to research and 
> digest, but this definitely
> helps me to jump start to the section where tests get carried out with 
> separately configured JVMs.
>
> Would it be o.k. to first submit a pull request for JDK-8234959
>  and later, when an 
> appropriate test unit using
> the SPI dependent pseudo script engine is available submitting the test app 
> with different pull
> request? Or would it be better to submit both with the same pull request?
>
> ---rony



Re: Question ad creating a testcase that needs a jar on class- or module path

2020-02-03 Thread Rony G. Flatscher
Hi Kevin,

On 31.01.2020 16:38, Kevin Rushforth wrote:
> And if you need a modular jar, you might look at ModuleLauncherTest instead.

thank you very much for this important hint as well!

Having no knowledge about gradle it will take me a while to research and 
digest, but this definitely
helps me to jump start to the section where tests get carried out with 
separately configured JVMs.

Would it be o.k. to first submit a pull request for JDK-8234959
 and later, when an 
appropriate test unit using
the SPI dependent pseudo script engine is available submitting the test app 
with different pull
request? Or would it be better to submit both with the same pull request?

---rony




Re: Question ad creating a testcase that needs a jar on class- or module path

2020-01-31 Thread Kevin Rushforth

And if you need a modular jar, you might look at ModuleLauncherTest instead.

-- Kevin


On 1/31/2020 7:35 AM, Kevin Rushforth wrote:
Take a look at the JarLauncherTest in the tests/system dir. There is 
some (ugly) build logic in build.gradle to support it.


-- Kevin

On 1/31/2020 7:28 AM, Rony G. Flatscher wrote:
How would one go about creating a testcase that needs a jar-file 
either on the class- or module path?


Are there any test units that would demonstrate how to do it? If not, 
what approach would you

suggest (and if so, are there any samples already somewhere to study)?

---

Background: for creating a testcase using a pseudo script engine 
("RgfPseudoScriptEngine") that logs
its invocations with the script context Bindings for each invocation 
and which then will be analyzed
and used for the test assertions, there is a need to have the pseudo 
script engine made available

via the Java scripting framework.

There is a jar-file (that includes the sources as well) with the 
necessary definitions:


   * via class path: 
"META-INF/services/javax.script.ScriptEngineFactory" entry:


 rgf.scriptEngine.RgfPseudoScriptEngineFactory

   * via module path which will use the information in 
"module-info.java":


 module rgf.scriptEngine {
 requires java.scripting;
 provides javax.script.ScriptEngineFactory with 
rgf.scriptEngine.RgfPseudoScriptEngineFactory;

 exports rgf.scriptEngine;
 }

TIA,

---rony







Re: Question ad creating a testcase that needs a jar on class- or module path

2020-01-31 Thread Kevin Rushforth
Take a look at the JarLauncherTest in the tests/system dir. There is 
some (ugly) build logic in build.gradle to support it.


-- Kevin

On 1/31/2020 7:28 AM, Rony G. Flatscher wrote:

How would one go about creating a testcase that needs a jar-file either on the 
class- or module path?

Are there any test units that would demonstrate how to do it? If not, what 
approach would you
suggest (and if so, are there any samples already somewhere to study)?

---

Background: for creating a testcase using a pseudo script engine 
("RgfPseudoScriptEngine") that logs
its invocations with the script context Bindings for each invocation and which 
then will be analyzed
and used for the test assertions, there is a need to have the pseudo script 
engine made available
via the Java scripting framework.

There is a jar-file (that includes the sources as well) with the necessary 
definitions:

   * via class path: "META-INF/services/javax.script.ScriptEngineFactory" entry:

 rgf.scriptEngine.RgfPseudoScriptEngineFactory

   * via module path which will use the information in "module-info.java":

 module rgf.scriptEngine {
 requires java.scripting;
 provides javax.script.ScriptEngineFactory with 
rgf.scriptEngine.RgfPseudoScriptEngineFactory;
 exports rgf.scriptEngine;
 }

TIA,

---rony