Package org.apache.flink.packaging
Class PackagingTestUtils
- java.lang.Object
-
- org.apache.flink.packaging.PackagingTestUtils
-
public class PackagingTestUtils extends Object
Test utils around jar packaging.
-
-
Constructor Summary
Constructors Constructor Description PackagingTestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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
public static void assertJarContainsServiceEntry(Path jarPath, Class<?> service) throws Exception
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
-
-