@Test
public void testImpliesURINegative() throws Exception {

  // relative path
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "hdfs://namenode:8020/path/to/../../other"));
  assertFalse(DBWildcardPrivilege.impliesURI("file:///path",
      "file:///path/to/../../other"));
  // bad policy
  assertFalse(DBWildcardPrivilege.impliesURI("blah",
      "hdfs://namenode:8020/path/to/some/dir"));
  // bad request
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "blah"));
  // scheme
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "file:///path/to/some/dir"));
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "file://namenode:8020/path/to/some/dir"));
  // hostname
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode1:8020/path",
      "hdfs://namenode2:8020/path/to/some/dir"));
  // port
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "hdfs://namenode:8021/path/to/some/dir"));
  // mangled path
  assertFalse(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path",
      "hdfs://namenode:8020/pathFooBar"));
  // ends in /
  assertTrue(DBWildcardPrivilege.impliesURI("hdfs://namenode:8020/path/",
      "hdfs://namenode:8020/path/FooBar"));
}