Class ExportModelJUnitTest

  • Direct Known Subclasses:
    ExportModelJUnitTestBatch

    public class ExportModelJUnitTest
    extends java.lang.Object
    JUnit test that exports the demos.

    To run these tests, use:

     cd $PTII
     ./configure
     ant test.single -Dtest.name=ptolemy.vergil.basic.export.test.junit.ExportModelJUnitTest -Djunit.formatter=plain
     
    or
     cd $PTII/ptolemy/vergil/basic/export/test/junit/;
     export CLASSPATH=${PTII}:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.3.0.jar${PTII}:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.3.0.jar;
     export JAVAFLAGS="-Dptolemy.ptII.exportHTML.linkToJNLP=true -Dptolemy.ptII.exportHTML.usePtWebsite=true"
     $PTII/bin/ptinvoke org.junit.runner.JUnitCore ptolemy.vergil.basic.export.test.junit.ExportModelJUnitTest
     

    Or, if you want to debug this to find leaks, try removing most of the models from $PTII/ptolemy/configs/doc/models.txt and then running the above exports followed by $PTII/bin/ptjacl and then:

     set cmdArgs [java::new {java.lang.String[]} 1 {ptolemy.vergil.basic.export.test.junit.ExportModelJUnitTest}]
     java::call org.junit.runner.JUnitCore main $cmdArgs
     

    Then a few models will export and leaks can be checked.

    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:
    Green (cxh)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static int _getCount()
      Get the number of times RunExportModel has been invoked.
      protected static void _incrementCount()
      Increment the count of the number of times RunExportModel has been invoked.
      java.lang.Object[] demos()
      Return a two dimensional array of arrays of strings that name the model to be exported.
      void RunExportModel​(java.lang.String modelPath)
      Export a model.
      • Methods inherited from class java.lang.Object

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

      • ExportModelJUnitTest

        public ExportModelJUnitTest()
    • Method Detail

      • RunExportModel

        public void RunExportModel​(java.lang.String modelPath)
                            throws java.lang.Throwable
        Export a model.
        Parameters:
        modelPath - The model to be exported. The code is exported to the directory contained by the model.
        Throws:
        java.lang.Throwable - If there is a problem reading or exporting the model.
      • demos

        public java.lang.Object[] demos()
                                 throws java.io.IOException
        Return a two dimensional array of arrays of strings that name the model to be exported.
        Returns:
        a two dimension array of arrays of strings that name the models to be exported.
        Throws:
        java.io.IOException - If there is a problem accessing the directory.
      • _getCount

        protected static int _getCount()
        Get the number of times RunExportModel has been invoked.
        Returns:
        the number of times RunExportModel has been invoked.
      • _incrementCount

        protected static void _incrementCount()
        Increment the count of the number of times RunExportModel has been invoked.