Menu

#313 Java version test in build-tests.xml is incomplete

v3.5.43
closed-fixed
nobody
None
5
2021-01-05
2020-03-15
No

build-tests.xml contains this snippet:

<condition property="is.JavaSunOracleApple">
    <or>
        <equals arg1="${java.vendor}" arg2="Sun Microsystems Inc."/>
        <equals arg1="${java.vendor}" arg2="Oracle Corporation"/>
        <equals arg1="${java.vendor}" arg2="Apple Inc."/>
    </or>
</condition>

This is incomplete because these days many vendors provide Java 8+. You have Azul, AdoptOpenJDK, Coretto, SapMachine, HPE, Inc. etc.

They (likely) all have Nashorn included from Java 8.

So our test should either test for Java at least 8 or add those vendors. Ant 1.10.2 provides this: <javaversion atleast="8"/>.

Discussion

  • Michael Osipov

    Michael Osipov - 2020-03-15

    Some test resources like

    • | |-- hugeclasspathenvmaxsize
    • | |-- hugeclasspathenvmaxsize-path.conf
    • | |-- hugeclasspathenvmaxsize.conf
    • | |-- hugeclasspathenvoversize
    • | |-- hugeclasspathenvoversize-path.conf
    • | |-- hugeclasspathenvoversize.conf

    Aren't generated b/c the script engine task is not run.

     
  • Maxime Andrighetto

    Thank you for pointing out this issue and sorry for the delay of our reply.

    Instead of testing the version of Java and the vendor which is not so reliable each time there is a change, we addressed the issue differently.
    In the next version of the Wrapper, the ANT script will actually test the Javascript engine and determine:

    1) if a built-in engine exists => it will be used
    2) if no built-in engine exists, it will try loading an external engine specified with the 'external.js.engine.dir' property.
    2.a) if 'external.js.engine.dir' is not specified, some tests requiring javascript will be skipped.
    2.b) if 'external.js.engine.dir' is specified but some error occurred, ANT will print the error and fail.

    This should work will any versions of Java and any vendors.

    Please let us know if you have any remarks/questions.

    Best Regards,

    Maxime

     
    • Michael Osipov

      Michael Osipov - 2020-11-30

      This makes sense. Looking forward too.

       
  • Maxime Andrighetto

    • status: open --> open-fixed
     
  • Maxime Andrighetto

    We released version 3.5.45 with the changes mentioned above.

    Best Regards,

    Maxime

     
  • Maxime Andrighetto

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB