Search in sources :

Example 11 with ActionExecutingEvent

use of org.xwiki.bridge.event.ActionExecutingEvent 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 12 with ActionExecutingEvent

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

the class ActionExecutingEventTest method testWildcardActionMatchesAll.

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

Example 13 with ActionExecutingEvent

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

the class ActionExecutingEventTest method testConstructorWithActionName.

@Test
public void testConstructorWithActionName() {
    ActionExecutingEvent event = new ActionExecutingEvent("something");
    Assert.assertEquals("Action name was lost!", "something", event.getActionName());
    Assert.assertFalse("Event was created canceled!", event.isCanceled());
    Assert.assertNull("A cancel reason was initially set!", event.getReason());
}
Also used : ActionExecutingEvent(org.xwiki.bridge.event.ActionExecutingEvent) Test(org.junit.Test)

Example 14 with ActionExecutingEvent

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

the class ActionExecutingEventTest method testEqualsSameAction.

@Test
public void testEqualsSameAction() {
    ActionExecutingEvent event = new ActionExecutingEvent("something");
    Assert.assertTrue("Same action wasn't equal!", event.equals(new ActionExecutingEvent("something")));
}
Also used : ActionExecutingEvent(org.xwiki.bridge.event.ActionExecutingEvent) Test(org.junit.Test)

Example 15 with ActionExecutingEvent

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

the class ActionExecutingEventTest method testEqualsWithNull.

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

Aggregations

ActionExecutingEvent (org.xwiki.bridge.event.ActionExecutingEvent)37 Test (org.junit.Test)32 ActionExecutedEvent (org.xwiki.bridge.event.ActionExecutedEvent)9 XWikiContext (com.xpn.xwiki.XWikiContext)5 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)3 XWikiException (com.xpn.xwiki.XWikiException)2 XWikiRequest (com.xpn.xwiki.web.XWikiRequest)2 DocumentCreatedEvent (org.xwiki.bridge.event.DocumentCreatedEvent)2 DocumentCreatingEvent (org.xwiki.bridge.event.DocumentCreatingEvent)2 DocumentDeletedEvent (org.xwiki.bridge.event.DocumentDeletedEvent)2 DocumentDeletingEvent (org.xwiki.bridge.event.DocumentDeletingEvent)2 DocumentUpdatedEvent (org.xwiki.bridge.event.DocumentUpdatedEvent)2 DocumentUpdatingEvent (org.xwiki.bridge.event.DocumentUpdatingEvent)2 LESSContext (org.xwiki.lesscss.internal.LESSContext)2 DocumentReference (org.xwiki.model.reference.DocumentReference)2 ObservationManager (org.xwiki.observation.ObservationManager)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