Package com.google.feedserver.resource

Examples of com.google.feedserver.resource.ResourceInfo


  /**
   * Two authorized entities with one principal each.  Remove another principal.  Should be
   * unchanged.
   */
  public void testRemoveAcl3() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0, authorizedEntity_u_0});
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER9);

    assertEquals(2, acl.getAuthorizedEntities().length);

View Full Code Here


  /**
   * One authorized entity with one principal.  Remove that principal.  Should get zero authorized
   * entities.
   */
  public void testRemoveAcl4() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0});
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER0);

    assertEquals(0, acl.getAuthorizedEntities().length);
  }
View Full Code Here

  /**
   * One authorized entity with two principals.  Remove second principal.  Should get one
   * authorized entity of first principal.
   */
  public void testRemoveAcl5() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0_1});
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER1);

    assertEquals(1, acl.getAuthorizedEntities().length);
    assertEquals(1, acl.getAuthorizedEntities()[0].getEntities().length);
View Full Code Here

  /**
   * One authorized entity with two principals.  Remove first principal.  Should get one
   * authorized entity of second principal.
   */
  public void testRemoveAcl6() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0_1});
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER0);

    assertEquals(1, acl.getAuthorizedEntities().length);
    assertEquals(1, acl.getAuthorizedEntities()[0].getEntities().length);
View Full Code Here

      if (acl.getAuthorizedEntities().length == 0) {
        delete(url + "/" + URLEncoder.encode(resource, "UTF-8"));
      } else {
        if (acl.getName() == null) {
          acl.setName(resource);
          acl.setResourceInfo(new ResourceInfo(resource, ResourceInfo.RESOURCE_TYPE_FEED));
          feedServerClient.insertEntity(new URL(url), acl);
        } else {
          feedServerClient.updateEntity(new URL(url), acl);
        }
      }
View Full Code Here

TOP

Related Classes of com.google.feedserver.resource.ResourceInfo

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.