Examples of FolderListener


Examples of org.rssowl.core.model.events.FolderListener

      /* Delete by calling delete */
      fDao.deleteFolder(new FolderReference(folder.getId()));

      final long rootFolderId = root.getId();
      FolderListener folderListener = new FolderAdapter() {
        @Override
        public void folderUpdated(Set<FolderEvent> events) {
          for (FolderEvent event : events) {
            if (event.getEntity().getId() == rootFolderId)
              assertTrue(event.isRoot());
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

   *
   * @throws Exception
   */
  @Test
  public void testReparentFolder() throws Exception {
    FolderListener folderListener = null;
    try {
      /* Add */
      final IFolder oldParent = fFactory.createFolder(null, null, "Old parent");
      final IFolder folder = fFactory.createFolder(null, oldParent, "Folder");
      fDao.saveFolder(oldParent);

      final IFolder newParent = fFactory.createFolder(null, null, "New parent");
      fFactory.createFolder(null, newParent, "New parent child");
      fDao.saveFolder(newParent);

      final boolean[] updateEventOccurred = new boolean[1];
      folderListener = new FolderListener() {
        public void folderAdded(Set<FolderEvent> events) {
          fail("Unexpected event");
        }

        public void folderDeleted(Set<FolderEvent> events) {
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

   *
   * @throws Exception
   */
  @Test
  public void testReparentMark() throws Exception {
    FolderListener folderListener = null;
    BookMarkListener bookMarkListener = null;
    SearchMarkListener searchMarkListener = null;
    try {
      /* Add */
      final IFolder oldParent = fFactory.createFolder(null, null, "Old parent");
      FeedReference feedRef = new FeedReference(Long.MAX_VALUE);
      final IBookMark bookMark = fFactory.createBookMark(null, oldParent,
          new URL("http://www.link.com"), feedRef, "bookmark");
      final ISearchMark searchMark = fFactory.createSearchMark(null, oldParent, "searchmark");
      fDao.saveFolder(oldParent);

      final IFolder newParent = fFactory.createFolder(null, null, "New parent");
      fFactory.createFolder(null, newParent, "New parent child");
      fDao.saveFolder(newParent);

      final boolean[] bookMarkUpdateEventOccurred = new boolean[1];
      bookMarkListener = new BookMarkListener() {
        public void bookMarkAdded(Set<BookMarkEvent> events) {
          fail("Unexpected event");
        }

        public void bookMarkDeleted(Set<BookMarkEvent> events) {
          fail("Unexpected event");
        }

        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) {
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

  public void testAddUpdateAndGetFolder() {
    final Folder initialFolder = (Folder) createFolder();
    final Folder[] updatedFolder = new Folder[1];
    final boolean[] folderAddedCalled = new boolean[] { false };
    final boolean[] folderUpdatedCalled = new boolean[] { false };
    FolderListener folderListener = null;
    try {
      folderListener = new FolderAdapter() {
        @Override
        public void folderAdded(Set<FolderEvent> events) {
          for (FolderEvent event : events) {
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

      fail(e.getMessage());
    }
    final Folder[] updatedFolder = new Folder[1];
    final boolean[] folderAddedCalled = new boolean[] { false };
    final boolean[] folderUpdatedCalled = new boolean[] { false };
    FolderListener folderListener = null;
    try {
      folderListener = new FolderAdapter() {
        @Override
        public void folderAdded(Set<FolderEvent> events) {
          for (FolderEvent event : events) {
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

      initialFolder[0] = (Folder) createFolderWithParent();
      folderName[0] = initialFolder[0].getName();
    } catch (PersistenceException e) {
      fail(e.getMessage());
    }
    FolderListener folderListener = null;
    try {
      folderListener = new FolderAdapter() {
        @Override
        public void folderAdded(Set<FolderEvent> events) {
          for (FolderEvent event : events) {
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

    logEvents(events, EventType.PERSIST);

    /* Notify Listeners */
    Object listeners[] = fFolderListeners.getListeners();
    for (Object element : listeners) {
      final FolderListener listener = (FolderListener) element;
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          listener.folderAdded(events);
        }
      });
    }
  }
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

    logEvents(events, EventType.REMOVE);

    /* Notify Listeners */
    Object listeners[] = fFolderListeners.getListeners();
    for (Object element : listeners) {
      final FolderListener listener = (FolderListener) element;
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          listener.folderDeleted(events);
        }
      });
    }
  }
View Full Code Here

Examples of org.rssowl.core.model.events.FolderListener

    logEvents(events, EventType.UPDATE);
   
    /* Notify Listeners */
    Object listeners[] = fFolderListeners.getListeners();
    for (Object element : listeners) {
      final FolderListener listener = (FolderListener) element;
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {
          listener.folderUpdated(events);
        }
      });
    }
  }
View Full Code Here

Examples of org.rssowl.core.persist.event.FolderListener

   *
   * @throws Exception
   */
  @Test
  public void testReparentFolderAndMark() throws Exception {
    FolderListener folderListener = null;
    BookMarkListener bookMarkListener = null;
    SearchMarkListener searchMarkListener = null;
    try {
      /* Add */
      final IFolder oldMarkParent = fFactory.createFolder(null, null, "Old parent");
      final IBookMark bookMark = fFactory.createBookMark(null, oldMarkParent, new FeedLinkReference(new URI("http://www.link.com")), "bookmark");
      final ISearchMark searchMark = fFactory.createSearchMark(null, oldMarkParent, "searchmark");
      DynamicDAO.save(oldMarkParent);

      final IFolder newMarkParent = fFactory.createFolder(null, null, "New parent");
      fFactory.createFolder(null, newMarkParent, "New parent child");
      DynamicDAO.save(newMarkParent);

      /* Add */
      final IFolder oldFolderParent = fFactory.createFolder(null, null, "Old parent");
      final IFolder folder = fFactory.createFolder(null, oldFolderParent, "Folder");
      DynamicDAO.save(oldFolderParent);

      final IFolder newFolderParent = fFactory.createFolder(null, null, "New parent");
      fFactory.createFolder(null, newFolderParent, "New parent child");
      DynamicDAO.save(newFolderParent);

      final boolean[] folderUpdateEventOccurred = new boolean[1];
      folderListener = new FolderListener() {
        public void entitiesAdded(Set<FolderEvent> events) {
          fail("Unexpected event");
        }

        public void entitiesDeleted(Set<FolderEvent> events) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.