sofya.ed
Interface BranchEventListener

All Known Implementing Classes:
SequenceTraceWriter

public interface BranchEventListener

A branch event listener is notified by an event dispatcher each time a branch is executed.

Version:
03/17/2006
Author:
Alex Kinneer

Method Summary
 void callBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that a call branch was executed.
 void commitEventStream(int streamId)
          Notification that a branch event stream has completed.
 void entryBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that an entry branch was executed.
 void ifBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that an if branch was executed.
 void initialize()
          Initializes the event listener.
 void methodEnterEvent(java.lang.String classAndSignature, int branchCount)
          Notification that a new method has been entered.
 void newEventStream(int streamId)
          Notification that a new branch event stream is starting.
 void otherBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that a summary branch was executed.
 void switchBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that a switch branch was executed.
 void throwBranchExecuteEvent(java.lang.String classAndSignature, int id)
          Notification that a throws branch was executed.
 

Method Detail

initialize

void initialize()

Initializes the event listener. Listeners 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 branch event stream is starting.

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

commitEventStream

void commitEventStream(int streamId)

Notification that a branch event stream has completed.

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

methodEnterEvent

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

Notification that a new method has been entered.

This method provides the listener an opportunity to perform some action before beginning processing of branch events in a new method, such as setting up data structures.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method entered.
branchCount - The number of branches in the method.

ifBranchExecuteEvent

void ifBranchExecuteEvent(java.lang.String classAndSignature,
                          int id)

Notification that an if branch was executed.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.

switchBranchExecuteEvent

void switchBranchExecuteEvent(java.lang.String classAndSignature,
                              int id)

Notification that a switch branch was executed.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.

throwBranchExecuteEvent

void throwBranchExecuteEvent(java.lang.String classAndSignature,
                             int id)

Notification that a throws branch was executed.

Note that a particular throws statement is not considered a branch if the control flow graph builder determines that only one type of exception can ever be thrown.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.

callBranchExecuteEvent

void callBranchExecuteEvent(java.lang.String classAndSignature,
                            int id)

Notification that a call branch was executed.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.

entryBranchExecuteEvent

void entryBranchExecuteEvent(java.lang.String classAndSignature,
                             int id)

Notification that an entry branch was executed.

Method entry is not actually a branch, however, this event is provided for the benefit of analyses that may wish to have information about method entry inlined in the event stream as a type-compatible entity.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.

otherBranchExecuteEvent

void otherBranchExecuteEvent(java.lang.String classAndSignature,
                             int id)

Notification that a summary branch was executed.

A summary branch is used to capture any branching of execution that causes exit from the currently executing method. This is normally associated with asynchronous exceptions and runtime exceptions that can potentially be raised at too many locations to be practically encoded in a control flow representation.

Parameters:
classAndSignature - Concatenation of the fully qualified class name, method name, and JNI signature of the method in which the branch was executed.
id - Identifier of the branch that was executed. Correlates to the branch identifiers reported in a CFG.