MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/filesystem/hdfs_test.cc:41–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace fs {
40
41TEST(TestHdfsOptions, FromUri) {
42 HdfsOptions options;
43 Uri uri;
44
45 ASSERT_OK(uri.Parse("hdfs://localhost"));
46 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
47 ASSERT_EQ(options.replication, 3);
48 ASSERT_EQ(options.connection_config.host, "hdfs://localhost");
49 ASSERT_EQ(options.connection_config.port, 0);
50 ASSERT_EQ(options.connection_config.user, "");
51
52 ASSERT_OK(uri.Parse("hdfs://otherhost:9999/?replication=2&kerb_ticket=kerb.ticket"));
53 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
54 ASSERT_EQ(options.replication, 2);
55 ASSERT_EQ(options.connection_config.kerb_ticket, "kerb.ticket");
56 ASSERT_EQ(options.connection_config.host, "hdfs://otherhost");
57 ASSERT_EQ(options.connection_config.port, 9999);
58 ASSERT_EQ(options.connection_config.user, "");
59
60 ASSERT_OK(uri.Parse("hdfs://otherhost:9999/?hdfs_token=hdfs_token_ticket"));
61 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
62 ASSERT_EQ(options.connection_config.host, "hdfs://otherhost");
63 ASSERT_EQ(options.connection_config.port, 9999);
64 ASSERT_EQ(options.connection_config.extra_conf["hdfs_token"], "hdfs_token_ticket");
65
66 ASSERT_OK(uri.Parse("viewfs://other-nn/mypath/myfile"));
67 ASSERT_OK_AND_ASSIGN(options, HdfsOptions::FromUri(uri));
68 ASSERT_EQ(options.connection_config.host, "viewfs://other-nn");
69 ASSERT_EQ(options.connection_config.port, 0);
70 ASSERT_EQ(options.connection_config.user, "");
71}
72
73class HadoopFileSystemTestMixin {
74 public:

Callers

nothing calls this directly

Calls 2

ASSERT_OK_AND_ASSIGNFunction · 0.70
ParseMethod · 0.45

Tested by

no test coverage detected