RFR: 8285878: [TestBug] LocalStorageTest and UserDataDirectoryTest don't always cleanup data dirs [v2]

Kevin Rushforth kcr at openjdk.org
Thu Apr 20 12:05:56 UTC 2023


On Wed, 19 Apr 2023 15:12:52 GMT, Jay Bhaskar <jbhaskar at openjdk.org> wrote:

>> Issue: "LocalStorageTest and UserDataDirectoryTest don't always cleanup data dirs"
>> Solution:
>> 1. All data directories must only be created under the "build" dir. In addition to being a best practice, at least they will be cleaned up by "gradle clean"
>> 2. There should be an @AfterClass method that deletes the data dirs
>> 3. There should be an @BeforeClass method that also deletes the data dirs prior to running the tests in case it wasn't cleaned up previously
>
> Jay Bhaskar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Implemented review comments

The changes look good. I'll approve it after I do a quick test. I left one suggestion inline (it's up to you).

modules/javafx.web/src/test/java/test/javafx/scene/web/LocalStorageTest.java line 88:

> 86:         webEngine.setUserDataDirectory(LOCAL_STORAGE_DIR);
> 87:         checkLocalStorageAfterWindowClose(webEngine);
> 88:         webEngine.setUserDataDirectory(null);

Since this cleanup is done as the last statement of each test, maybe it would be better to move this call to an `@After` method (note: _not_ `@AfterClass`)?

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

PR Review: https://git.openjdk.org/jfx/pull/1100#pullrequestreview-1393832029
PR Review Comment: https://git.openjdk.org/jfx/pull/1100#discussion_r1172486003


More information about the openjfx-dev mailing list