RFR: 7951: Factor out commonly used test helper classes from org.openjdk.jmc.common.test into dedicated test library module [v2]

Brice Dutheil bdutheil at openjdk.org
Fri Feb 17 16:14:24 UTC 2023


On Fri, 17 Feb 2023 11:31:50 GMT, Christoph Langer <clanger at openjdk.org> wrote:

>> Triggered by an issue in project core/tests/org.openjdk.jmc.common.test, I came up with a little refactoring.
>> 
>> So, org.openjdk.jmc.common.test is somewhat of a hybrid project. It contains both, some common test scaffolding classes plus some actual tests for the org.openjdk.jmc.common module.
>> 
>> According to our special setup, which is not really like what maven would expect, we have all sources, also for the tests in the src/main/java folder. With a little tweak, that is specifying <testSourceDirectory>${project.basedir}/src/main/java</testSourceDirectory> in the pom.xml, we can direct maven to consume the tests from there instead of the usually expected src/test/java subfolder. However, when updating the eclipse project configuration from that pom.xml, the project would not export the test helper classes to other modules within eclipse any more.
>> 
>> I'm hereby factoring out the test helper classes into a new module called core/tests/org.openjdk.jmc.testlib. This module will then only serve as a test helper library but not contain any actual tests.
>> 
>> Furthermore I include some other cleanups in project and manifest files, e.g. removal of .settings files which are .gitignored because they would be generated when importing the JMC projects into Eclipse.
>
> Christoph Langer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
> 
>  - Merge branch 'master' into JMC-7951
>  - JMC-7951

application/uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/MCJemmyTestBase.java line 2:

> 1: /*
> 2:  * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.

Shouldn't it be 2023 ?

core/tests/org.openjdk.jmc.testlib/src/main/java/org/openjdk/jmc/test/MCTestCase.java line 33:

> 31:  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> 32:  */
> 33: package org.openjdk.jmc.test;

nitpick: I think the package name should follow the artifact name, maybe something like :

Suggestion:

package org.openjdk.jmc.test.lib;

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

PR: https://git.openjdk.org/jmc/pull/451


More information about the jmc-dev mailing list