thswlsqls opened a new issue, #9509:
URL: https://github.com/apache/paimon/issues/9509

   **Search before asking**
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   **Paimon version**
   master @ da71a6697 (2.1-SNAPSHOT)
   
   **Compute Engine**
   Engine-agnostic (`paimon-test-utils`)
   
   **Minimal reproduce step**
   `ParameterizedTestExtension` invokes the `@Parameters` provider and writes 
`@Parameter` fields reflectively, but never calls `setAccessible(true)`. A 
package-private test class breaks it even with a `public static` provider, 
because the declaring class itself is not accessible from the extension's 
package:
   
   ```java
   @ExtendWith(ParameterizedTestExtension.class)
   class MyTest {                                  // package-private
       @Parameter public String value;
       @Parameters public static List<String> parameters() { return 
Arrays.asList("a"); }
       @TestTemplate void test() {}
   }
   ```
   
   Result: `IllegalAccessException: ... cannot access a member of class ... 
with modifiers "public static"`. Private providers and private `@Parameter` 
fields fail the same way.
   
   **What doesn't meet your expectations?**
   Parameter injection should work regardless of the test class's and members' 
visibility.
   
   **Anything else?**
   All 20 usage sites in this repo are `public class`, necessarily so. About a 
quarter of the repo's `*Test`/`*ITCase` classes are package-private, so that 
style cannot use this extension. Upstream `flink-test-utils-junit`, which this 
file was ported from, added both `setAccessible(true)` calls (FLINK-32058, 
FLINK-32942). No existing test breaks today.
   
   **Are you willing to submit a PR?**
   - [x] I'm willing to submit a PR!
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to