Package ptolemy.moml.test
Class UnloadModelTest
- java.lang.Object
-
- ptolemy.moml.MoMLSimpleApplication
-
- ptolemy.moml.test.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
UnloadModelTest.UnloadThread
Wait for the run to finish and the unload the model.
-
Field Summary
Fields Modifier and Type Field Description MoMLParser
parser
The MoMLParser that is created and then destroyed.CompositeActor
toplevel
The toplevel model that is created and then destroyed.Workspace
workspace
The workspace in which the model and Manager are created.-
Fields inherited from class ptolemy.moml.MoMLSimpleApplication
_activeCount, _executionFinishedOrError, _manager, _parser, _sawThrowable, _toplevel, _workspace
-
-
Constructor Summary
Constructors Constructor Description UnloadModelTest(java.lang.String xmlFileName)
Parse the xml file and run it.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Load a model and then unload it.static java.lang.String
memory()
Return the amount of memory used.-
Methods inherited from class ptolemy.moml.MoMLSimpleApplication
changeExecuted, changeFailed, cleanup, closeVertx, executionError, executionFinished, managerStateChanged, rerun, toplevel, waitForFinish
-
-
-
-
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.
-
-