Class WrappedSamplesRunner

java.lang.Object
com.itextpdf.test.WrappedSamplesRunner

public abstract class WrappedSamplesRunner extends Object
  • Field Details

    • sampleClassParams

      public com.itextpdf.test.WrappedSamplesRunner.RunnerParams sampleClassParams
    • sampleClass

      protected Class sampleClass
  • Constructor Details

    • WrappedSamplesRunner

      public WrappedSamplesRunner()
  • Method Details

    • generateTestsList

      public static Collection<Object[]> generateTestsList()
    • generateTestsList

      public static Collection<Object[]> generateTestsList (RunnerSearchConfig searchConfig)
    • runSamples

      public void runSamples() throws Exception
      Throws:
      Exception
    • comparePdf

      protected abstract void comparePdf (String outPath, String dest, String cmp) throws Exception
      Compares two PDF files using iText's CompareTool.
      Parameters:
      outPath - The path to the working folder where comparison results and temp files will be created
      dest - The PDF that resulted from the test
      cmp - The reference PDF
      Throws:
      Exception - If there is a problem opening the compare files
    • getDest

      protected String getDest()
      Gets the path to the resulting PDF from the sample class;
      Returns:
      a path to a resulting PDF
    • getCmpPdf

      protected String getCmpPdf (String dest)
    • getOutPath

      protected String getOutPath (String dest)
    • getStringField

      protected static String getStringField (Class c, String name)
      Returns a string value that is stored as a static variable inside an example class.
      Parameters:
      c - The example class
      name - The name of the variable
      Returns:
      The value of the variable
    • initClass

      protected void initClass()
      Creates a Class object for the example you want to test.
    • addError

      protected void addError (String error)
      Helper method to construct error messages.
      Parameters:
      error - part of an error message.
    • runMain

      protected void runMain() throws IllegalAccessException, InvocationTargetException
      Throws:
      IllegalAccessException
      InvocationTargetException