Class 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 Detail

      • changeRequest

        public ChangeRequest changeRequest
        ChangeRequest that modifies the system.
    • 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 interface ChangeListener
        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 interface ChangeListener
        Parameters:
        change - The change that was attempted or null if the change was not done via a ChangeRequest.
        exception - The exception that resulted.
      • 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.