Search in sources :

Example 26 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testMatchesSameObject.

// Tests for matches(Object)
@Test
public void testMatchesSameObject() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertTrue("Same object wasn't matched!", event.matches(event));
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 27 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testDoesntEqualDifferentAction.

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

Example 28 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testDefaultConstructor.

// Tests for constructors
@Test
public void testDefaultConstructor() {
    ActionExecutedEvent event = new ActionExecutedEvent();
    Assert.assertNull("A default action was used!", event.getActionName());
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 29 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testHashCode.

// Tests for hashCode()
@Test
public void testHashCode() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertTrue("Hashcode was zero!", event.hashCode() != 0);
}
Also used : ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) Test(org.junit.Test)

Example 30 with ActionExecutedEvent

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

the class ActionExecutedEventTest method testDoesntMatchNull.

@Test
public void testDoesntMatchNull() {
    ActionExecutedEvent event = new ActionExecutedEvent("something");
    Assert.assertFalse("null was matched!", event.matches(null));
}
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