Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.CategoryVO


    assertEquals("Category data found does not match the updated data", updater, found);
  }

  public void testFindByParent() throws Exception
  {
    CategoryVO one = new CategoryVO();
    one.setName("FindByParentExtraOne");
    one.setDescription("Extra one description");
    one.setParentId(testCategory.getId());
    one = testController.save(one);
    testCategory.getChildren().add(one);

    CategoryVO two = new CategoryVO();
    two.setName("FindByParentExtraTwo");
    two.setDescription("Extra two description");
    two.setParentId(testCategory.getId());
    two = testController.save(two);
    testCategory.getChildren().add(two);

    List categories = testController.findByParent(testCategory.getId());
    assertTrue("Extra Category One was not found", categories.contains(one));
View Full Code Here


  }


  public void testFindActiveByParent() throws Exception
  {
    CategoryVO one = new CategoryVO();
    one.setName("FindByParentExtraOne");
    one.setDescription("Extra one description");
    one.setParentId(testCategory.getId());
    one = testController.save(one);
    testCategory.getChildren().add(one);

    CategoryVO two = new CategoryVO();
    two.setName("FindByParentExtraTwo");
    two.setDescription("Extra two description");
    two.setParentId(testCategory.getId());
    two.setActive(false);
    two = testController.save(two);
    testCategory.getChildren().add(two);

    List categories = testController.findActiveByParent(testCategory.getId());
    assertTrue("Extra Category One was not found", categories.contains(one));
View Full Code Here

  }


  public void testFindRootCategories() throws Exception
  {
    CategoryVO nonRoot = new CategoryVO();
    nonRoot.setName("NonRoot");
    nonRoot.setDescription("NonRoot description");
    nonRoot.setParentId(testCategory.getId());
    nonRoot = testController.save(nonRoot);

    CategoryVO otherRoot = new CategoryVO();
    otherRoot.setName("FindByParentExtraTwo");
    otherRoot.setDescription("Extra two description");
    otherRoot = testController.save(otherRoot);
    extraCategories.add(otherRoot);

    List categories = testController.findRootCategories();
    assertTrue("Test Category was not found", categories.contains(testCategory));
View Full Code Here

    testCategory.getChildren().add(nonRoot);
  }

  public void testFindWithChildren() throws Exception
  {
    CategoryVO one = new CategoryVO();
    one.setName("FindWithChildrenExtraOne");
    one.setDescription("Extra one description");
    one.setParentId(testCategory.getId());
    one = testController.save(one);
    testCategory.getChildren().add(one);

    CategoryVO two = new CategoryVO();
    two.setName("FindWithChildrenExtraTwo");
    two.setDescription("Extra two description");
    two.setParentId(testCategory.getId());
    two = testController.save(two);
    testCategory.getChildren().add(two);

    CategoryVO found = testController.findWithChildren(testCategory.getId());
    assertEquals("Category data found does not match the created data", testCategory, found);
    assertTrue("Extra Category One was not a child", found.getChildren().contains(one));
    assertTrue("Extra Category Two was not a child", found.getChildren().contains(two));
  }
View Full Code Here

    assertTrue("ContentCategory not found by Category", found.contains(cc));
  }

  public void testMoveCategory() throws Exception
  {
    CategoryVO one = new CategoryVO();
    one.setName("MoveCategoryExtraOne");
    one.setDescription("Extra one description");
    one.setParentId(testCategory.getId());
    one = testController.save(one);

    CategoryVO otherRoot = new CategoryVO();
    otherRoot.setName("MoveCategoryParentExtraTwo");
    otherRoot.setDescription("Extra two description");
    otherRoot = testController.save(otherRoot);
    extraCategories.add(otherRoot);

    // test original setup
    List categories = testController.findByParent(testCategory.getId());
    assertTrue("Before Move - Child Category was not found by original parent", categories.contains(one));
    categories = testController.findByParent(otherRoot.getId());
    assertFalse("Before Move - Child Category was found by new parent", categories.contains(one));

    one = testController.moveCategory(one.getId(), otherRoot.getId());

    // test new setup
    categories = testController.findByParent(testCategory.getId());
    assertFalse("After Move - Child Category was found by old parent", categories.contains(one));
    categories = testController.findByParent(otherRoot.getId());
    assertTrue("After Move - Child Category was not found by new parent", categories.contains(one));
  }
View Full Code Here

  private boolean deleted;

  protected void setUp() throws Exception
  {
    super.setUp();
    testCategory = new CategoryVO();
    testCategory.setName(getName());
    testCategory.setDescription(getName() + " description");
    testCategory = testCategoryController.save(testCategory);

    testContentCategory = new ContentCategoryVO();
View Full Code Here

  public void testFindMostRecent() throws Exception
  {
    testCategory = createContentCategory(testContentVersion.getId(), ATTRIBUTE);

    ContentVersionVO another = addMoreContent();
    CategoryVO anotherCategory = createContentCategory(another.getId(), getName());

    List found = testController.findContentVersionVOsForCategory(testDatabase, anotherCategory.getId(), getName(), ANON, SITENODE, LANGUAGE, true, DeliveryContext.getDeliveryContext());
    assertEquals("Wrong number of Content Versions found", 1, found.size());
    assertEquals("Wrong Content Versions found", another.getId(), ((ContentVersionVO)found.get(0)).getId());
  }
View Full Code Here

  //-------------------------------------------------------------------------
  // Helpers
  //-------------------------------------------------------------------------
  private CategoryVO createContentCategory(Integer contentVersionId, String attributeName) throws SystemException
  {
    CategoryVO c = new CategoryVO();
    c.setName(getName());
    c.setDescription(getName() + " description");
    c = categoryStore.save(c);
    allCategories.add(c);
    createContentCategory(contentVersionId, attributeName, c);
    return c;
  }
View Full Code Here

    testContentVersion = new ContentVersionVO();
    testContentVersion.setVersionModifier("junit");
    testContentVersion.setVersionValue(getName());
    testContentVersion = contentVersionStore.create(testContent.getId(), LANGUAGE, testContentVersion, null);

    testCategory = new CategoryVO();
    testCategory.setName(getName());
    testCategory.setDescription(getName() + " description");
    testCategory = categoryStore.save(testCategory);

    testContentCategory = new ContentCategoryVO();
View Full Code Here

  protected void setUp() throws Exception
  {
    super.setUp();

    testCategory = new CategoryVO();
    testCategory.setName(getName());
    testCategory.setDescription(getName() + " description");
    testCategory = testCategoryController.save(testCategory);

    testContentCategory = new ContentCategoryVO();
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.CategoryVO

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.