Package org.rssowl.core.internal.persist

Examples of org.rssowl.core.internal.persist.Category


   * Tests {@link MergeUtils#merge(List, List, org.rssowl.core.persist.IPersistable)}.
   */
  @Test
  public void testCollectionMergeWithNullExistingListAndNullNewParent() {
    List<ICategory> categories = new ArrayList<ICategory>();
    categories.add(new Category());
    MergeUtils.merge(null, categories, null);
  }
View Full Code Here


   * Tests {@link MergeUtils#merge(List, List, org.rssowl.core.persist.IPersistable)}.
   */
  @Test
  public void testCollectionMergeWithNullExistingListAndNullNewParent() {
    List<ICategory> categories = new ArrayList<ICategory>();
    categories.add(new Category());
    MergeUtils.merge(null, categories, null);
  }
View Full Code Here

  /**
   * Adds, retrieves and checks if the added object matches the retrieved one.
   */
  @Test
  public void testAddAndGetFeedCategory() {
    Category category = (Category) createFeedCategory();
    DynamicDAO.save(category);
    Collection<ICategory> categories = DynamicDAO.loadAll(ICategory.class);
    assertEquals(1, categories.size());
    category.setId(categories.iterator().next().getId());
    assertTrue(category.isIdentical(categories.iterator().next()));
    DynamicDAO.deleteAll(categories);
  }
View Full Code Here

  /**
   * Adds, retrieves and checks if the added object matches the retrieved one.
   */
  public void testAddAndGetNewsCategory() {
    Category category = (Category) createNewsCategory();
    DynamicDAO.save(category);
    Collection<ICategory> categories = DynamicDAO.loadAll(ICategory.class);
    assertEquals(1, categories.size());
    category.setId(categories.iterator().next().getId());
    assertTrue(category.isIdentical(categories.iterator().next()));
    DynamicDAO.deleteAll(categories);
  }
View Full Code Here

        @Override
        public void entitiesAdded(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          try {
            categoryAddedCalled[0] = true;
            Category dbCategory = (Category) event.getEntity();
            initialCategory[0].setId(dbCategory.getId());
            assertTrue(initialCategory[0].isIdentical(dbCategory));
            dbCategory.setDomain("newDomain/newDomain");
            updatedCategory[0] = dbCategory;
            DynamicDAO.save(dbCategory);
          } catch (PersistenceException e) {
            fail(e.getMessage());
          }
        }

        @Override
        public void entitiesUpdated(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          categoryUpdatedCalled[0] = true;
          Category dbCategory = (Category) event.getEntity();
          assertTrue(updatedCategory[0].isIdentical(dbCategory));
        }
      };
      DynamicDAO.addEntityListener(ICategory.class, categoryListener);
      DynamicDAO.save(initialCategory[0]);
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public void testIsCategoryChange() throws Exception {
    ICategory cat1 = new Category();
    cat1.setName("Cat1");

    ICategory cat2 = new Category();
    cat2.setName("Cat2");

    ICategory cat3 = new Category();
    cat3.setName("Cat3");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.addCategory(cat1);

View Full Code Here

  /**
   * Adds, retrieves and checks if the added object matches the retrieved one.
   */
  @Test
  public void testAddAndGetFeedCategory() {
    Category category = (Category) createFeedCategory();
    DynamicDAO.save(category);
    Collection<ICategory> categories = DynamicDAO.loadAll(ICategory.class);
    assertEquals(1, categories.size());
    category.setId(categories.iterator().next().getId());
    assertTrue(category.isIdentical(categories.iterator().next()));
    DynamicDAO.deleteAll(categories);
  }
View Full Code Here

  /**
   * Adds, retrieves and checks if the added object matches the retrieved one.
   */
  public void testAddAndGetNewsCategory() {
    Category category = (Category) createNewsCategory();
    DynamicDAO.save(category);
    Collection<ICategory> categories = DynamicDAO.loadAll(ICategory.class);
    assertEquals(1, categories.size());
    category.setId(categories.iterator().next().getId());
    assertTrue(category.isIdentical(categories.iterator().next()));
    DynamicDAO.deleteAll(categories);
  }
View Full Code Here

        @Override
        public void entitiesAdded(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          try {
            categoryAddedCalled[0] = true;
            Category dbCategory = (Category) event.getEntity();
            initialCategory[0].setId(dbCategory.getId());
            assertTrue(initialCategory[0].isIdentical(dbCategory));
            dbCategory.setDomain("newDomain/newDomain");
            updatedCategory[0] = dbCategory;
            DynamicDAO.save(dbCategory);
          } catch (PersistenceException e) {
            fail(e.getMessage());
          }
        }

        @Override
        public void entitiesUpdated(Set<CategoryEvent> events) {
          CategoryEvent event = events.iterator().next();
          categoryUpdatedCalled[0] = true;
          Category dbCategory = (Category) event.getEntity();
          assertTrue(updatedCategory[0].isIdentical(dbCategory));
        }
      };
      DynamicDAO.addEntityListener(ICategory.class, categoryListener);
      DynamicDAO.save(initialCategory[0]);
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public void testIsCategoryChange() throws Exception {
    ICategory cat1 = new Category();
    cat1.setName("Cat1");

    ICategory cat2 = new Category();
    cat2.setName("Cat2");

    ICategory cat3 = new Category();
    cat3.setName("Cat3");

    IFeed feed = new Feed(new URI("http://www.link.com"));
    INews news1 = new News(null, feed, new Date());
    news1.addCategory(cat1);

View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.Category

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.