Class JarUtilsTest


  • public class JarUtilsTest
    extends java.lang.Object
    Tests JarUtils.
    Author:
    Holger Eichelberger, SSE
    • Constructor Summary

      Constructors 
      Constructor Description
      JarUtilsTest()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void assertFileExists​(java.io.File base, java.lang.String name, boolean isDirectory)
      Asserts that a file/directory exists.
      private static void assertFileNotExists​(java.io.File base, java.lang.String name)
      Asserts that a file/directory does not exists.
      void extactFile()
      Tests ZipUtils.findFile(java.io.InputStream, String).
      void extractFullZip()
      Tests ZipUtils.extractZip(java.io.InputStream, java.nio.file.Path).
      void extractPartialZip()
      Tests ZipUtils.extractZip(java.io.InputStream, java.nio.file.Path, java.util.function.Predicate).
      void testListFiles()
      Tests ZipUtils.listFiles(InputStream, java.util.function.Predicate, java.util.function.Consumer).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JarUtilsTest

        public JarUtilsTest()
    • Method Detail

      • extractFullZip

        public void extractFullZip()
                            throws java.io.IOException
        Tests ZipUtils.extractZip(java.io.InputStream, java.nio.file.Path).
        Throws:
        java.io.IOException - if reading/writing fails
      • assertFileExists

        private static void assertFileExists​(java.io.File base,
                                             java.lang.String name,
                                             boolean isDirectory)
        Asserts that a file/directory exists.
        Parameters:
        base - the base directory
        name - the name/path in base to be asserted
        isDirectory - true if the specified shall be a directory, false for a file
      • assertFileNotExists

        private static void assertFileNotExists​(java.io.File base,
                                                java.lang.String name)
        Asserts that a file/directory does not exists.
        Parameters:
        base - the base directory
        name - the name/path in base to be asserted
      • extractPartialZip

        public void extractPartialZip()
                               throws java.io.IOException
        Tests ZipUtils.extractZip(java.io.InputStream, java.nio.file.Path, java.util.function.Predicate).
        Throws:
        java.io.IOException - if reading/writing fails
      • extactFile

        public void extactFile()
                        throws java.io.IOException
        Tests ZipUtils.findFile(java.io.InputStream, String).
        Throws:
        java.io.IOException - if reading/writing fails
      • testListFiles

        public void testListFiles()
                           throws java.io.IOException
        Tests ZipUtils.listFiles(InputStream, java.util.function.Predicate, java.util.function.Consumer).
        Throws:
        java.io.IOException - if reading/writing fails