Examples of CategoryVO


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

    testAction.setCategoryId(testCategory.getCategoryId());
    testAction.getCategory().setParentId(parentId);
    assertSuccess(testAction, "move");

    CategoryVO updatedCategory = testAction.getCategory();
    assertEquals("Category parent is wrong", parentId, updatedCategory.getParentId());

    testCategory = testController.findById(testCategory.getId());
    assertEquals("Category parent is wrong", parentId, testCategory.getParentId());
  }
View Full Code Here

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

  private ContentCategoryController contentCategoryStore = ContentCategoryController.getController();
 
  protected void setUp() throws Exception
  {
    super.setUp();
    testCategory = new CategoryVO();
    testCategory.setName(getName());
    testCategory.setDescription(getName() + " description");

    testCategory = testController.save(testCategory);
  }
View Full Code Here

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

           contentCategoryStore.findByCategory(testCategory.getId()).isEmpty());
  }

  public void testFindById() throws Exception
  {
    CategoryVO found = testController.findById(testCategory.getId());
    assertEquals("Category data found does not match the created data", testCategory, found);
  }
View Full Code Here

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

    assertEquals("Category data found does not match the created data", testCategory, found);
  }

  public void testUpdate() throws Exception
  {
    CategoryVO updater = testController.findById(testCategory.getId());
    updater.setName("Updated Name");
    testController.save(updater);

    CategoryVO found = testController.findById(updater.getId());
    assertEquals("Category data found does not match the updated data", updater, found);
  }
View Full Code Here

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

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

  }


  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

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

  }


  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

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

    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

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

    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

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

  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
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.