Package ptolemy.util.test.junit
Class AutoTests
- java.lang.Object
-
- ptolemy.util.test.junit.ModelTests
-
- ptolemy.util.test.junit.AutoTests
-
- Direct Known Subclasses:
AutoNameArchTests
public class AutoTests extends ModelTests
Run the Ptolemy model tests in the auto/ directory using JUnit.This test must be run from the directory that contains the auto/ directory, for example:
(cd ~/ptII/ptolemy/actor/lib/io/test; java -classpath ${PTII}:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.3.0.jar org.junit.runner.JUnitCore ptolemy.util.test.junit.AutoTests)
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:
- Red (cxh)
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Class<?>
_jsAccessorClass
The org.terraswarm.accessor.JSAccessor class, which is tested by reloading Accessors.protected static java.lang.reflect.Method
_jsAccessorReloadAllAccessorsMethod
The method that reloads all the accessors in a CompositeEntity.-
Fields inherited from class ptolemy.util.test.junit.ModelTests
_applicationClass, _applicationConstructor, _applicationToplevelMethod, THERE_ARE_NO_AUTO_ARCH_TESTS, THERE_ARE_NO_AUTO_TESTS, THERE_ARE_NO_KNOWN_FAILED_TESTS
-
-
Constructor Summary
Constructors Constructor Description AutoTests()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
afterClass()
If the VertxHelperBase class is present, then invoke the closeVertx() method so that this process does not wait around for the Vert.x threads.static void
delayIfNecessary(java.lang.String fullPath)
If the fullPath is a hlacerti or accessor demo, then delay so that the system can stabilize.boolean
modelFileIsOK(java.lang.String fullPath)
Return true if the model should be run.void
RunModel(java.lang.String fullPath)
Execute a model and time out after 900000 ms.-
Methods inherited from class ptolemy.util.test.junit.ModelTests
modelValues, modelValues
-
-
-
-
Field Detail
-
_jsAccessorClass
protected static java.lang.Class<?> _jsAccessorClass
The org.terraswarm.accessor.JSAccessor class, which is tested by reloading Accessors.
-
_jsAccessorReloadAllAccessorsMethod
protected static java.lang.reflect.Method _jsAccessorReloadAllAccessorsMethod
The method that reloads all the accessors in a CompositeEntity.
-
-
Method Detail
-
afterClass
public static void afterClass()
If the VertxHelperBase class is present, then invoke the closeVertx() method so that this process does not wait around for the Vert.x threads.
-
delayIfNecessary
public static void delayIfNecessary(java.lang.String fullPath)
If the fullPath is a hlacerti or accessor demo, then delay so that the system can stabilize.- Parameters:
fullPath
- The forward slash separated path of the demo.
-
RunModel
public void RunModel(java.lang.String fullPath) throws java.lang.Throwable
Execute a model and time out after 900000 ms. For information about how this class is used in the Travis build, see https://wiki.eecs.berkeley.edu/ptexternal/Main/Travis.- Parameters:
fullPath
- The full path to the model file to be executed. If the fullPath ends with the value of theModelTests.THERE_ARE_NO_AUTO_TESTS
, then the method returns immediately.- Throws:
java.lang.Throwable
- If thrown while executing the model.
-
modelFileIsOK
public boolean modelFileIsOK(java.lang.String fullPath)
Return true if the model should be run. This is a hack to avoid a problem where certain models interact badly with the Cobertura code coverage tool or with Travis.- Parameters:
fullPath
- The full path of the model to be executed- Returns:
- true if the model should be run.
-
-