* Test method for {@link javax.faces.component.UIData#broadcast(javax.faces.event.FacesEvent)}.
*/
public void testBroadcastFacesEvent()
{
// create event mock
final FacesEvent originalEvent = _mocksControl.createMock(FacesEvent.class);
// create the component for the event
UIComponent eventComponent = new UICommand()
{
@Override
public void broadcast(FacesEvent event)
throws AbortProcessingException
{
// the event must be the originalEvent
assertEquals(originalEvent, event);
// the current row index must be the row index from the time the event was queued
assertEquals(5, _testImpl.getRowIndex());
// the current component must be this (pushComponentToEL() must have happened)
assertEquals(this, UIComponent.getCurrentComponent(facesContext));
// to be able to verify that broadcast() really has been called
getAttributes().put("broadcastCalled", Boolean.TRUE);
}
};
// set component on event
EasyMock.expect(originalEvent.getComponent()).andReturn(eventComponent).anyTimes();
// set phase on event
EasyMock.expect(originalEvent.getPhaseId()).andReturn(PhaseId.INVOKE_APPLICATION).anyTimes();
_mocksControl.replay();
// set PhaseId for event processing
facesContext.setCurrentPhaseId(PhaseId.INVOKE_APPLICATION);
// set row index for event