Search in sources :

Example 1 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testDoesntEqualDifferentTypeOfAction.

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

Example 2 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testHashCodeWithEmptyAction.

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

Example 3 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testWildcardActionMatchesAll.

@Test
public void testWildcardActionMatchesAll() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertTrue("Wildcard action didn't match!", new ActionExecutedEvent().matches(event));
    Assert.assertTrue("Wildcard action didn't match another wildcard action!", new ActionExecutedEvent().matches(new ActionExecutedEvent()));
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 4 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testDoesntEqualWildcardAction.

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

Example 5 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testWildcardActionDoesntEqualEmptyAction.

@Test
public void testWildcardActionDoesntEqualEmptyAction() {
    ActionExecutedEvent event = new ActionExecutedEvent("");
    Assert.assertFalse("Wildcard action equals another action!", new ActionExecutedEvent().equals(event));
}
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