Package com.inet.pdfc.junit
Class PdfcAssert
- java.lang.Object
-
- com.inet.pdfc.junit.PdfcAssert
-
public class PdfcAssert extends java.lang.ObjectA 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 voidassertPdfEquals(java.io.File expected, java.io.File actual)Asserts that two pdf documents contain no differencesstatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(java.lang.String expected, java.lang.String actual)Asserts that two pdf documents given by their path contain no differencesstatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(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 messagestatic voidassertPdfEquals(java.nio.file.Path expected, java.nio.file.Path actual)Asserts that two pdf documents given by their path contain no differencesstatic voidassertPdfNotEquals(java.io.File expected, java.io.File actual)Asserts that two pdf documents contain differencesstatic voidassertPdfNotEquals(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 messagestatic voidassertPdfNotEquals(java.lang.String expected, java.lang.String actual)Asserts that two pdf documents given by their path contain differencesstatic voidassertPdfNotEquals(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 messagestatic voidassertPdfNotEquals(java.lang.String message, java.nio.file.Path expected, java.nio.file.Path actual)Asserts that two pdf documents given by theirPathcontain differences anAssertionFailedErroris thrown with the given messagestatic voidassertPdfNotEquals(java.nio.file.Path expected, java.nio.file.Path actual)Asserts that two pdf documents given by their path contain differencesstatic voidsetCredentials(java.lang.String user, java.lang.String password)Set the login credentialsstatic voidsetLogLevel(int level)Set the log level.static voidsetPdfcConfiguration(java.lang.String configName)Defines the configuration for all subsequent calls of the assert APIstatic voidsetPdfcConfiguration(java.util.Properties settings)Defines the configuration for all subsequent calls of the assert APIstatic voidsetPdfcConfigurationWithName(java.lang.String nameOrID)Set the compare profile with the name or id.static voidsetServicePath(java.lang.String servicePath)Set the path to the PDFC server RPC application.
-
-
-
Method Detail
-
setPdfcConfiguration
public static void setPdfcConfiguration(java.lang.String configName) throws java.io.IOExceptionDefines the configuration for all subsequent calls of the assert API- Parameters:
configName- the name/path of the configuration file. Anullvalue 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/pdfcrpcws
- http://myhost:9900
- http://myhost:9900/pdfcrpcws
- 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 inLogger
-
setCredentials
public static void setCredentials(java.lang.String user, java.lang.String password)Set the login credentials- Parameters:
user- the user namepassword- 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 contentactual- 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 failexpected- the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the path of the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the path of the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the InputStream of the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the URL of the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the pdf file with the expected contentactual- 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 contentactual- 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 failexpected- the path of the pdf file with the expected contentactual- 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- thePathof the pdf file with the expected contentactual- 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 theirPathcontain differences anAssertionFailedErroris thrown with the given message- Parameters:
message- the message in case of a failexpected- thePathof the pdf file with the expected contentactual- the path of the pdf file with the actual content
-
-