Search in sources :

Example 21 with ActionExecutedEvent

use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.

the class ActionExecutingEventTest method testDoesntEqualDifferentTypeOfAction.

@Test
public void testDoesntEqualDifferentTypeOfAction() {
    ActionExecutingEvent event = new ActionExecutingEvent("something");
    Assert.assertFalse("Same object isn't matched!", event.equals(new ActionExecutedEvent("something")));
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) ActionExecutingEvent(org.xwiki.bridge.event.ActionExecutingEvent) Test(org.junit.Test)

Example 22 with ActionExecutedEvent

use of org.xwiki.bridge.event.ActionExecutedEvent 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());
        }
    };
}
Also used : DocumentUpdatingEvent(org.xwiki.bridge.event.DocumentUpdatingEvent) DocumentDeletedEvent(org.xwiki.bridge.event.DocumentDeletedEvent) ArrayList(java.util.ArrayList) DocumentCreatedEvent(org.xwiki.bridge.event.DocumentCreatedEvent) DocumentDeletingEvent(org.xwiki.bridge.event.DocumentDeletingEvent) ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) DocumentUpdatedEvent(org.xwiki.bridge.event.DocumentUpdatedEvent) ActionExecutingEvent(org.xwiki.bridge.event.ActionExecutingEvent) DocumentCreatingEvent(org.xwiki.bridge.event.DocumentCreatingEvent)

Example 23 with ActionExecutedEvent

use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.

the class ActionExecutedEventTest method testHashCodeForWildcardAction.

@Test
public void testHashCodeForWildcardAction() {
    ActionExecutedEvent event = new ActionExecutedEvent();
    Assert.assertTrue("Hashcode for wildcard action wasn't zero!", event.hashCode() == 0);
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 24 with ActionExecutedEvent

use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.

the class ActionExecutedEventTest method testEmptyActionDoesntMatch.

@Test
public void testEmptyActionDoesntMatch() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertFalse("Empty action behaves as wildcard!", new ActionExecutedEvent("").matches(event));
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 25 with ActionExecutedEvent

use of org.xwiki.bridge.event.ActionExecutedEvent in project xwiki-platform by xwiki.

the class ActionExecutedEventTest method testDoesntMatchWildcardAction.

@Test
public void testDoesntMatchWildcardAction() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertFalse("Wildcard action was matched!", event.matches(new ActionExecutedEvent()));
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Aggregations

ActionExecutedEvent (org.xwiki.bridge.event.ActionExecutedEvent)32 Test (org.junit.Test)25 ActionExecutingEvent (org.xwiki.bridge.event.ActionExecutingEvent)9 XWikiContext (com.xpn.xwiki.XWikiContext)4 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)4 XWikiException (com.xpn.xwiki.XWikiException)3 DocumentCreatedEvent (org.xwiki.bridge.event.DocumentCreatedEvent)3 DocumentDeletedEvent (org.xwiki.bridge.event.DocumentDeletedEvent)3 DocumentUpdatedEvent (org.xwiki.bridge.event.DocumentUpdatedEvent)3 ArrayList (java.util.ArrayList)2 DocumentCreatingEvent (org.xwiki.bridge.event.DocumentCreatingEvent)2 DocumentDeletingEvent (org.xwiki.bridge.event.DocumentDeletingEvent)2 DocumentUpdatingEvent (org.xwiki.bridge.event.DocumentUpdatingEvent)2 XWiki (com.xpn.xwiki.XWiki)1 MonitorPlugin (com.xpn.xwiki.monitor.api.MonitorPlugin)1 XWikiNotificationManager (com.xpn.xwiki.notify.XWikiNotificationManager)1 FileUploadPlugin (com.xpn.xwiki.plugin.fileupload.FileUploadPlugin)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 ServletException (javax.servlet.ServletException)1