Class Auto32Tests


  • public class Auto32Tests
    extends ModelTests
    Run the Ptolemy model tests in the auto/ directory using JUnit.

    This test must be run from the directory that contains the auto/ directory, for example:

     (cd ~/ptII/ptolemy/actor/lib/io/test; java -classpath ${PTII}:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.3.0.jar org.junit.runner.JUnitCore ptolemy.util.test.junit.AutoTests)
     

    This test uses JUnitParams from http://code.google.com/p/junitparams/, which is released under Apache License 2.0.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Detail

      • Auto32Tests

        public Auto32Tests()
    • Method Detail

      • modelValues

        public java.lang.Object[] modelValues()
                                       throws java.io.IOException
        Return a two dimensional array of arrays of strings that name the model to be executed. If auto/ does not exist, or does not contain files that end with .xml or .moml, return a list with one element that contains the value of the THERE_ARE_NO_AUTO_TESTS variable.
        Overrides:
        modelValues in class ModelTests
        Returns:
        The List of model names in auto/
        Throws:
        java.io.IOException - If there is a problem accessing the auto/ directory.
      • RunModel

        public void RunModel​(java.lang.String fullPath)
                      throws java.lang.Throwable
        Execute a model. Timeout after 140000 ms. For information about how this class is used in the Travis build, see https://wiki.eecs.berkeley.edu/ptexternal/Main/Travis.
        Parameters:
        fullPath - The full path to the model file to be executed. If the fullPath ends with the value of the ModelTests.THERE_ARE_NO_AUTO_TESTS, then the method returns immediately.
        Throws:
        java.lang.Throwable - If thrown while executing the model.
      • modelFileIsOK

        public boolean modelFileIsOK​(java.lang.String fullPath)
        Return true if the model should be run. This is a hack to avoid a problem where certain models interact badly with the Cobertura code coverage tool.
        Parameters:
        fullPath - The full path of the model to be executed
        Returns:
        true if the model should be run.