use of org.xwiki.observation.event.Event in project celements-blog by celements.
the class ArticleDeleteListenerTest method testDeletingEvent.
@Test
public void testDeletingEvent() {
Event event = listener.getDeletingEvent(null);
assertNotNull(event);
assertSame(ArticleDeletingEvent.class, event.getClass());
assertTrue(event.matches(new ArticleDeletingEvent()));
assertNotSame(listener.getDeletingEvent(null), event);
}
use of org.xwiki.observation.event.Event in project celements-blog by celements.
the class ArticleDeleteListenerTest method testDeletedEvent.
@Test
public void testDeletedEvent() {
Event event = listener.getDeletedEvent(null);
assertNotNull(event);
assertSame(ArticleDeletedEvent.class, event.getClass());
assertTrue(event.matches(new ArticleDeletedEvent()));
assertNotSame(listener.getDeletedEvent(null), event);
}
use of org.xwiki.observation.event.Event in project celements-blog by celements.
the class BlogDeleteListenerTest method testDeletedEvent.
@Test
public void testDeletedEvent() {
Event event = listener.getDeletedEvent(null);
assertNotNull(event);
assertSame(BlogDeletedEvent.class, event.getClass());
assertTrue(event.matches(new BlogDeletedEvent()));
assertNotSame(listener.getDeletedEvent(null), event);
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class ActionExecutionEventTest method testActionExecutionEventEquals.
@Test
public void testActionExecutionEventEquals() {
Event e1 = new ActionExecutionEvent("test");
Event e2 = new ActionExecutionEvent("test");
Event e3 = new ActionExecutionEvent("different");
Assert.assertTrue(e1.equals(e1));
Assert.assertTrue(e1.equals(e2));
Assert.assertFalse(e1.equals(e3));
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class CommentEventGeneratorListenerTest method testModifiedComment.
@Test
public void testModifiedComment() throws ComponentLookupException {
this.document.addXObject(this.commentXObject);
this.documentOrigin.addXObject(this.commentXObject.clone());
this.commentXObject.setStringValue("comment", "comment");
final Event event = new CommentUpdatedEvent("wiki:space.page", "0");
this.mocker.getComponentUnderTest().onEvent(new XObjectUpdatedEvent(this.commentXObject.getReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a comment updated event
verify(this.mockObservation).notify(any(event.getClass()), same(document), same(this.oldcore.getXWikiContext()));
}
Aggregations