use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class ActionExecutingEventTest method testMatchesSameAction.
@Test
public void testMatchesSameAction() {
ActionExecutingEvent event = new ActionExecutingEvent("something");
Assert.assertTrue("Same action wasn't matched!", event.matches(new ActionExecutingEvent("something")));
}
use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class LegacyNotificationDispatcher method getEvents.
@Override
public List<Event> getEvents() {
return new ArrayList<Event>() {
{
add(new DocumentDeletedEvent());
add(new DocumentCreatedEvent());
add(new DocumentUpdatedEvent());
add(new DocumentDeletingEvent());
add(new DocumentCreatingEvent());
add(new DocumentUpdatingEvent());
add(new ActionExecutedEvent());
add(new ActionExecutingEvent());
}
};
}
use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class ActionExecutingEventTest method testDoesntMatchDifferentCaseAction.
@Test
public void testDoesntMatchDifferentCaseAction() {
ActionExecutingEvent event = new ActionExecutingEvent("something");
Assert.assertFalse("Action matching was case insensitive!", event.matches(new ActionExecutingEvent("SomeThing")));
}
use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class ActionExecutingEventTest method testCancelWithReason.
@Test
public void testCancelWithReason() {
ActionExecutingEvent event = new ActionExecutingEvent("something");
event.cancel("Testing reason");
Assert.assertEquals("Cancelling reason was lost!", "Testing reason", event.getReason());
}
use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class ActionExecutingEventTest method testHashCodeWithEmptyAction.
@Test
public void testHashCodeWithEmptyAction() {
ActionExecutingEvent event = new ActionExecutingEvent("");
Assert.assertTrue("Hashcode for empty string action wasn't zero!", event.hashCode() == 0);
}
Aggregations