Class UnloadModelTest

  • All Implemented Interfaces:
    ExecutionListener, ChangeListener

    public class UnloadModelTest
    extends MoMLSimpleApplication
    Test unloading a model.

    This class is used to test loading and unlooading a model. When used with a memory profiler like JProfiler, we can look for leaks. To run the test, use:

    java -classpath $PTII ptolemy.moml.test.UnloadModelTest ../demo/test.xml
     
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Brian Hudson, Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Detail

      • parser

        public MoMLParser parser
        The MoMLParser that is created and then destroyed.
      • toplevel

        public CompositeActor toplevel
        The toplevel model that is created and then destroyed.
      • workspace

        public Workspace workspace
        The workspace in which the model and Manager are created.
    • Constructor Detail

      • UnloadModelTest

        public UnloadModelTest​(java.lang.String xmlFileName)
                        throws java.lang.Throwable
        Parse the xml file and run it.
        Parameters:
        xmlFileName - A string that refers to an MoML file that contains a Ptolemy II model. The string should be a relative pathname.
        Throws:
        java.lang.Throwable - If there was a problem parsing or running the model.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Load a model and then unload it.

        Typically, this class is invoked with something like:

          java -classpath $PTII ptolemy.moml.test.UnloadModelTest ../demo/test.xml
          
        Parameters:
        args - The first argument is the name of the file to be loaded.
      • memory

        public static java.lang.String memory()
        Return the amount of memory used.
        Returns:
        A string that describes the amount of memory.