Package com.google.feedserver.resource

Examples of com.google.feedserver.resource.ResourceInfo


  /**
   * Empty authorized entities.  Add one principal with one operation.  Should get one authorized
   * entity with one principal.
   */
  public void testAddAcl0() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED), null);
    aclTool.addAcl(Arrays.asList(acl), 'r', USER9);

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


  /**
   * Adding the same twice to empty should give you just one.
   */
  public void testAddAcl1() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[0]);
    List<Acl> acls = Arrays.asList(acl);
    aclTool.addAcl(acls, 'r', USER9);
    aclTool.addAcl(acls, 'r', USER9);

View Full Code Here

    assertEquals(1, acl.getAuthorizedEntities().length);
    assertAuthorizedEntityEquals(authorizedEntity_r_9, acl.getAuthorizedEntities()[0]);
  }

  public void testAddAcl2() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED), null);
    List<Acl> acls = Arrays.asList(acl);
    aclTool.addAcl(acls, 'r', USER9);
    aclTool.removeAcl(acls, 'u', USER9);

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

  /**
   * Empty authorized entities.  Add one principal with two operations.  Should get two authorized
   * entities each with one principal.
   */
  public void testAddAcl3() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED), null);
    List<Acl> acls = Arrays.asList(acl);
    aclTool.addAcl(acls, 'r', USER9);
    aclTool.addAcl(acls, 'u', USER9);

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

  /**
   * One authorized entity with one principal.  Add another principal.  Should get one authorized
   * entity with two principals.
   */
  public void testAddAcl4() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0});
    aclTool.addAcl(Arrays.asList(acl), 'r', USER9);

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

View Full Code Here

  /**
   * One authorized entity with two principals.  Add another principal.  Should get one authorized
   * entity with three principals.
   */
  public void testAddAcl5() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0_1});
    aclTool.addAcl(Arrays.asList(acl), 'r', USER9);

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

  /**
   * Two authorized entities, one with two principals and the other one principal.  Add another
   * principal.  First authorized entity should have three principals and second unchanged.
   */
  public void testAddAcl6() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[] {authorizedEntity_r_0_1, authorizedEntity_u_0});
    aclTool.addAcl(Arrays.asList(acl), 'r', USER9);

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

View Full Code Here

  /**
   * Removing from empty should result in empty still.
   */
  public void testRemoveAcl0() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[0]);
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER9);

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

  /**
   * Removing a non-existing principal should be no-op.
   */
  public void testRemoveAcl1() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[]{authorizedEntity_r_0});
    aclTool.removeAcl(Arrays.asList(acl), 'r', USER9);

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

  /**
   * Removing a principal with non-existing operation should be no-op.
   */
  public void testRemoveAcl2() {
    Acl acl = new Acl("acl0", new ResourceInfo("resourceRule0", ResourceInfo.RESOURCE_TYPE_FEED),
        new AuthorizedEntity[]{authorizedEntity_r_0});
    aclTool.removeAcl(Arrays.asList(acl), 'd', USER0);

    assertEquals(1, acl.getAuthorizedEntities().length);
    assertEquals(1, acl.getAuthorizedEntities()[0].getEntities().length);
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.