Examples of AccessURI


Examples of org.apache.sentry.core.AccessURI

   */
  @Test
  public void testValidateCreateFunctionForAdmin() throws Exception {
    inputTabHierarcyList.add(buildObjectHierarchy(SERVER1, null, null));
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new AccessURI("file:///some/path/to/a/jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ADMIN_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testValidateCreateFunctionAppropiateURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new AccessURI("file:///path/to/some/lib/dir/my.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testValidateCreateFunctionRejectionForUserWithoutURI() throws Exception {
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new Database(CUSTOMER_DB), new Table(AccessConstants.ALL)
    }));
    inputTabHierarcyList.add(Arrays.asList(new Authorizable[] {
        new Server(SERVER1), new AccessURI("file:///some/path/to/a.jar")
    }));
    testAuth.authorize(HiveOperation.CREATEFUNCTION, createFuncPrivileges, ANALYST_SUBJECT,
        inputTabHierarcyList, outputTabHierarcyList);
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

          } else {
            uri = "hdfs://" + uri;
          }
        }
      }
      return new AccessURI(uri);
    }
    return new AccessURI(uri);
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

public class TestURI {

  @Test(expected=IllegalArgumentException.class)
  public void testBadUriEmpty() {
    new AccessURI("");
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testBadUriEmpty() {
    new AccessURI("");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriNull() {
    new AccessURI(null);
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testBadUriNull() {
    new AccessURI(null);
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriNoFilePrefix() {
    new AccessURI("/");
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testBadUriNoFilePrefix() {
    new AccessURI("/");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriIncorrectFilePrefix() {
    new AccessURI("file:/some/path");
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

  public void testBadUriIncorrectFilePrefix() {
    new AccessURI("file:/some/path");
  }
  @Test(expected=IllegalArgumentException.class)
  public void testBadUriIncorrectHdfsPrefix() {
    new AccessURI("hdfs:/some/path");
  }
View Full Code Here

Examples of org.apache.sentry.core.AccessURI

    case Table:
      return new Table(name);
    case View:
      return new View(name);
    case URI:
      return new AccessURI(name);
    default:
      return null;
    }
  }
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.