use of com.enonic.xp.event.Event in project xp by enonic.
the class NodeEventsTest method testCreated.
@Test
public void testCreated() {
final Node created = createNode("created", NodePath.create("/mynode1/child1").build(), "id");
Event event = NodeEvents.created(created);
assertNotNull(event);
assertTrue(event.isDistributed());
assertEquals("[{id=id, path=/mynode1/child1/created, branch=draft, repo=com.enonic.cms.default}]", event.getValue("nodes").get().toString());
}
use of com.enonic.xp.event.Event in project xp by enonic.
the class NodeEventsTest method testUpdated.
@Test
public void testUpdated() {
final Node updated = createNode("updated", NodePath.create("/mynode1/child1").build(), "myId");
Event event = NodeEvents.updated(updated);
assertNotNull(event);
assertTrue(event.isDistributed());
assertEquals(NodeEvents.NODE_UPDATED_EVENT, event.getType());
assertEquals("[{id=myId, path=/mynode1/child1/updated, branch=draft, repo=com.enonic.cms.default}]", event.getValue("nodes").get().toString());
}
use of com.enonic.xp.event.Event in project xp by enonic.
the class NodeEventsTest method testNullArguments.
@Test
public void testNullArguments() {
Event eventCreated = NodeEvents.created(null);
Event eventDeleted = NodeEvents.deleted(null);
assertNull(eventCreated);
assertNull(eventDeleted);
}
use of com.enonic.xp.event.Event in project xp by enonic.
the class NodeEventsTest method testDeleted.
@Test
public void testDeleted() {
final Node deleted = createNode("deleted", NodePath.create("/mynode1/child1").build(), "myId");
Event event = NodeEvents.created(deleted);
assertNotNull(event);
assertTrue(event.isDistributed());
assertEquals("[{id=myId, path=/mynode1/child1/deleted, branch=draft, repo=com.enonic.cms.default}]", event.getValue("nodes").get().toString());
}
use of com.enonic.xp.event.Event in project xp by enonic.
the class RepositoryEventsTest method testRestored.
@Test
public void testRestored() {
Event event = RepositoryEvents.restored();
assertNotNull(event);
assertTrue(event.isDistributed());
assertEquals(RepositoryEvents.RESTORED_EVENT_TYPE, event.getType());
}
Aggregations