PathUtils { public static String parseDFSURI(String warehouseDir, String uri) throws URISyntaxException { return parseURI(warehouseDir, uri, false); }  static boolean impliesURI(URI privilegeURI, URI requestURI); static boolean impliesURI(String privilege, String request); static String parseDFSURI(String warehouseDir, String uri); static String parseURI(String warehouseDir, String uri, boolean isLocal); static String parseLocalURI(String uri);  }
@Test public void testParseDFSURI() throws Exception { assertEquals("hdfs: parseDFSURI("hdfs: assertEquals("hdfs: parseDFSURI("hdfs: try { PathUtils.parseDFSURI("hdfs: fail("IllegalArgumentException should be thrown"); } catch (IllegalArgumentException ue) { } assertEquals("swift: PathUtils.parseDFSURI("swift: assertEquals("swift: "swift: try { PathUtils.parseDFSURI("swift: fail("IllegalArgumentException should be thrown"); } catch (IllegalArgumentException ue) { } assertEquals("file: parseDFSURI("file: assertEquals("file: parseDFSURI("file: assertEquals("file: parseDFSURI("file: try { PathUtils.parseDFSURI("file: fail("IllegalArgumentException should be thrown"); } catch (IllegalArgumentException ue) { } assertEquals("file: parseDFSURI("file:/tmp/hive-warehouse", "/tmp/hive-user")); assertEquals("file: parseDFSURI("file:/tmp/hive-warehouse", "file:/tmp/hive-user")); assertEquals("file: parseDFSURI("file:/tmp/hive-warehouse", "file: assertEquals("file: PathUtils.parseURI("testLocal: try { PathUtils.parseURI("testLocal: fail("IllegalStateException should be thrown"); } catch (IllegalArgumentException ue) { } assertEquals("file: PathUtils.parseDFSURI("/tmp/hive-warehouse", "/tmp/hive-user")); }