Class PdfcAssert

java.lang.Object
com.inet.pdfc.junit.PdfcAssert

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assertPdfEquals(File expected, File actual)
    Asserts that two pdf documents contain no differences
    static void
    Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfEquals(String message, File expected, File actual)
    Asserts that two pdf documents contain no differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfEquals(String message, InputStream expected, 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(String expected, String actual)
    Asserts that two pdf documents given by their path contain no differences
    static void
    assertPdfEquals(String message, String expected, 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(String message, URL expected, 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(String message, Path expected, 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(URL expected, 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(Path expected, Path actual)
    Asserts that two pdf documents given by their path contain no differences
    static void
    assertPdfNotEquals(File expected, File actual)
    Asserts that two pdf documents contain differences
    static void
    assertPdfNotEquals(String message, File expected, File actual)
    Asserts that two pdf documents contain differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfNotEquals(String message, InputStream expected, InputStream actual)
    Asserts that two pdf documents given by their path contain no differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfNotEquals(String expected, String actual)
    Asserts that two pdf documents given by their path contain differences
    static void
    assertPdfNotEquals(String message, String expected, String actual)
    Asserts that two pdf documents given by their path contain differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfNotEquals(String message, Path expected, Path actual)
    Asserts that two pdf documents given by their Path contain differences an AssertionFailedError is thrown with the given message
    static void
    assertPdfNotEquals(Path expected, Path actual)
    Asserts that two pdf documents given by their path contain differences
    static void
    setCredentials(String user, String password)
    Set the login credentials to login into the server.
    static void
    setLogLevel(int level)
    Set the log level of the client.
    static void
    Defines the configuration for all subsequent calls of the assert API
    static void
    Defines the configuration for all subsequent calls of the assert API
    static void
    Set the compare profile with the name or id.
    static void
    setServicePath(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 Details

    • PdfcAssert

      public PdfcAssert()
  • Method Details

    • setPdfcConfiguration

      public static void setPdfcConfiguration(String configName) throws 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:
      IOException - in case the designated file is not readable or not a valid XML file
      Since:
      3.0
    • setPdfcConfigurationWithName

      public static void setPdfcConfigurationWithName(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
      Since:
      3.0
    • setPdfcConfiguration

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

      public static void setServicePath(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
      Since:
      3.0
    • setLogLevel

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

      public static void setCredentials(String user, String password)
      Set the login credentials to login into the server.
      Parameters:
      user - the user name
      password - the password
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(File expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String message, File expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String message, String expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(Path expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String message, Path expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(URL expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String message, InputStream expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(InputStream expected, 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
      Since:
      3.0
    • assertPdfEquals

      public static void assertPdfEquals(String message, URL expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(File expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(String message, File expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(String expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(String message, String expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(Path expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(String message, Path expected, 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
      Since:
      3.0
    • assertPdfNotEquals

      public static void assertPdfNotEquals(String message, InputStream expected, 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
      Since:
      3.0