*
* @throws Exception
*/
@Test
public void testFlatPersonEvents() throws Exception {
PersonListener personListener = null;
try {
/* Add */
FeedReference feedRef = new FeedReference(DynamicDAO.save(fFactory.createFeed(null, new URI("http://www.feed4.com"))).getId());
NewsReference newsRef = new NewsReference(DynamicDAO.save(fFactory.createNews(null, feedRef.resolve(), new Date())).getId());
IPerson person1 = fFactory.createPerson(null, feedRef.resolve());
person1.setName("Person1");
IPerson person2 = fFactory.createPerson(null, newsRef.resolve());
person2.setName("Person2");
final boolean personEvents[] = new boolean[6];
final PersonReference personReference[] = new PersonReference[2];
personListener = new PersonListener() {
public void entitiesAdded(Set<PersonEvent> events) {
for (PersonEvent event : events) {
assertTrue("Expected this Event to be Root Event", event.isRoot());
if (personEvents[0])
personEvents[1] = true;