use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class XClassPropertyEventGeneratorListenerTest method testModifiedDocumentXClassPropertyAdded.
@Test
public void testModifiedDocumentXClassPropertyAdded() throws ComponentLookupException {
this.xclass.addTextField("property", "Property", 30);
final Event event = new XClassPropertyAddedEvent(this.xclass.getField("property").getReference());
this.mocker.getComponentUnderTest().onEvent(new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a xobject added event
verify(this.mockObservation).notify(eq(event), same(this.document), same(this.oldcore.getXWikiContext()));
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class XClassPropertyEventGeneratorListenerTest method testAddDocument.
@Test
public void testAddDocument() throws ComponentLookupException {
this.xclass.addTextField("property", "Property", 30);
final Event event = new XClassPropertyAddedEvent(this.xclass.getField("property").getReference());
this.mocker.getComponentUnderTest().onEvent(new DocumentCreatedEvent(this.document.getDocumentReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a xobject added event
verify(this.mockObservation).notify(eq(event), same(this.document), same(this.oldcore.getXWikiContext()));
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class XClassPropertyEventGeneratorListenerTest method testModifiedDocumentXClassPropertyModified.
@Test
public void testModifiedDocumentXClassPropertyModified() throws ComponentLookupException {
this.xclassOrigin.addTextField("property", "Property", 30);
this.xclass.addTextField("property", "New Property", 30);
final Event event = new XClassPropertyUpdatedEvent(this.xclassOrigin.getField("property").getReference());
this.mocker.getComponentUnderTest().onEvent(new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a xobject added event
verify(this.mockObservation).notify(eq(event), same(this.document), same(this.oldcore.getXWikiContext()));
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class XClassPropertyEventGeneratorListenerTest method testModifiedDocumentXClassPropertyDeleted.
@Test
public void testModifiedDocumentXClassPropertyDeleted() throws ComponentLookupException {
this.xclassOrigin.addTextField("property", "Property", 30);
final Event event = new XClassPropertyDeletedEvent(this.xclassOrigin.getField("property").getReference());
this.mocker.getComponentUnderTest().onEvent(new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a xobject added event
verify(this.mockObservation).notify(eq(event), same(this.document), same(this.oldcore.getXWikiContext()));
}
use of org.xwiki.observation.event.Event in project xwiki-platform by xwiki.
the class XObjectEventGeneratorListenerTest method testModifiedDocumentXObjectDeleted.
@Test
public void testModifiedDocumentXObjectDeleted() throws ComponentLookupException {
this.documentOrigin.addXObject(this.xobject);
final Event event = new XObjectDeletedEvent(this.xobject.getReference());
this.mocker.getComponentUnderTest().onEvent(new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document, this.oldcore.getXWikiContext());
// Make sure the listener generated a xobject deleted event
verify(this.mockObservation).notify(eq(event), same(this.document), same(this.oldcore.getXWikiContext()));
}
Aggregations