Package ptolemy.kernel.util.test.system
Class ChangeRequestTest
- java.lang.Object
-
- ptolemy.kernel.util.test.system.ChangeRequestTest
-
- All Implemented Interfaces:
ChangeListener
public class ChangeRequestTest extends java.lang.Object implements ChangeListener
Test for ChangeRequest. This test is in the system directory because it uses packages outside of kernel.util.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Edward A. Lee, Contributor: Christopher Hylands
- See Also:
ChangeRequest
- Pt.AcceptedRating:
- Red (reviewmoderator)
- Pt.ProposedRating:
- Red (eal)
-
-
Field Summary
Fields Modifier and Type Field Description ChangeRequest
changeRequest
ChangeRequest that modifies the system.
-
Constructor Summary
Constructors Constructor Description ChangeRequestTest()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed by doing nothing.void
changeFailed(ChangeRequest change, java.lang.Exception exception)
React to a change request that has resulted in an exception.java.util.Enumeration
finish()
Finish a run.void
insertFeedback()
Insert a feedback loop.void
mutate()
Mutate.ChangeRequest
mutateBadChangeRequest()
Create a change request that always throws an exception.ChangeRequest
mutateConst2ChangeRequest()
Create a change request that sets const to 2.0.void
start()
Start a run.void
waitForCompletionTask()
-
-
-
Field Detail
-
changeRequest
public ChangeRequest changeRequest
ChangeRequest that modifies the system.
-
-
Constructor Detail
-
ChangeRequestTest
public ChangeRequestTest() throws IllegalActionException, NameDuplicationException
Constructor.
-
-
Method Detail
-
changeExecuted
public void changeExecuted(ChangeRequest change)
React to a change request has been successfully executed by doing nothing. This method is called after a change request has been executed successfully. In this class, we do nothing.- Specified by:
changeExecuted
in interfaceChangeListener
- Parameters:
change
- The change that has been executed, or null if the change was not done via a ChangeRequest.
-
changeFailed
public void changeFailed(ChangeRequest change, java.lang.Exception exception)
React to a change request that has resulted in an exception. This method is called after a change request was executed, but during the execution in an exception was thrown. This method throws a runtime exception with a description of the original exception.- Specified by:
changeFailed
in interfaceChangeListener
- Parameters:
change
- The change that was attempted or null if the change was not done via a ChangeRequest.exception
- The exception that resulted.
-
finish
public java.util.Enumeration finish() throws KernelException
Finish a run. Return the results.- Throws:
KernelException
-
insertFeedback
public void insertFeedback()
Insert a feedback loop.
-
mutate
public void mutate()
Mutate.
-
waitForCompletionTask
public void waitForCompletionTask()
-
mutateBadChangeRequest
public ChangeRequest mutateBadChangeRequest()
Create a change request that always throws an exception.
-
mutateConst2ChangeRequest
public ChangeRequest mutateConst2ChangeRequest()
Create a change request that sets const to 2.0.
-
start
public void start() throws KernelException
Start a run.- Throws:
KernelException
-
-