Class PdfVisualTester.TestImage

  • Enclosing class:
    PdfVisualTester

    public static class PdfVisualTester.TestImage
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.image.BufferedImage actual  
      private boolean differences  
      private java.awt.image.BufferedImage expected  
      private int pageNumber  
      private java.lang.String testName  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TestImage​(java.lang.String test, int pageNo, java.awt.image.BufferedImage exp, java.awt.image.BufferedImage act, boolean hasDifferences)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage createDiff()
      Creates a diff image to quickly spot differences between expected and actual.
      java.awt.image.BufferedImage getActual()
      Get the actual rendered image.
      java.awt.image.BufferedImage getExpected()
      Get the expected rendered image.
      int getPageNumber()  
      java.lang.String getTestName()  
      boolean hasDifferences()
      Should usually be called before createDiff().
      • Methods inherited from class java.lang.Object

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

      • testName

        private final java.lang.String testName
      • pageNumber

        private final int pageNumber
      • expected

        private final java.awt.image.BufferedImage expected
      • actual

        private final java.awt.image.BufferedImage actual
      • differences

        private final boolean differences
    • Constructor Detail

      • TestImage

        private TestImage​(java.lang.String test,
                          int pageNo,
                          java.awt.image.BufferedImage exp,
                          java.awt.image.BufferedImage act,
                          boolean hasDifferences)
    • Method Detail

      • getPageNumber

        public int getPageNumber()
        Returns:
        the page number.
      • getExpected

        public java.awt.image.BufferedImage getExpected()
        Get the expected rendered image.
        Returns:
        the expected image, should never be null.
      • getActual

        public java.awt.image.BufferedImage getActual()
        Get the actual rendered image.
        Returns:
        the actual image, may be null if expected has more pages than actual
      • createDiff

        public java.awt.image.BufferedImage createDiff()
        Creates a diff image to quickly spot differences between expected and actual. NOTE: May be expensive for large images.
        Returns:
        the diff image.
      • hasDifferences

        public boolean hasDifferences()
        Should usually be called before createDiff().
        Returns:
        true if the images are different. Precaulculated.