paul8263 commented on a change in pull request #15927:
URL: https://github.com/apache/flink/pull/15927#discussion_r638417384
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/FlinkUserCodeClassLoadersTest.java
##########
@@ -208,6 +212,50 @@ public void testRepeatedParentFirstPatternClass() throws
Exception {
childClassLoader.close();
}
+ @Test
+ public void testGetClassLoaderInfo() throws Exception {
+ final ClassLoader parentClassLoader = getClass().getClassLoader();
+
+ final URL childCodePath =
getClass().getProtectionDomain().getCodeSource().getLocation();
+
+ final URLClassLoader childClassLoader =
+ FlinkUserCodeClassLoaders.childFirst(
+ new URL[] {childCodePath},
+ parentClassLoader,
+ new String[] {},
+ NOOP_EXCEPTION_HANDLER,
+ true);
+
+ String formattedURL = ClassLoaderUtil.formatURL(childCodePath);
+
+ assertEquals(
+ ClassLoaderUtil.getUserCodeClassLoaderInfo(childClassLoader),
+ "URL ClassLoader:" + formattedURL);
+
+ childClassLoader.close();
Review comment:
I think there is no need to ensure it is closed. So I keep it the same
as other test cases.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]