[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: [Integrated] RFR: 8234876: Unit test classes should not extend Application
From:       Ambarish Rapte <arapte () openjdk ! java ! net>
Date:       2020-05-27 1:31:26
Message-ID: gmdVJp3MkGEGWKR0Z2NJlvqC4p9apBrBukZaQ6luJb8=.0ecc5529-1999-4480-a6fa-ace672e9b4f0 () github ! com
[Download RAW message or body]

On Tue, 26 May 2020 11:12:25 GMT, Ambarish Rapte <arapte@openjdk.org> wrote:

> Copied from JBS:
> As a best practice, unit test classes that are run by Junit should not extend \
> javafx.application.Application. JUnit constructs an instance of a test class for \
> each test method that it runs. This will be different from the instance of the \
> object that is constructed when Application.launch method is called, and this can \
> lead to unexpected behavior. Most of our tests use helper classes or nested \
> (static) sub classes of Application, but the following two test classes do not:  \
> tests/system/src/test/java/test/com/sun/javafx/image/impl/ImageRaceTest.java \
> tests/system/src/test/java/test/javafx/scene/control/AccordionTitlePaneLeakTest.java
>  
> ----
> Changes in the tests are:
> ImageRaceTest.java->  Does not require a sub class of Application.
> AccordionTitlePaneLeakTest.java->  Required minor changes to create a static sub \
> class.

This pull request has now been integrated.

Changeset: 16f446a0
Author:    Ambarish Rapte <arapte@openjdk.org>
URL:       https://git.openjdk.java.net/jfx/commit/16f446a0
Stats:     51 lines in 2 files changed: 25 ins; 4 del; 22 mod

8234876: Unit test classes should not extend Application

Reviewed-by: kcr

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

PR: https://git.openjdk.java.net/jfx/pull/237


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic