edu.csus.ecs.pc2.api.listener

## Interface ITestRunListener

-     public interface ITestRunListener

  This interface describes the set of methods that any Test Run Listener must implement.

  These methods are invoked when a Test Run has been added, removed (marked as deleted), testing completed, or updated in the contest. A client utilizing the PC2 API can implement this interface and add itself to the contest as a Test Run Listener, and therefore arrange to be notified when any Test Runs are added to, modified, or removed from the contest.

  Test Run Flow is:

  1. `testRunSubmitted(IRun)`
  2. `testRunTestingCompleted(IRun)` when test run results are available.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `testRunDeleted(IRun run)` Invoked when an existing Test Run has been deleted from the contest (marked as deleted by the Contest Administrator).
    `void` | `testRunSubmitted(IRun run)` Invoked when a new Test Run has been added to the contest.
    `void` | `testRunTestingCompleted(IRun run)` Invoked when the Test Run done and results are available.
    `void` | `testRunUpdated(IRun run, boolean isFinal)` Invoked when an existing Test Run has been updated (modified) in some way.

- - ### Method Detail

    - #### testRunSubmitted

          void testRunSubmitted(IRun run)

      Invoked when a new Test Run has been added to the contest.

      Typically this means that a Test Run has been submitted by a team; it may also may be caused by a remote server in a multi-site contest sending its run(s) to the local server.

      The added Test Run may have been originally entered into the contest on either the local server (the server to which this client is connected) or on a remote server.

      Parameters:
        `run` - the `IRun` that has been added to the contest

    - #### testRunDeleted

          void testRunDeleted(IRun run)

      Invoked when an existing Test Run has been deleted from the contest (marked as deleted by the Contest Administrator).
      Parameters:
        `run` - the deleted `IRun`

    - #### testRunUpdated

          void testRunUpdated(IRun run,
                              boolean isFinal)

      Invoked when an existing Test Run has been updated (modified) in some way.

      Typically a `runUpdated()` invocation occurs when either

      - The Contest Administrator changes a setting (such as the elapsed time or the assigned `IJudgement`) in the test run.
      Parameters:
        `run` - the `IRun` which has been changed
        `isFinal` - true if this is a action for a final Judgement (not applicable for Test Runs)

    - #### testRunTestingCompleted

          void testRunTestingCompleted(IRun run)

      Invoked when the Test Run done and results are available.
      Parameters:
        `run` - the `IRun` which has been tested that contains resting results.
      See Also:
        `IRun#getTestRunResults()`