Integrated: 8320712: Rewrite BadFactoryTest in pure Java

Eirik Bjørsnøs eirbjo at openjdk.org
Wed Jan 31 14:02:12 UTC 2024


On Mon, 27 Nov 2023 17:44:24 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:

> Please review this PR which rewrites the BadFactoryTest to pure Java/JUnit. The test is currently implemented using a mix of shell script and a Java main method. 
> 
> Reviewers may notice the following changes:
> 
> - The shell script file `BadFactoryTest.sh` has been retired and jtreg tags moved over to `BadFactoryTest.java`
> - The main method has been replaced with a JUnit `@Test` method
> - The service definition file used to be packaged into a jar file, now the source directory is instead directly added to the classpath using `@library /javax/script/JDK_8196959`
> - The `@summary` tag was updated since the existing summary was slightly confusing
> - To make jtreg happy, the SecurityManager-enabled invocation now runs with `-Djava.security.manager=allow` instead of just `-Djava.security.manager`
> - A sanity check was added to verify that `ScriptEngineManager` can actually find and load `BadFactory`. Such a check would have detected the issue which inspired this rewrite, see  #16585.
> 
> Verified by running:
> 
> 
> % make test TEST="test/jdk/javax/script/JDK_8196959"
>   [..]
>    TEST                                              TOTAL  PASS  FAIL ERROR   
>    jtreg:test/jdk/javax/script/JDK_8196959               1     1     0     0   
> 
> 
> Note that the original issue JDK-8196959 is not available in JBS, so my understanding of what the original test does is based on code inspection.

This pull request has now been integrated.

Changeset: 66971600
Author:    Eirik Bjørsnøs <eirbjo at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/66971600f7ba796ff5bb9714591c3faa0bb2249d
Stats:     86 lines in 2 files changed: 24 ins; 60 del; 2 mod

8320712: Rewrite BadFactoryTest in pure Java

Reviewed-by: jpai, sundar

-------------

PR: https://git.openjdk.org/jdk/pull/16830


More information about the core-libs-dev mailing list