Package org.infoglue.cms.entities.content

Examples of org.infoglue.cms.entities.content.ContentCategoryVO


    testCategoryController.delete(testCategory.getId());
  }

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


    assertEquals("Wrong Category relationship", testCategory, found.getCategory());
  }

  public void testFindByContentVersionAttribute() throws Exception
  {
    ContentCategoryVO sameAttribute = new ContentCategoryVO();
    sameAttribute.setAttributeName(getName());
    sameAttribute.setContentVersionId(VERSION_ID);
    sameAttribute.setCategory(testCategory);
    sameAttribute = testController.save(sameAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(sameAttribute);

    ContentCategoryVO differentAttribute = new ContentCategoryVO();
    differentAttribute.setAttributeName("randomAttribute");
    differentAttribute.setContentVersionId(VERSION_ID);
    differentAttribute.setCategory(testCategory);
    differentAttribute = testController.save(differentAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(differentAttribute);

    List found = testController.findByContentVersionAttribute(getName(), VERSION_ID);
    assertEquals("Wrong number of ContentCategories returned", 2, found.size());
View Full Code Here

    assertFalse("testContentCategory data not returned", found.contains(testContentCategory));
  }

  public void testFindByContentVersion() throws Exception
  {
    ContentCategoryVO sameAttribute = new ContentCategoryVO();
    sameAttribute.setAttributeName(getName());
    sameAttribute.setContentVersionId(VERSION_ID);
    sameAttribute.setCategory(testCategory);
    sameAttribute = testController.save(sameAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(sameAttribute);

    ContentCategoryVO differentAttribute = new ContentCategoryVO();
    differentAttribute.setAttributeName("randomAttribute");
    differentAttribute.setContentVersionId(VERSION_ID);
    differentAttribute.setCategory(testCategory);
    differentAttribute = testController.save(differentAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(differentAttribute);

    List found = testController.findByContentVersion(VERSION_ID);
    assertEquals("Wrong number of ContentCategories returned", 3, found.size());
View Full Code Here

    assertFalse("testContentCategory data returned", found.contains(testContentCategory));
  }

  public void testFindByCategory() throws Exception
  {
    ContentCategoryVO differentAttribute = new ContentCategoryVO();
    differentAttribute.setAttributeName("randomAttribute");
    differentAttribute.setContentVersionId(VERSION_ID);
    differentAttribute.setCategory(testCategory);
    differentAttribute = testController.save(differentAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(differentAttribute);

    List found = testController.findByCategory(testCategory.getId());
    assertEquals("Wrong number of ContentCategories returned", 2, found.size());
View Full Code Here

    assertTrue("differentAttribute data not returned", found.contains(differentAttribute));
  }

  public void testFindByBadCategory() throws Exception
  {
    ContentCategoryVO differentAttribute = new ContentCategoryVO();
    differentAttribute.setAttributeName("randomAttribute");
    differentAttribute.setContentVersionId(VERSION_ID);
    differentAttribute.setCategory(testCategory);
    differentAttribute = testController.save(differentAttribute, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    extraContentCategories.add(differentAttribute);

    List found = testController.findByCategory(new Integer(-999));
    assertEquals("Wrong number of ContentCategories returned", 0, found.size());
View Full Code Here

    deleted = true;
  }

  public void testDeleteByContentVersionAttribute() throws Exception
  {
    ContentCategoryVO random = createWithRandomAttribute();
    testController.deleteByContentVersionAttribute(random.getAttributeName(), random.getContentVersionId());
    List found = testController.findByContentVersionAttribute(random.getAttributeName(), random.getContentVersionId());
    assertEquals("Wrong number of ContentCategories returned", 0, found.size());
    deleted = true;
  }
View Full Code Here

    deleted = true;
  }

  private ContentCategoryVO createWithRandomAttribute() throws Exception
  {
    return testController.save(new ContentCategoryVO("randomAttribute", VERSION_ID, testCategory), InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
  }
View Full Code Here

    return c;
  }

  private ContentCategoryVO createContentCategory(Integer contentVersionId, String attributeName, CategoryVO category) throws SystemException
  {
    ContentCategoryVO cc = new ContentCategoryVO();
    cc.setAttributeName(attributeName);
    cc.setContentVersionId(contentVersionId);
    cc.setCategory(category);
    cc = contentCategoryStore.save(cc, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
    allContentCategories.add(cc);
    return cc;
  }
View Full Code Here

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

    testContentCategory = new ContentCategoryVO();
    testContentCategory.setAttributeName(getName());
    testContentCategory.setContentVersionId(testContentVersion.getId());
    testContentCategory.setCategory(testCategory);
    testContentCategory = contentCategoryStore.save(testContentCategory, InfoGluePrincipalControllerProxy.getController().getTestPrincipal());
  }
View Full Code Here

    testEventContentVersion = newVersion;

    List newFound = contentCategoryStore.findByContentVersion(newVersion.getId());
    assertEquals("Wrong number of new ContentCategories returned", found.size(), newFound.size());

    ContentCategoryVO newContentCategory = (ContentCategoryVO)newFound.get(0);
    assertEquals("Wrong contentVersionId", newVersion.getContentVersionId(), newContentCategory.getContentVersionId());
    assertEquals("Wrong category", testContentCategory.getCategory(), newContentCategory.getCategory());
    assertEquals("Wrong attribute", testContentCategory.getAttributeName(), newContentCategory.getAttributeName());
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.content.ContentCategoryVO

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.