}
public void bookMarkUpdated(Set<BookMarkEvent> events) {
bookMarkUpdateEventOccurred[0] = true;
assertEquals(1, events.size());
BookMarkEvent event = events.iterator().next();
assertEquals(bookMark, event.getEntity());
assertTrue("Expected this Event to be Root Event", event.isRoot());
assertEquals(oldParent, event.getOldParent());
assertEquals(newParent, event.getEntity().getFolder());
}
};
final boolean[] searchMarkUpdateEventOccurred = new boolean[1];
searchMarkListener = new SearchMarkListener() {
public void searchMarkAdded(Set<SearchMarkEvent> events) {
fail("Unexpected event");
}
public void searchMarkDeleted(Set<SearchMarkEvent> events) {
fail("Unexpected event");
}
public void searchMarkUpdated(Set<SearchMarkEvent> events) {
searchMarkUpdateEventOccurred[0] = true;
assertEquals(1, events.size());
SearchMarkEvent event = events.iterator().next();
assertEquals(searchMark, event.getEntity());
assertTrue("Expected this Event to be Root Event", event.isRoot());
assertEquals(oldParent, event.getOldParent());
assertEquals(newParent, event.getEntity().getFolder());
}
};
final boolean[] folderUpdateEventOccurred = new boolean[1];
folderListener = new FolderListener() {
public void folderAdded(Set<FolderEvent> events) {
fail("Unexpected event");
}
public void folderDeleted(Set<FolderEvent> events) {
fail("Unexpected event");
}
public void folderUpdated(Set<FolderEvent> events) {
folderUpdateEventOccurred[0] = true;
assertEquals(3, events.size());
for (FolderEvent event : events) {
assertFalse("Expected this Event to be NO Root Event", event.isRoot());
}
}
};
fModel.addFolderListener(folderListener);
fModel.addBookMarkListener(bookMarkListener);