Class Tooling


  • public final class Tooling
    extends java.lang.Object
    Helper functions for automated tests.
    Author:
    kai
    • Constructor Summary

      Constructors 
      Constructor Description
      Tooling()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean compareFiles​(java.io.File file1, java.io.File file2)
      compare two files if they are equal.
      void createBinaryTestfile​(java.io.File file)
      Create a binary input file with all byte values possible.
      void createBinaryTestfile​(java.io.File file, long length, byte bValue)
      Create a binary input file with only one byte values used.
      void listProviders()
      List all installed crypto providers.
      void mockupInputOutputDecStreams​(org.jastacry.layer.Layer layer)
      General mockup for IO Exceptions.
      void mockupInputOutputEncStreams​(org.jastacry.layer.Layer layer)
      General mockup for IO Exceptions.
      • Methods inherited from class java.lang.Object

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

      • Tooling

        public Tooling()
    • Method Detail

      • compareFiles

        public boolean compareFiles​(java.io.File file1,
                                    java.io.File file2)
        compare two files if they are equal.
        Parameters:
        file1 - file one
        file2 - file two
        Returns:
        true if equal
      • listProviders

        public void listProviders()
        List all installed crypto providers.
      • createBinaryTestfile

        public void createBinaryTestfile​(java.io.File file)
        Create a binary input file with all byte values possible.
        Parameters:
        file - File to create
      • createBinaryTestfile

        public void createBinaryTestfile​(java.io.File file,
                                         long length,
                                         byte bValue)
        Create a binary input file with only one byte values used.
        Parameters:
        file - File to create
        length - how many bytes to write
        bValue - the byte to write
      • mockupInputOutputEncStreams

        public void mockupInputOutputEncStreams​(org.jastacry.layer.Layer layer)
                                         throws org.jastacry.JastacryException,
                                                java.io.IOException
        General mockup for IO Exceptions.
        Parameters:
        layer - The layer to be tested
        Throws:
        org.jastacry.JastacryException - on error
        java.io.IOException - on error
      • mockupInputOutputDecStreams

        public void mockupInputOutputDecStreams​(org.jastacry.layer.Layer layer)
                                         throws org.jastacry.JastacryException,
                                                java.io.IOException
        General mockup for IO Exceptions.
        Parameters:
        layer - The layer to be tested
        Throws:
        org.jastacry.JastacryException - on error
        java.io.IOException - on error