Package com.itextpdf.test
Class ITextTest
java.lang.Object
com.itextpdf.test.ITextTest
- Direct Known Subclasses:
-
ExtendedITextTest
This is a generic class for testing. Subclassing it, or its subclasses is considered a good practice of creating your own tests.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Creates a folder with a given path, including all necessary nonexistent parent directories.static void
Creates a directory with given path if it does not exist and clears the contents of the directory in case it exists.protected String
createStringByEscaped
(byte[] bytes) static void
deleteDirectory
(String path) Removes the directory with given path along with its content including all the subdirectories.protected org.junit.rules.Timeout
static void
printOutCmpPdfNameAndDir
(String out, String cmp) static void
printOutputPdfNameAndDir
(String pdfName) static void
printPathToConsole
(String path, String comment) protected byte[]
static void
Due to import control restrictions by the governments of a few countries, the encryption libraries shipped by default with the Java SDK restrict the length, and as a result the strength, of encryption keys.static void
By using this method we restore cryptography restrictions via reflection.
-
Field Details
-
testTimeout
public org.junit.rules.Timeout testTimeout
-
-
Constructor Details
-
ITextTest
public ITextTest()
-
-
Method Details
-
createDestinationFolder
Creates a folder with a given path, including all necessary nonexistent parent directories. If a folder is already present, no action is performed.- Parameters:
-
path
- the path of the folder to create
-
createOrClearDestinationFolder
Creates a directory with given path if it does not exist and clears the contents of the directory in case it exists.- Parameters:
-
path
- the path of the directory to be created/cleared
-
deleteDirectory
Removes the directory with given path along with its content including all the subdirectories.- Parameters:
-
path
- the path of the directory to be removed
-
removeCryptographyRestrictions
public static void removeCryptographyRestrictions()Due to import control restrictions by the governments of a few countries, the encryption libraries shipped by default with the Java SDK restrict the length, and as a result the strength, of encryption keys. Be aware that by using this method we remove cryptography restrictions via reflection for testing purposes. For more conventional way of solving this problem you need to replace the default security JARs in your Java installation with the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. These JARs are available for download from http://java.oracle.com/ in eligible countries. -
restoreCryptographyRestrictions
public static void restoreCryptographyRestrictions()By using this method we restore cryptography restrictions via reflection. This method is opposite toremoveCryptographyRestrictions()
. -
printOutCmpPdfNameAndDir
-
printOutputPdfNameAndDir
-
printPathToConsole
-
getTestTimeout
protected org.junit.rules.Timeout getTestTimeout() -
readFile
- Throws:
-
IOException
-
createStringByEscaped
-