jqwik-team / jqwik-samples

Sample projects for using jqwik
Eclipse Public License 2.0
5 stars 10 forks source link

Rename test classes #4

Closed sormuras closed 2 years ago

sormuras commented 2 years ago

Overview

Rename test classes to match default filter applied the JUnit Platform's Console Launcher.

  -n, --include-classname=PATTERN
                             Provide a regular expression to include only classes whose
                               fully qualified names match. To avoid loading classes
                               unnecessarily, the default pattern only includes class
                               names that begin with "Test" or end with "Test" or
                               "Tests". When this option is repeated, all patterns will
                               be combined using OR semantics. Default: [^(Test.*|.+[.$]
                               Test.*|.*Tests?)$]

I hereby agree to the terms of the jqwik Contributor Agreement.

sormuras commented 2 years ago

One test will fail:

    ╷
    └─ jqwik (JUnit Platform) ✔
       ├─ TestMyCalculatorProperties ✔
       │  ├─ addingZeroToAnyNumberResultsInNumber ✔
       │  └─ sumsOfSmallPositivesAreAlwaysPositive ✘ Unable to make public net.jqwik.api.Arbitrary net.jqwik.engine.properties.configurators.IntRangeConfigurator.configure(net.jqwik.api.Arbitrary,net.jqwik.api.constraints.IntRange) accessible: module net.jqwik.engine does not "exports net.jqwik.engine.properties.configurators" to module org.junit.platform.commons
       └─ TestMyCalculatorExamples ✔
          ├─ summingUpZeros ✔
          └─ summingUpTwoNumbers ✔

Seems like module net.jqwik.engine needs to export (or open) the configurators package to module org.junit.platform.commons.

Or, the service configuration is not correct, yet.

jlink commented 2 years ago

Seems like module net.jqwik.engine needs to export (or open) the configurators package to module org.junit.platform.commons.

I wonder why? Some configurator implementations are implemented in the engine module. Then org.junit.platform.commons.support.ReflectionSuppoert.findMethods(implementationClass, ...) is being used. Does that require an export? Or an open?

jlink commented 2 years ago

... Does that require an export? Or an open?

Because if it does, a whole lot of open/export statements will be necessary for all kinds of implementations of various public and already exported interfaces.

This would greatly devalue stuff like the platform's ReflectionSupport.