uschindler commented on code in PR #15623:
URL: https://github.com/apache/lucene/pull/15623#discussion_r2779686939
##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/TestsAndRandomizationPlugin.java:
##########
@@ -601,4 +632,114 @@ private static boolean addVectorizationOptions(
return defaultVectorizationOption.get();
}
+
+ public abstract static class LuceneTestFramework implements TestFramework {
+ private final DefaultTestFilter filter;
+ private final Factory<File> testTaskTemporaryDir;
+ private final Provider<Boolean> dryRun;
+ private TestFrameworkDetector detector =
+ new TestFrameworkDetector() {
+ private TestDefinitionProcessor<? super ClassTestDefinition>
testDefinitionProcessor;
+
+ @Override
+ public void startDetection(
+ TestDefinitionProcessor<? super ClassTestDefinition>
testDefinitionProcessor) {
+ this.testDefinitionProcessor = testDefinitionProcessor;
+ }
+
+ @Override
+ public boolean processTestClass(RelativeFile testClassFile) {
+ var cc =
+ ClassFile.of(
+ ClassFile.ConstantPoolSharingOption.NEW_POOL,
+ ClassFile.DebugElementsOption.DROP_DEBUG,
+ ClassFile.LineNumbersOption.DROP_LINE_NUMBERS,
+ ClassFile.StackMapsOption.DROP_STACK_MAPS);
+
+ try {
+ ClassModel parsed = cc.parse(testClassFile.getFile().toPath());
+ String internalName =
parsed.thisClass().asInternalName().replace('/', '.');
Review Comment:
This var should be named `binaryNane`. I stumbled on the same search/replace
bullshit, but there's no way to get the binary name from an internal name with
plain Java API. I worked around that in the JS compiler by never actually
requiring it (only use `ClassDesc`) and load as anonymous class.
As far as I remember, there's an issue open to add a method in jdk...
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]