use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.
the class ActionExecutedEventTest method testEqualsWithNull.
@Test
public void testEqualsWithNull() {
ActionExecutedEvent event = new ActionExecutedEvent("something");
Assert.assertFalse("null was equal!", event.equals(null));
}
use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.
the class ActionExecutedEventTest method testDoesntMatchDifferentTypeOfAction.
@Test
public void testDoesntMatchDifferentTypeOfAction() {
ActionExecutedEvent event = new ActionExecutedEvent("something");
Assert.assertFalse("A different type of action was matched!", event.matches(new ActionExecutingEvent("something")));
}
use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.
the class ActionExecutedEventTest method testWildcardActionDoesntEqualOtherActions.
@Test
public void testWildcardActionDoesntEqualOtherActions() {
ActionExecutedEvent event = new ActionExecutedEvent("something");
Assert.assertFalse("Wildcard action equals another action!", new ActionExecutedEvent().equals(event));
}
use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.
the class LegacyEventDispatcher method getEvents.
@Override
public List<Event> getEvents() {
return new ArrayList<Event>() {
{
add(new DocumentDeletedEvent());
add(new DocumentCreatedEvent());
add(new DocumentUpdatedEvent());
add(new ActionExecutedEvent());
}
};
}
use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.
the class ActionExecutionEventConverter method toRemote.
@Override
public boolean toRemote(LocalEventData localEvent, RemoteEventData remoteEvent) {
if (localEvent.getEvent() instanceof ActionExecutedEvent || localEvent.getEvent() instanceof ActionExecutingEvent) {
AbstractActionExecutionEvent event = (AbstractActionExecutionEvent) localEvent.getEvent();
if (this.actions.contains(event.getActionName())) {
// fill the remote event
remoteEvent.setEvent(event);
remoteEvent.setSource(serializeXWikiDocument((XWikiDocument) localEvent.getSource()));
remoteEvent.setData(serializeXWikiContext((XWikiContext) localEvent.getData()));
}
return true;
}
return false;
}
Aggregations