Package org.rssowl.core.model.events

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


    news1 = null;
    System.gc();
   
    List<INews> newsList = Collections.singletonList(news2);
    final boolean[] newsUpdatedCalled = new boolean[1];
    newsListener = new NewsAdapter() {
      @Override
      public void newsUpdated(Set<NewsEvent> events) {
        newsUpdatedCalled[0] = true;
        assertEquals(2, events.size());
        for (NewsEvent event : events) {
View Full Code Here


    savedNews.setTitle("News Title Updated #1");

    List<INews> newsList = new ArrayList<INews>();
    newsList.add(savedNews);

    NewsListener newsListener = new NewsAdapter() {
      @Override
      public void newsUpdated(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        NewsEvent event = events.iterator().next();
        assertEquals(true, event.getEntity().equalsId(savedNews));
        assertEquals(State.UNREAD, event.getOldNews().getState());
        assertEquals(State.UNREAD, event.getEntity().getState());
      }
    };
    fModel.addNewsListener(newsListener);
    try {
      newsList = fAppLayer.saveNews(newsList);
    } finally {
      fModel.removeNewsListener(newsListener);
    }
    newsListener = new NewsAdapter() {
      @Override
      public void newsUpdated(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        NewsEvent event = events.iterator().next();
        assertEquals(savedNews.getId().longValue(), event.getEntity().getId());
View Full Code Here

    for (INews news : newsList) {
      news.setComments("updated comments");
    }

    final boolean newsUpdatedCalled[] = new boolean[1];
    NewsListener newsListener = new NewsAdapter() {
      @Override
      public void newsUpdated(Set<NewsEvent> events) {
        assertEquals(newsUpdatedCalled[0], false);
        newsUpdatedCalled[0] = true;
        assertEquals(newsList.size(), events.size());
View Full Code Here

    final News[] updatedNews = new News[1];
    final boolean[] NewsAddedCalled = new boolean[] { false };
    final boolean[] NewsUpdatedCalled = new boolean[] { false };
    NewsListener newsListener = null;
    try {
      newsListener = new NewsAdapter() {
        @Override
        public void newsAdded(Set<NewsEvent> events) {
          NewsEvent event = events.iterator().next();
          try {
            NewsAddedCalled[0] = true;
View Full Code Here

   */
  @Test
  public void testNewsManagerSetStateWithMultipleFeedsAndGuidNull() {
    final IFeed feed1;
    IFeed feed2;
    NewsAdapter newsAdapter;
    try {
      feed1 = fModelDAO.saveFeed(createFeed());
      IFeed tempFeed = createFeed("http://adifferentlink.com");
      tempFeed.setTitle("A different title");
      feed2 = fModelDAO.saveFeed(tempFeed);
    } catch (PersistenceException e) {
      fail(e.getMessage());
      return;
    }
   
    final NewsReference[] newsRef = new NewsReference[1];
    newsAdapter = new NewsAdapter() {
      @Override
      public void newsAdded(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        newsRef[0] = new NewsReference(events.iterator().next().getEntity().getId());
      }
View Full Code Here

    final News initialNews2 = (News) createNews(feed2);
    initialNews2.setState(State.NEW);
   
    final NewsReference[] newsRef = new NewsReference[1];
   
    newsAdapter = new NewsAdapter() {
      @Override
      public void newsAdded(Set<NewsEvent> events) {
        assertEquals(1, events.size());
        newsRef[0] = new NewsReference(events.iterator().next().getEntity().getId());
      }
View Full Code Here

TOP

Related Classes of org.rssowl.core.model.events.NewsAdapter

Copyright © 2018 www.massapicom. 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.