|
@@ -310,23 +310,6 @@ public class TestHftpFileSystem {
|
|
|
fs.getCanonicalServiceName());
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void testHftpCustomDefaultPorts() throws IOException {
|
|
|
- Configuration conf = new Configuration();
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTP_PORT_KEY, 123);
|
|
|
-
|
|
|
- URI uri = URI.create("hftp://localhost");
|
|
|
- HftpFileSystem fs = (HftpFileSystem) FileSystem.get(uri, conf);
|
|
|
-
|
|
|
- assertEquals(123, fs.getDefaultPort());
|
|
|
-
|
|
|
- assertEquals(uri, fs.getUri());
|
|
|
-
|
|
|
- // HFTP uses http to get the token so canonical service name should
|
|
|
- // return the http port.
|
|
|
- assertEquals("127.0.0.1:123", fs.getCanonicalServiceName());
|
|
|
- }
|
|
|
-
|
|
|
@Test
|
|
|
public void testHftpCustomUriPortWithDefaultPorts() throws IOException {
|
|
|
Configuration conf = new Configuration();
|
|
@@ -343,12 +326,11 @@ public class TestHftpFileSystem {
|
|
|
@Test
|
|
|
public void testHftpCustomUriPortWithCustomDefaultPorts() throws IOException {
|
|
|
Configuration conf = new Configuration();
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTP_PORT_KEY, 123);
|
|
|
-
|
|
|
URI uri = URI.create("hftp://localhost:789");
|
|
|
HftpFileSystem fs = (HftpFileSystem) FileSystem.get(uri, conf);
|
|
|
|
|
|
- assertEquals(123, fs.getDefaultPort());
|
|
|
+ assertEquals(DFSConfigKeys.DFS_NAMENODE_HTTP_PORT_DEFAULT,
|
|
|
+ fs.getDefaultPort());
|
|
|
|
|
|
assertEquals(uri, fs.getUri());
|
|
|
assertEquals("127.0.0.1:789", fs.getCanonicalServiceName());
|
|
@@ -383,20 +365,6 @@ public class TestHftpFileSystem {
|
|
|
fs.getCanonicalServiceName());
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void testHsftpCustomDefaultPorts() throws IOException {
|
|
|
- Configuration conf = new Configuration();
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTP_PORT_KEY, 123);
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTPS_PORT_KEY, 456);
|
|
|
-
|
|
|
- URI uri = URI.create("hsftp://localhost");
|
|
|
- HsftpFileSystem fs = (HsftpFileSystem) FileSystem.get(uri, conf);
|
|
|
-
|
|
|
- assertEquals(456, fs.getDefaultPort());
|
|
|
-
|
|
|
- assertEquals(uri, fs.getUri());
|
|
|
- assertEquals("127.0.0.1:456", fs.getCanonicalServiceName());
|
|
|
- }
|
|
|
|
|
|
@Test
|
|
|
public void testHsftpCustomUriPortWithDefaultPorts() throws IOException {
|
|
@@ -414,13 +382,12 @@ public class TestHftpFileSystem {
|
|
|
@Test
|
|
|
public void testHsftpCustomUriPortWithCustomDefaultPorts() throws IOException {
|
|
|
Configuration conf = new Configuration();
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTP_PORT_KEY, 123);
|
|
|
- conf.setInt(DFSConfigKeys.DFS_NAMENODE_HTTPS_PORT_KEY, 456);
|
|
|
|
|
|
URI uri = URI.create("hsftp://localhost:789");
|
|
|
HsftpFileSystem fs = (HsftpFileSystem) FileSystem.get(uri, conf);
|
|
|
|
|
|
- assertEquals(456, fs.getDefaultPort());
|
|
|
+ assertEquals(DFSConfigKeys.DFS_NAMENODE_HTTPS_PORT_DEFAULT,
|
|
|
+ fs.getDefaultPort());
|
|
|
|
|
|
assertEquals(uri, fs.getUri());
|
|
|
assertEquals("127.0.0.1:789", fs.getCanonicalServiceName());
|