You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/15 20:13:15 UTC

[GitHub] [flink] metaswirl commented on a diff in pull request #17228: [FLINK-24236] Migrate tests to factory approach

metaswirl commented on code in PR #17228:
URL: https://github.com/apache/flink/pull/17228#discussion_r851495599


##########
flink-runtime/src/test/java/org/apache/flink/runtime/metrics/ReporterSetupTest.java:
##########
@@ -47,17 +50,30 @@
 import static org.junit.Assert.assertTrue;
 
 /** Tests for the {@link ReporterSetup}. */
-public class ReporterSetupTest extends TestLogger {
+@ExtendWith(TestLoggerExtension.class)
+class ReporterSetupTest {
+
+    @RegisterExtension
+    static final ContextClassLoaderExtension CONTEXT_CLASS_LOADER_EXTENSION =
+            ContextClassLoaderExtension.builder()
+                    .withServiceEntry(
+                            MetricReporterFactory.class,
+                            TestReporter1.class.getName(),
+                            TestReporter2.class.getName(),
+                            TestReporter11.class.getName(),
+                            TestReporter12.class.getName(),
+                            TestReporter13.class.getName())
+                    .build();

Review Comment:
   What is the benefit of using a custom class loader here?



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org