sofya.ed
Interface CoverageListenerManager

All Known Implementing Classes:
TraceHandler

public interface CoverageListenerManager

A coverage listener manager acts as a server to attach a single coverage listener to a ProgramEventDispatcher using a coverage processing strategy during dispatch of coverage events for a particular method. This is a special design to provide maximum performance during coverage event monitoring. If it is desired to dispatch coverage events to multiple coverage listeners simultaneously, the coverage listener manager can serve listeners that perform this service by relaying events to listeners of their own.

Version:
03/16/2006
Author:
Alex Kinneer
See Also:
BlockCoverageProcessingStrategy, BranchCoverageProcessingStrategy, JUnitBlockCoverageProcessingStrategy, JUnitBranchCoverageProcessingStrategy

Method Summary
 void commitCoverageResults(int streamId)
          Notification that an event stream has completed.
 BlockCoverageListener getBlockCoverageListener(java.lang.String classAndSignature)
          Gets the basic block listener for a particular method.
 BranchCoverageListener getBranchCoverageListener(java.lang.String classAndSignature)
          Gets the branch listener for a particular method.
 void initialize()
          Initializes the coverage listener manager.
 void initializeBlockListener(java.lang.String classAndSignature, int blockCount)
          Notification to initialize a basic block listener for a method.
 void initializeBranchListener(java.lang.String classAndSignature, int branchCount)
          Notification to initialize a branch listener for a method.
 void newEventStream(int streamId)
          Notification that a new event stream is starting.
 

Method Detail

initialize

void initialize()

Initializes the coverage listener manager. Listener managers that need to perform configuration or setup of state that will persist across multiple event streams should implement this method.

This method is called automatically by a JUnitEventDispatcher prior to beginning execution of test cases. It is the responsibility of the applications using other event dispatchers to call this method at the appropriate time.


newEventStream

void newEventStream(int streamId)

Notification that a new event stream is starting.

Parameters:
streamId - Identifier associated with the event stream, such as a test case number.

commitCoverageResults

void commitCoverageResults(int streamId)

Notification that an event stream has completed.

Parameters:
streamId - Identifier associated with the finished event stream, such as a test case number.

initializeBlockListener

void initializeBlockListener(java.lang.String classAndSignature,
                             int blockCount)

Notification to initialize a basic block listener for a method.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which a basic block listener is to be initialized.
blockCount - The number of basic blocks in the method.

initializeBranchListener

void initializeBranchListener(java.lang.String classAndSignature,
                              int branchCount)

Notification to initialize a branch listener for a method.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which a branch listener is to be initialized.
branchCount - The number of basic blocks in the method.

getBlockCoverageListener

BlockCoverageListener getBlockCoverageListener(java.lang.String classAndSignature)

Gets the basic block listener for a particular method.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which a basic block listener is to be retrieved.

getBranchCoverageListener

BranchCoverageListener getBranchCoverageListener(java.lang.String classAndSignature)

Gets the branch listener for a particular method.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which a branch listener is to be retrieved.