public class UnloadModelTest extends MoMLSimpleApplication
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
Modifier and Type | Class and Description |
---|---|
class |
UnloadModelTest.UnloadThread
Wait for the run to finish and the unload the model.
|
Modifier and Type | Field and 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.
|
_activeCount, _executionFinishedOrError, _manager, _parser, _sawThrowable, _toplevel, _workspace
Constructor and Description |
---|
UnloadModelTest(java.lang.String xmlFileName)
Parse the xml file and run it.
|
Modifier and Type | Method and 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.
|
changeExecuted, changeFailed, cleanup, closeVertx, executionError, executionFinished, managerStateChanged, rerun, toplevel, waitForFinish
public MoMLParser parser
public CompositeActor toplevel
public UnloadModelTest(java.lang.String xmlFileName) throws java.lang.Throwable
xmlFileName
- A string that refers to an MoML file that
contains a Ptolemy II model. The string should be
a relative pathname.java.lang.Throwable
- If there was a problem parsing
or running the model.public static void main(java.lang.String[] args)
Typically, this class is invoked with something like:
java -classpath $PTII ptolemy.moml.test.UnloadModelTest ../demo/test.xml
args
- The first argument is the name of the file to be loaded.public static java.lang.String memory()