Package ptolemy.util.test.junit
Class ModelTests
- java.lang.Object
-
- ptolemy.util.test.junit.ModelTests
-
- Direct Known Subclasses:
Auto32Tests
,AutoCGTests
,AutoTests
,ModelKnownFailedTests
public class ModelTests extends java.lang.Object
Base class for tests that use models in the auto/ directory.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Class<?>
_applicationClass
The application class.protected static java.lang.reflect.Constructor
_applicationConstructor
The application constructor.protected static java.lang.reflect.Method
_applicationToplevelMethod
The application toplevel method.protected static java.lang.String
THERE_ARE_NO_AUTO_ARCH_TESTS
A special string that is passed when there are no known failed tests.protected static java.lang.String
THERE_ARE_NO_AUTO_TESTS
A special string that is passed when there are no known failed tests.protected static java.lang.String
THERE_ARE_NO_KNOWN_FAILED_TESTS
A special string that is passed when there are no known failed tests.
-
Constructor Summary
Constructors Constructor Description ModelTests()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]
modelValues()
Return a two dimensional array of arrays of strings that name the model to be executed.java.lang.Object[]
modelValues(java.lang.String directory, java.lang.String message)
Return a two dimensional array of arrays of strings that name the model to be executed.
-
-
-
Field Detail
-
_applicationClass
protected static java.lang.Class<?> _applicationClass
The application class. We use reflection here to avoid false dependencies if auto/ does not exist. In derived classes, _applicationClass should be initialized in right before it is to be used. It should not be initialized in setup() so that we can avoid dependencies on MoMLSimpleApplication.
-
_applicationConstructor
protected static java.lang.reflect.Constructor _applicationConstructor
The application constructor.
-
_applicationToplevelMethod
protected static java.lang.reflect.Method _applicationToplevelMethod
The application toplevel method.
-
THERE_ARE_NO_AUTO_TESTS
protected static final java.lang.String THERE_ARE_NO_AUTO_TESTS
A special string that is passed when there are no known failed tests. This is necessary to avoid an exception in the JUnitParameters.- See Also:
- Constant Field Values
-
THERE_ARE_NO_AUTO_ARCH_TESTS
protected static final java.lang.String THERE_ARE_NO_AUTO_ARCH_TESTS
A special string that is passed when there are no known failed tests. This is necessary to avoid an exception in the JUnitParameters.- See Also:
- Constant Field Values
-
THERE_ARE_NO_KNOWN_FAILED_TESTS
protected static final java.lang.String THERE_ARE_NO_KNOWN_FAILED_TESTS
A special string that is passed when there are no known failed tests. This is necessary to avoid an exception in the JUnitParameters.- See Also:
- Constant Field Values
-
-
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.- Returns:
- The List of model names in auto/
- Throws:
java.io.IOException
- If there is a problem accessing the auto/ directory.
-
modelValues
public java.lang.Object[] modelValues(java.lang.String directory, java.lang.String message) throws java.io.IOException
Return a two dimensional array of arrays of strings that name the model to be executed. If directory does not exist, or does not contain files that end with .xml or .moml, return a list with the value of the message parameter.- Parameters:
directory
- The directory, which is usually either "auto/" or "auto/knownFailedTests/".message
- The message to use if the directory contains no *.xml or *.moml files.- Returns:
- The List of model names in the directory.
- Throws:
java.io.IOException
- If there is a problem accessing the directory.
-
-