Package org.apache.flink.packaging
Class PackagingTestUtils
java.lang.Object
org.apache.flink.packaging.PackagingTestUtils
Test utils around jar packaging.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertJarContainsOnlyFilesMatching(Path jarPath, Collection<String> allowedPaths) Verifies that all files in the jar match one of the provided allow strings.static voidassertJarContainsServiceEntry(Path jarPath, Class<?> service) Verifies that the given jar contains a service entry file for the given service.
-
Constructor Details
-
PackagingTestUtils
public PackagingTestUtils()
-
-
Method Details
-
assertJarContainsOnlyFilesMatching
public static void assertJarContainsOnlyFilesMatching(Path jarPath, Collection<String> allowedPaths) throws Exception Verifies that all files in the jar match one of the provided allow strings.An allow item ending on a
"/"is treated as an allowed parent directory. Otherwise, it is treated as an allowed file.For example, given a jar containing a file
META-INF/NOTICES:These would pass:
"META-INF/""META-INF/NOTICES"
These would fail:
"META-INF""META-INF/NOTICE""META-INF/NOTICES/"
- Throws:
Exception
-
assertJarContainsServiceEntry
Verifies that the given jar contains a service entry file for the given service.Caution: This only checks that the file exists; the content is not verified.
- Throws:
Exception
-