import java.util.List;
import java.util.Map;
-
/**
* Tracks the occurence of certain events in a test environment. Threads in a
* test environment tell the event tracker of the occurrence of certain events
* using {@link #eventOccurred(Event)}. Test code inspects the events sent by a
* thread using {@link #isEventSent(Thread, Event)}.
- *
+ *
* A record is kept of every event which is sent. Therefore, the occurrence of a
* new event does not erase a previously sent event.
- *
+ *
* @param <Event>
* Type of event sent from test code. Usually String will be
* sufficient. The event type must provide a sensible implementation
* of {@link java.lang.Object#equals(java.lang.Object)}.
- *
+ *
* @author Erik Brakkee
*/
public class EventTracker<Event> {
/**
* Constructs the event tracker.
- *
+ *
*/
public EventTracker() {
clear();
/**
* Called by a thread to inform that an event has occurred.
- *
+ *
* @param aEvent
* Event that was sent.
*/
/**
* Checks if a specific event has happened in a specific thread.
- *
+ *
* @param aThread
* Thread to check.
* @param aEvent
/**
* Gets the events for a thread in the order they were sent
- *
+ *
* @param aThread
* Thread to get events for.
* @return Events that were sent. A zero-sized array is returned if no
}
/**
- * Gets the number of times an event was sent summed up
- * over all threads.
- *
+ * Gets the number of times an event was sent summed up over all threads.
+ *
* @param aEvent
* Event to check.
* @return Number of times it was reached.
/**
* Gets the total event count over all threads.
+ *
* @return
*/
public synchronized int getEventCount() {