Class PdfcAssert


  • public class PdfcAssert
    extends java.lang.Object
    A set of assertion methods to check two PDF files for equality.
    • Constructor Summary

      Constructors 
      Constructor Description
      PdfcAssert()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void assertPdfEquals​(java.io.File expected, java.io.File actual)
      Asserts that two pdf documents contain no differences
      static void assertPdfEquals​(java.io.InputStream expected, java.io.InputStream actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.lang.String message, java.io.File expected, java.io.File actual)
      Asserts that two pdf documents contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.lang.String message, java.io.InputStream expected, java.io.InputStream actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.lang.String expected, java.lang.String actual)
      Asserts that two pdf documents given by their path contain no differences
      static void assertPdfEquals​(java.lang.String message, java.lang.String expected, java.lang.String actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.lang.String message, java.net.URL expected, java.net.URL actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.lang.String message, java.nio.file.Path expected, java.nio.file.Path actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.net.URL expected, java.net.URL actual)
      Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
      static void assertPdfEquals​(java.nio.file.Path expected, java.nio.file.Path actual)
      Asserts that two pdf documents given by their path contain no differences
      static void assertPdfNotEquals​(java.io.File expected, java.io.File actual)
      Asserts that two pdf documents contain differences
      static void assertPdfNotEquals​(java.lang.String message, java.io.File expected, java.io.File actual)
      Asserts that two pdf documents contain differences an AssertionFailedError is thrown with the given message
      static void assertPdfNotEquals​(java.lang.String expected, java.lang.String actual)
      Asserts that two pdf documents given by their path contain differences
      static void assertPdfNotEquals​(java.lang.String message, java.lang.String expected, java.lang.String actual)
      Asserts that two pdf documents given by their path contain differences an AssertionFailedError is thrown with the given message
      static void assertPdfNotEquals​(java.lang.String message, java.nio.file.Path expected, java.nio.file.Path actual)
      Asserts that two pdf documents given by their Path contain differences an AssertionFailedError is thrown with the given message
      static void assertPdfNotEquals​(java.nio.file.Path expected, java.nio.file.Path actual)
      Asserts that two pdf documents given by their path contain differences
      static void setCredentials​(java.lang.String user, java.lang.String password)
      Set the login credentials
      static void setLogLevel​(int level)
      Set the log level.
      static void setPdfcConfiguration​(java.lang.String configName)
      Defines the configuration for all subsequent calls of the assert API
      static void setPdfcConfiguration​(java.util.Properties settings)
      Defines the configuration for all subsequent calls of the assert API
      static void setPdfcConfigurationWithName​(java.lang.String nameOrID)
      Set the compare profile with the name or id.
      static void setServicePath​(java.lang.String servicePath)
      Set the path to the PDFC server RPC application.
      • Methods inherited from class java.lang.Object

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

      • PdfcAssert

        public PdfcAssert()
    • Method Detail

      • setPdfcConfiguration

        public static void setPdfcConfiguration​(java.lang.String configName)
                                         throws java.io.IOException
        Defines the configuration for all subsequent calls of the assert API
        Parameters:
        configName - the name/path of the configuration file. A null value will reset the internal configuration to default.
        Throws:
        java.io.IOException - in case the designated file is not readable or not a valid XML file
      • setPdfcConfigurationWithName

        public static void setPdfcConfigurationWithName​(java.lang.String nameOrID)
        Set the compare profile with the name or id. This profile should be for the login user available. The available names can you see at http://<pdfcserver:port>/pdfcapi/listconfig If it didn't found the profile it throw an exception with all user available configuration
        Parameters:
        nameOrID - name or id, case insensitive
      • setPdfcConfiguration

        public static void setPdfcConfiguration​(java.util.Properties settings)
        Defines the configuration for all subsequent calls of the assert API
        Parameters:
        settings - the configuration properties to be used
      • setServicePath

        public static void setServicePath​(java.lang.String servicePath)
        Set the path to the PDFC server RPC application. If not set multicast DNS is used to search the server. Possible values are:
        • myhost:9900
        • myhost:9900/websocket
        • http://myhost:9900
        • http://myhost:9900/websocket
        Parameters:
        servicePath - the path to the service
      • setLogLevel

        public static void setLogLevel​(int level)
        Set the log level.
        Parameters:
        level - new level, once of the constant in Logger
      • setCredentials

        public static void setCredentials​(java.lang.String user,
                                          java.lang.String password)
        Set the login credentials
        Parameters:
        user - the user name
        password - the password
      • assertPdfEquals

        public static void assertPdfEquals​(java.io.File expected,
                                           java.io.File actual)
        Asserts that two pdf documents contain no differences
        Parameters:
        expected - the pdf file with the expected content
        actual - the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String message,
                                           java.io.File expected,
                                           java.io.File actual)
        Asserts that two pdf documents contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the pdf file with the expected content
        actual - the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String expected,
                                           java.lang.String actual)
        Asserts that two pdf documents given by their path contain no differences
        Parameters:
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String message,
                                           java.lang.String expected,
                                           java.lang.String actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.nio.file.Path expected,
                                           java.nio.file.Path actual)
        Asserts that two pdf documents given by their path contain no differences
        Parameters:
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String message,
                                           java.nio.file.Path expected,
                                           java.nio.file.Path actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.net.URL expected,
                                           java.net.URL actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        expected - the URL of the pdf file with the expected content
        actual - the URL of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String message,
                                           java.io.InputStream expected,
                                           java.io.InputStream actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the InputStream of the pdf file with the expected content
        actual - the InputStream of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.io.InputStream expected,
                                           java.io.InputStream actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        expected - the InputStream of the pdf file with the expected content
        actual - the InputStream of the pdf file with the actual content
      • assertPdfEquals

        public static void assertPdfEquals​(java.lang.String message,
                                           java.net.URL expected,
                                           java.net.URL actual)
        Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the URL of the pdf file with the expected content
        actual - the URL of the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.io.File expected,
                                              java.io.File actual)
        Asserts that two pdf documents contain differences
        Parameters:
        expected - the pdf file with the expected content
        actual - the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.lang.String message,
                                              java.io.File expected,
                                              java.io.File actual)
        Asserts that two pdf documents contain differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the pdf file with the expected content
        actual - the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.lang.String expected,
                                              java.lang.String actual)
        Asserts that two pdf documents given by their path contain differences
        Parameters:
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.lang.String message,
                                              java.lang.String expected,
                                              java.lang.String actual)
        Asserts that two pdf documents given by their path contain differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.nio.file.Path expected,
                                              java.nio.file.Path actual)
        Asserts that two pdf documents given by their path contain differences
        Parameters:
        expected - the Path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content
      • assertPdfNotEquals

        public static void assertPdfNotEquals​(java.lang.String message,
                                              java.nio.file.Path expected,
                                              java.nio.file.Path actual)
        Asserts that two pdf documents given by their Path contain differences an AssertionFailedError is thrown with the given message
        Parameters:
        message - the message in case of a fail
        expected - the Path of the pdf file with the expected content
        actual - the path of the pdf file with the actual content