Class ExportImageJUnitTest


  • public class ExportImageJUnitTest
    extends java.lang.Object
    Test out the Export Image facility, which saves as gif, png, pdf etc.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void _exportImageTest​(java.lang.String modelFileName)
      Test the Export Image facility by saving images and reading them back in.
      protected void _sleep()
      Sleep the current thread, which is usually not the Swing Event Dispatch Thread.
      static void main​(java.lang.String[] args)
      Test the ExportImage facility.
      void runModulation()
      Test the layout facility by reading in a models, stripping out the graphical elements, laying out the models, comparing the new results with the known good results and then doing undo and redo.
      • Methods inherited from class java.lang.Object

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

      • ExportImageJUnitTest

        public ExportImageJUnitTest()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Test the ExportImage facility.

        To run, use:

           java -classpath \
              $PTII:$PTII/lib/junit-4.8.2.jar: \
              ptolemy.vergil.basic.test.junit.ExportImageJUnitTest
          
        Parameters:
        args - Not used.
      • runModulation

        public void runModulation()
                           throws java.lang.Throwable
        Test the layout facility by reading in a models, stripping out the graphical elements, laying out the models, comparing the new results with the known good results and then doing undo and redo.
        Throws:
        java.lang.Throwable - If there is a problem reading or exporting the image.
      • _exportImageTest

        protected void _exportImageTest​(java.lang.String modelFileName)
                                 throws java.lang.Throwable
        Test the Export Image facility by saving images and reading them back in.

        This is the main entry point for Export Image tests.

        The caller of this method need notbe in the Swing Event Thread.

        Parameters:
        modelFileName - The file name of the test model.
        Throws:
        java.lang.Throwable - If the file name cannot be read or laid out.
      • _sleep

        protected void _sleep()
        Sleep the current thread, which is usually not the Swing Event Dispatch Thread.