sofya.ed.structural
Interface JUnitProcessingStrategy

All Superinterfaces:
ActiveComponent
All Known Implementing Classes:
AbstractJUnitProcessingStrategy, JUnitBlockCoverageProcessingStrategy, JUnitBlockSequenceProcessingStrategy, JUnitBranchCoverageProcessingStrategy, JUnitBranchSequenceProcessingStrategy

public interface JUnitProcessingStrategy
extends ActiveComponent

A JUnit processing strategy implements a strategy to be used by a JUnitEventDispatcher to receive probes received from a subject instrumented for execution in a JUnit test runner and dispatch them as events.

Version:
03/15/2006
Author:
Alex Kinneer

Method Summary
 void checkError()
          Checks whether any exceptions have been raised during processing, and rethrows the exception for handling if so.
 void endTest(int testNum)
          Notifies the processor that a test case has finished executing; this is normally relayed to attached listeners.
 SConstants.TraceObjectType getObjectType()
          Gets the type of structural object for which this processor can receive probes.
 void newTest(int testNum)
          Notifies the processor that a new test case is about to execute; this is normally relayed to attached listeners.
 void processData(java.lang.Object instArray, java.lang.String mSig, int fromIndex, int toIndex)
          Instrumentation data received from the subject.
 void setInstrumentationMode(JUnitEventDispatcher.InstrumentationMode instMode)
          Notifies the processor of the instrumentation mode detected in the subject.
 void setMethodObjectCount(java.lang.String mSig, int objCount)
          Notification received from the instrumentated subject indicating a structural object count for a method.
 void setup()
          Notifies the processor to perform any setup required to receive probes from the subject.
 
Methods inherited from interface sofya.ed.structural.ActiveComponent
configure, isReady, register, release, reset
 

Method Detail

setup

void setup()
Notifies the processor to perform any setup required to receive probes from the subject.


newTest

void newTest(int testNum)
Notifies the processor that a new test case is about to execute; this is normally relayed to attached listeners.

Parameters:
testNum - The number of the test case about to execute.

endTest

void endTest(int testNum)
Notifies the processor that a test case has finished executing; this is normally relayed to attached listeners.

Parameters:
testNum - The number of the test case that finished executing.

setMethodObjectCount

void setMethodObjectCount(java.lang.String mSig,
                          int objCount)
Notification received from the instrumentated subject indicating a structural object count for a method.

Parameters:
mSig - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which an object count is being reported.
objCount - The number of structural objects in the method.

processData

void processData(java.lang.Object instArray,
                 java.lang.String mSig,
                 int fromIndex,
                 int toIndex)
Instrumentation data received from the subject.

This is a mapping of the actual instrumentation method called from the subject. The data provided varies depending on the the type of instrumentation applied.

Parameters:
instArray - Array of instrumentation data. The type and contents depend on the type of instrumentation applied.
mSig - Concatenation of the fully qualified class name, method name, and JNI signature of the method for which an object count is being reported.
fromIndex - Start index of the segment of the array to be processed on this invocation.
toIndex - End index of the segment of the array to be processed on this invocation.

getObjectType

SConstants.TraceObjectType getObjectType()
Gets the type of structural object for which this processor can receive probes.

This is used by the JUnit event dispatcher for certain configuration activities.

Returns:
The type of structural object for which this processor knows how to receive probes.

setInstrumentationMode

void setInstrumentationMode(JUnitEventDispatcher.InstrumentationMode instMode)
Notifies the processor of the instrumentation mode detected in the subject.

Parameters:
instMode - A callback object to be used to retrieve the instrumentation mode detected by the JUnit event dispatcher.

checkError

void checkError()
                throws java.lang.Exception
Checks whether any exceptions have been raised during processing, and rethrows the exception for handling if so. This method returns without action if there are no errors.

Throws:
java.lang.Exception - For any exception that was raised and stored.