OmniSciDB  04ee39c94c
OmniSQLCommandTest.cpp File Reference
#include "../SQLFrontend/CommandFunctors.h"
#include "../SQLFrontend/CommandResolutionChain.h"
#include "../SQLFrontend/MetaClientContext.h"
#include "../SQLFrontend/ThriftOps.h"
#include "../gen-cpp/mapd_types.h"
#include "gtest/gtest.h"
#include <boost/interprocess/sync/file_lock.hpp>
#include <cstring>
#include <fstream>
+ Include dependency graph for OmniSQLCommandTest.cpp:

Go to the source code of this file.

Classes

struct  CoreMockTransport
 
class  CoreMockClient
 
struct  StatusCommandMockupContext
 
struct  StatusCommandContextOpsPolicy
 
class  StatusCommandMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  RoleListCommandMockupContext
 
struct  RoleListCommandContextOpsPolicy
 
class  RoleListCommandMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  RolesCommandMockupContext
 
struct  RolesCommandContextOpsPolicy
 
class  RolesCommandMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  RegexCommandsMockClient
 
struct  RegexCommandsContextOpsPolicy
 
class  RegexCommandsMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  ImportDashboardCommandContextOpsPolicy
 
class  ImportDashboardCommandMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  ExportDashboardCommandContextOpsPolicy
 
class  ExportDashboardCommandMockupContextOperations< CONTEXT_OP_POLICY >
 
struct  DashboardsCommandMockupContext
 
struct  DashboardsCommandContextOpsPolicy
 
class  DashboardsCommandMockupContextOperations< CONTEXT_OP_POLICY >
 

Macros

#define MockMethod(method_name)
 
#define RetValMockMethod(method_name, ret_val)
 

Typedefs

using RegexCommandsMockupContext = MetaClientContext< RegexCommandsMockClient, CoreMockTransport >
 
using ListUsersMockClient = RegexCommandsMockClient
 
using ListUsersCommandMockupContext = RegexCommandsMockupContext
 
using ListUsersCommandContextOpsPolicy = RegexCommandsContextOpsPolicy
 
template<typename CONTEXT_OPS_POLICY_TYPE >
using ListUsersCommandMockupContextOperations = RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE >
 
using ListTablesMockClient = RegexCommandsMockClient
 
using ListTablesCommandMockupContext = RegexCommandsMockupContext
 
using ListTablesCommandContextOpsPolicy = RegexCommandsContextOpsPolicy
 
template<typename CONTEXT_OPS_POLICY_TYPE >
using ListTablesCommandMockupContextOperations = RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE >
 
using ListViewsMockClient = RegexCommandsMockClient
 
using ListViewsCommandMockupContext = RegexCommandsMockupContext
 
using ListViewsCommandContextOpsPolicy = RegexCommandsContextOpsPolicy
 
template<typename CONTEXT_OPS_POLICY_TYPE >
using ListViewsCommandMockupContextOperations = RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE >
 
using ImportDashboardCommandMockupContext = MetaClientContext< CoreMockClient, CoreMockTransport >
 
using ExportDashboardCommandMockupContext = MetaClientContext< CoreMockClient, CoreMockTransport >
 

Functions

 TEST (OmniSQLTest, CommandResolutionChain_Construction_MatchedCommand)
 
 TEST (OmniSQLTest, CommandResolutionChain_Construction_MismatchedCommand)
 
 TEST (OmniSQLTest, CommandResolutionChain_DefaultTokenizer)
 
 TEST (OmniSQLTest, CommandResolutionChain_ThreeSet_FirstHit)
 
 TEST (OmniSQLTest, CommandResolutionChain_ThreeSet_SecondHit)
 
 TEST (OmniSQLTest, CommandResolutionChain_ThreeSet_ThirdHit)
 
 TEST (OmniSQLTest, CommandResolutionChain_ThreeSet_NoHits)
 
 TEST (OmniSQLTest, StatusCommandTest)
 
 TEST (OmniSQLTest, RoleListCommandTest)
 
 TEST (OmniSQLTest, RolesCommandTest)
 
 TEST (OmniSQLTest, ListUsersCommandTest_ListAll)
 
 TEST (OmniSQLTest, ListUsersCommandTest_OnlyLisa)
 
 TEST (OmniSQLTest, ListUsersCommandTest_StartsWithLisa)
 
 TEST (OmniSQLTest, ListTablesCommandTest_ListAll)
 
 TEST (OmniSQLTest, ListTablesCommandTest_EndsWithNoMatch)
 
 TEST (OmniSQLTest, ListTablesCommandTest_EndsWithMatch)
 
 TEST (OmniSQLTest, ListTablesCommandTest_InnerNoMatch)
 
 TEST (OmniSQLTest, ListTablesCommandTest_InnerMatch)
 
 TEST (OmniSQLTest, ViewListCommandTest_ListAll)
 
 TEST (OmniSQLTest, ViewListCommandTest_EndsWith4Digits)
 
 TEST (OmniSQLTest, ImportDashboardCommandTest_SimpleDashSimpleFilename)
 
 TEST (OmniSQLTest, ImportDashboardCommandTest_SimpleDashComplexFilename)
 
 TEST (OmniSQLTest, ImportDashboardCommandTest_ComplexDashSimpleFilename)
 
 TEST (OmniSQLTest, ImportDashboardCommandTest_ComplexDashComplexFilename)
 
 TEST (OmniSQLTest, ExportDashboardCommandTest_SimpleDashSimpleFilename)
 
 TEST (OmniSQLTest, ExportDashboardCommandTest_SimpleDashComplexFilename)
 
 TEST (OmniSQLTest, ExportDashboardCommandTest_ComplexDashSimpleFilename)
 
 TEST (OmniSQLTest, ExportDashboardCommandTest_ComplexDashComplexFilename)
 
 TEST (OmniSQLTest, ExportDashboardCommandTest_ComplexDashComplexFilenameWithOwnerName)
 
int main (int argc, char *argv[])
 
 TEST (OmniSQLTest, DashboardsCommandTest)
 

Macro Definition Documentation

◆ MockMethod

#define MockMethod (   method_name)
Value:
template <typename... ARGS> \
void method_name(ARGS&&... args) {}

Definition at line 12 of file OmniSQLCommandTest.cpp.

◆ RetValMockMethod

#define RetValMockMethod (   method_name,
  ret_val 
)
Value:
template <typename... ARGS> \
ret_val method_name(ARGS&&... args) { \
return ret_val(); \
}

Definition at line 15 of file OmniSQLCommandTest.cpp.

Typedef Documentation

◆ ExportDashboardCommandMockupContext

◆ ImportDashboardCommandMockupContext

◆ ListTablesCommandContextOpsPolicy

◆ ListTablesCommandMockupContext

◆ ListTablesCommandMockupContextOperations

template<typename CONTEXT_OPS_POLICY_TYPE >
using ListTablesCommandMockupContextOperations = RegexCommandsMockupContextOperations<CONTEXT_OPS_POLICY_TYPE>

Definition at line 479 of file OmniSQLCommandTest.cpp.

◆ ListTablesMockClient

◆ ListUsersCommandContextOpsPolicy

◆ ListUsersCommandMockupContext

◆ ListUsersCommandMockupContextOperations

template<typename CONTEXT_OPS_POLICY_TYPE >
using ListUsersCommandMockupContextOperations = RegexCommandsMockupContextOperations<CONTEXT_OPS_POLICY_TYPE>

Definition at line 375 of file OmniSQLCommandTest.cpp.

◆ ListUsersMockClient

◆ ListViewsCommandContextOpsPolicy

◆ ListViewsCommandMockupContext

◆ ListViewsCommandMockupContextOperations

template<typename CONTEXT_OPS_POLICY_TYPE >
using ListViewsCommandMockupContextOperations = RegexCommandsMockupContextOperations<CONTEXT_OPS_POLICY_TYPE>

Definition at line 626 of file OmniSQLCommandTest.cpp.

◆ ListViewsMockClient

◆ RegexCommandsMockupContext

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1023 of file OmniSQLCommandTest.cpp.

1023  {
1024  ::testing::InitGoogleTest(&argc, argv);
1025  return RUN_ALL_TESTS();
1026 }

◆ TEST() [1/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_Construction_MatchedCommand   
)

Definition at line 65 of file OmniSQLCommandTest.cpp.

65  {
67 
68  bool lambda_called = false;
69  CommandResolutionChain<> constructible(
70  "\\fake_command token1 token2", "\\fake_command", 3, 3, [&](Params const& p) {
71  lambda_called = true;
72  });
73 
74  EXPECT_TRUE(lambda_called);
75  EXPECT_TRUE(constructible.is_resolved());
76 }
std::vector< std::string > CommandTokenList

◆ TEST() [2/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_Construction_MismatchedCommand   
)

Definition at line 78 of file OmniSQLCommandTest.cpp.

78  {
80 
81  bool lambda_not_called = true;
82  CommandResolutionChain<> constructible(
83  "\\fake_command token1 token2", "\\blahblah", 3, 3, [&](Params const& p) {
84  lambda_not_called = false;
85  });
86 
87  EXPECT_TRUE(lambda_not_called);
88  EXPECT_FALSE(constructible.is_resolved());
89 }
std::vector< std::string > CommandTokenList

◆ TEST() [3/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_DefaultTokenizer   
)

Definition at line 91 of file OmniSQLCommandTest.cpp.

91  {
93 
94  bool lambda_called = false;
95  CommandResolutionChain<> constructible(
96  "\\fake_command token1 token2", "\\fake_command", 3, 3, [&](Params const& p) {
97  lambda_called = true;
98  });
99 
100  EXPECT_EQ(Params::size_type(3), constructible.m_command_token_list.size());
101  EXPECT_STREQ("\\fake_command", constructible.m_command_token_list[0].c_str());
102  EXPECT_STREQ("token1", constructible.m_command_token_list[1].c_str());
103  EXPECT_STREQ("token2", constructible.m_command_token_list[2].c_str());
104 }
std::vector< std::string > CommandTokenList

◆ TEST() [4/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_ThreeSet_FirstHit   
)

Definition at line 106 of file OmniSQLCommandTest.cpp.

106  {
108 
109  bool first_hit = false;
110  bool second_hit = false;
111  bool third_hit = false;
112 
113  auto resolution =
115  "\\fake_command1 token1 token2", "\\fake_command1", 3, 3, [&](Params const& p) {
116  first_hit = true;
117  })("\\fake_command2", 1, 1, [&](Params const& p) {
118  second_hit = true;
119  })("\\fake_command3", 1, 1, [&](Params const& p) {
120  third_hit = true;
121  }).is_resolved();
122 
123  EXPECT_TRUE(resolution);
124  EXPECT_TRUE(first_hit);
125  EXPECT_FALSE(second_hit);
126  EXPECT_FALSE(third_hit);
127 }
std::vector< std::string > CommandTokenList

◆ TEST() [5/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_ThreeSet_SecondHit   
)

Definition at line 129 of file OmniSQLCommandTest.cpp.

129  {
131 
132  bool first_hit = false;
133  bool second_hit = false;
134  bool third_hit = false;
135 
136  auto resolution =
138  "\\fake_command2 token1 token2", "\\fake_command1", 1, 1, [&](Params const& p) {
139  first_hit = true;
140  })("\\fake_command2", 3, 3, [&](Params const& p) {
141  second_hit = true;
142  })("\\fake_command3", 1, 1, [&](Params const& p) {
143  third_hit = true;
144  }).is_resolved();
145 
146  EXPECT_TRUE(resolution);
147  EXPECT_FALSE(first_hit);
148  EXPECT_TRUE(second_hit);
149  EXPECT_FALSE(third_hit);
150 }
std::vector< std::string > CommandTokenList

◆ TEST() [6/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_ThreeSet_ThirdHit   
)

Definition at line 152 of file OmniSQLCommandTest.cpp.

152  {
154 
155  bool first_hit = false;
156  bool second_hit = false;
157  bool third_hit = false;
158 
159  auto resolution =
161  "\\fake_command3 token1 token2", "\\fake_command1", 1, 1, [&](Params const& p) {
162  first_hit = true;
163  })("\\fake_command2", 1, 1, [&](Params const& p) {
164  second_hit = true;
165  })("\\fake_command3", 3, 3, [&](Params const& p) {
166  third_hit = true;
167  }).is_resolved();
168 
169  EXPECT_TRUE(resolution);
170  EXPECT_FALSE(first_hit);
171  EXPECT_FALSE(second_hit);
172  EXPECT_TRUE(third_hit);
173 }
std::vector< std::string > CommandTokenList

◆ TEST() [7/30]

TEST ( OmniSQLTest  ,
CommandResolutionChain_ThreeSet_NoHits   
)

Definition at line 175 of file OmniSQLCommandTest.cpp.

175  {
177 
178  bool first_hit = false;
179  bool second_hit = false;
180  bool third_hit = false;
181 
182  auto resolution = CommandResolutionChain<>("\\i_cant_be_matched token1 token2",
183  "\\fake_command1",
184  3,
185  3,
186  [&](Params const& p) { first_hit = true; })(
187  "\\fake_command2", 1, 1, [&](Params const& p) {
188  second_hit = true;
189  })("\\fake_command3", 1, 1, [&](Params const& p) {
190  third_hit = true;
191  }).is_resolved();
192 
193  EXPECT_FALSE(resolution);
194  EXPECT_FALSE(first_hit);
195  EXPECT_FALSE(second_hit);
196  EXPECT_FALSE(third_hit);
197 }
std::vector< std::string > CommandTokenList

◆ TEST() [8/30]

TEST ( OmniSQLTest  ,
StatusCommandTest   
)

Definition at line 225 of file OmniSQLCommandTest.cpp.

References StatusCommandMockupContext::get_status_invoked.

225  {
227  using UnitTestStatusCmd =
228  StatusCmd<StatusCommandContextOpsPolicy, StatusCommandMockupContextOperations>;
229  StatusCommandMockupContext unit_test_context;
230 
231  auto resolution =
233  "\\status", "\\status", 1, 1, UnitTestStatusCmd(unit_test_context))
234  .is_resolved();
235 
236  EXPECT_TRUE(unit_test_context.get_status_invoked);
237  EXPECT_TRUE(resolution);
238 }
std::vector< std::string > CommandTokenList

◆ TEST() [9/30]

TEST ( OmniSQLTest  ,
RoleListCommandTest   
)

Definition at line 265 of file OmniSQLCommandTest.cpp.

References RoleListCommandMockupContext::get_all_roles_for_user_invoked, and RoleListCommandMockupContext::privs_user_name.

265  {
267  using UnitTestRoleListCmd = RoleListCmd<RoleListCommandContextOpsPolicy,
269  RoleListCommandMockupContext unit_test_context;
270 
271  auto resolution =
273  "\\role_list mapd", "\\role_list", 2, 2, UnitTestRoleListCmd(unit_test_context))
274  .is_resolved();
275 
276  EXPECT_STREQ("mapd", unit_test_context.privs_user_name.c_str());
277  EXPECT_TRUE(unit_test_context.get_all_roles_for_user_invoked);
278  EXPECT_TRUE(resolution);
279 }
std::vector< std::string > CommandTokenList

◆ TEST() [10/30]

TEST ( OmniSQLTest  ,
RolesCommandTest   
)

Definition at line 305 of file OmniSQLCommandTest.cpp.

References RolesCommandMockupContext::get_all_roles_invoked.

305  {
307  using UnitTestRolesCmd =
308  RolesCmd<RolesCommandContextOpsPolicy, RolesCommandMockupContextOperations>;
309  RolesCommandMockupContext unit_test_context;
310 
311  auto resolution = CommandResolutionChain<>(
312  "\\roles", "\\roles", 1, 1, UnitTestRolesCmd(unit_test_context))
313  .is_resolved();
314 
315  EXPECT_TRUE(unit_test_context.get_all_roles_invoked);
316  EXPECT_TRUE(resolution);
317 }
std::vector< std::string > CommandTokenList

◆ TEST() [11/30]

TEST ( OmniSQLTest  ,
ListUsersCommandTest_ListAll   
)

Definition at line 377 of file OmniSQLCommandTest.cpp.

377  {
379  using UnitTestListUsersCmd = ListUsersCmd<ListUsersCommandContextOpsPolicy,
382  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
383 
384  // Run the test for \u
385  std::ostringstream test_capture_stream1;
386  ListUsersCommandMockupContext unit_test_context_list_all;
387  auto resolution1 =
389  "\\u",
390  1,
391  1,
392  UnitTestListUsersCmd(unit_test_context_list_all),
393  test_capture_stream1)
394  .is_resolved();
395  EXPECT_TRUE(resolution1);
396 
397  std::string output_back_to_input(test_capture_stream1.str());
398 
399  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
400  EXPECT_EQ(extractedTokens.size(), (decltype(extractedTokens)::size_type)7);
401  EXPECT_EQ(extractedTokens[0], "mapd");
402  EXPECT_EQ(extractedTokens[1], "homer");
403  EXPECT_EQ(extractedTokens[2], "marge");
404  EXPECT_EQ(extractedTokens[3], "bart");
405  EXPECT_EQ(extractedTokens[4], "lisa");
406  EXPECT_EQ(extractedTokens[5], "lisaSimpson");
407  EXPECT_EQ(extractedTokens[6], "sideshowbob");
408 }
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListUsersCommandMockupContextOperations
RegexCommandsContextOpsPolicy ListUsersCommandContextOpsPolicy
std::vector< std::string > CommandTokenList

◆ TEST() [12/30]

TEST ( OmniSQLTest  ,
ListUsersCommandTest_OnlyLisa   
)

Definition at line 410 of file OmniSQLCommandTest.cpp.

410  {
412  using UnitTestListUsersCmd = ListUsersCmd<ListUsersCommandContextOpsPolicy,
415  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
416 
417  std::ostringstream test_capture_stream2;
418  ListUsersCommandMockupContext unit_test_context_only_lisa;
419  auto resolution2 =
420  CommandResolutionChain<>("\\u ^lisa",
421  "\\u",
422  1,
423  1,
424  UnitTestListUsersCmd(unit_test_context_only_lisa),
425  test_capture_stream2)
426  .is_resolved();
427  EXPECT_TRUE(resolution2);
428 
429  std::string output_back_to_input(test_capture_stream2.str());
430  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
431  EXPECT_EQ(extractedTokens.size(), (decltype(extractedTokens)::size_type)1);
432  EXPECT_EQ(extractedTokens[0], "lisa");
433 }
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListUsersCommandMockupContextOperations
RegexCommandsContextOpsPolicy ListUsersCommandContextOpsPolicy
std::vector< std::string > CommandTokenList

◆ TEST() [13/30]

TEST ( OmniSQLTest  ,
ListUsersCommandTest_StartsWithLisa   
)

Definition at line 435 of file OmniSQLCommandTest.cpp.

435  {
437  using UnitTestListUsersCmd = ListUsersCmd<ListUsersCommandContextOpsPolicy,
440  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
441 
442  std::ostringstream test_capture_stream3;
443  ListUsersCommandMockupContext unit_test_context_starts_with_lisa;
444  auto resolution3 =
445  CommandResolutionChain<>("\\u ^lisa.*",
446  "\\u",
447  1,
448  1,
449  UnitTestListUsersCmd(unit_test_context_starts_with_lisa),
450  test_capture_stream3)
451  .is_resolved();
452  EXPECT_TRUE(resolution3);
453 
454  std::string output_back_to_input(test_capture_stream3.str());
455  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
456  EXPECT_EQ(extractedTokens.size(), (decltype(extractedTokens)::size_type)2);
457  EXPECT_EQ(extractedTokens[0], "lisa");
458  EXPECT_EQ(extractedTokens[1], "lisaSimpson");
459 }
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListUsersCommandMockupContextOperations
RegexCommandsContextOpsPolicy ListUsersCommandContextOpsPolicy
std::vector< std::string > CommandTokenList

◆ TEST() [14/30]

TEST ( OmniSQLTest  ,
ListTablesCommandTest_ListAll   
)

Definition at line 481 of file OmniSQLCommandTest.cpp.

481  {
483  using UnitTestListTablesCmd = ListTablesCmd<ListTablesCommandContextOpsPolicy,
486  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
487 
488  std::ostringstream test_capture_stream;
489  ListTablesCommandMockupContext unit_test_context;
490  auto resolution = CommandResolutionChain<>("\\t",
491  "\\t",
492  1,
493  1,
494  UnitTestListTablesCmd(unit_test_context),
495  test_capture_stream)
496  .is_resolved();
497  EXPECT_TRUE(resolution);
498 
499  std::string output_back_to_input(test_capture_stream.str());
500  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
501  using TokenCount = decltype(extractedTokens)::size_type;
502  EXPECT_EQ(extractedTokens.size(), (TokenCount)6);
503  EXPECT_EQ(extractedTokens[0], "flights_2008_7M");
504  EXPECT_EQ(extractedTokens[1], "test");
505  EXPECT_EQ(extractedTokens[2], "test_x");
506  EXPECT_EQ(extractedTokens[3], "test_inner_x");
507  EXPECT_EQ(extractedTokens[4], "bar");
508  EXPECT_EQ(extractedTokens[5], "test_inner");
509 }
RegexCommandsContextOpsPolicy ListTablesCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListTablesCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [15/30]

TEST ( OmniSQLTest  ,
ListTablesCommandTest_EndsWithNoMatch   
)

Definition at line 511 of file OmniSQLCommandTest.cpp.

511  {
513  using UnitTestListTablesCmd = ListTablesCmd<ListTablesCommandContextOpsPolicy,
516  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
517 
518  std::ostringstream test_capture_stream;
519  ListTablesCommandMockupContext unit_test_context;
520  auto resolution = CommandResolutionChain<>("\\t _x$",
521  "\\t",
522  1,
523  1,
524  UnitTestListTablesCmd(unit_test_context),
525  test_capture_stream)
526  .is_resolved();
527  EXPECT_TRUE(resolution);
528 
529  std::string output_back_to_input(test_capture_stream.str());
530  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
531  using TokenCount = decltype(extractedTokens)::size_type;
532 
533  EXPECT_TRUE(extractedTokens.empty());
534 }
RegexCommandsContextOpsPolicy ListTablesCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListTablesCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [16/30]

TEST ( OmniSQLTest  ,
ListTablesCommandTest_EndsWithMatch   
)

Definition at line 536 of file OmniSQLCommandTest.cpp.

536  {
538  using UnitTestListTablesCmd = ListTablesCmd<ListTablesCommandContextOpsPolicy,
541  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
542 
543  std::ostringstream test_capture_stream;
544  ListTablesCommandMockupContext unit_test_context;
545  auto resolution = CommandResolutionChain<>("\\t .+_x$",
546  "\\t",
547  1,
548  1,
549  UnitTestListTablesCmd(unit_test_context),
550  test_capture_stream)
551  .is_resolved();
552  EXPECT_TRUE(resolution);
553 
554  std::string output_back_to_input(test_capture_stream.str());
555  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
556  using TokenCount = decltype(extractedTokens)::size_type;
557  EXPECT_EQ(extractedTokens.size(), (TokenCount)2);
558  EXPECT_EQ(extractedTokens[0], "test_x");
559  EXPECT_EQ(extractedTokens[1], "test_inner_x");
560 }
RegexCommandsContextOpsPolicy ListTablesCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListTablesCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [17/30]

TEST ( OmniSQLTest  ,
ListTablesCommandTest_InnerNoMatch   
)

Definition at line 562 of file OmniSQLCommandTest.cpp.

562  {
564  using UnitTestListTablesCmd = ListTablesCmd<ListTablesCommandContextOpsPolicy,
567  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
568 
569  std::ostringstream test_capture_stream;
570  ListTablesCommandMockupContext unit_test_context;
571  auto resolution = CommandResolutionChain<>("\\t inner",
572  "\\t",
573  1,
574  1,
575  UnitTestListTablesCmd(unit_test_context),
576  test_capture_stream)
577  .is_resolved();
578  EXPECT_TRUE(resolution);
579 
580  std::string output_back_to_input(test_capture_stream.str());
581  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
582  using TokenCount = decltype(extractedTokens)::size_type;
583  EXPECT_EQ(extractedTokens.size(), (TokenCount)0);
584 }
RegexCommandsContextOpsPolicy ListTablesCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListTablesCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [18/30]

TEST ( OmniSQLTest  ,
ListTablesCommandTest_InnerMatch   
)

Definition at line 586 of file OmniSQLCommandTest.cpp.

586  {
588  using UnitTestListTablesCmd = ListTablesCmd<ListTablesCommandContextOpsPolicy,
591  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
592 
593  std::ostringstream test_capture_stream;
594  ListTablesCommandMockupContext unit_test_context;
595  auto resolution = CommandResolutionChain<>("\\t .+inner.+",
596  "\\t",
597  1,
598  1,
599  UnitTestListTablesCmd(unit_test_context),
600  test_capture_stream)
601  .is_resolved();
602  EXPECT_TRUE(resolution);
603 
604  std::string output_back_to_input(test_capture_stream.str());
605  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
606  using TokenCount = decltype(extractedTokens)::size_type;
607  EXPECT_EQ(extractedTokens.size(), (TokenCount)1);
608  EXPECT_EQ(extractedTokens[0], "test_inner_x");
609 }
RegexCommandsContextOpsPolicy ListTablesCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListTablesCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [19/30]

TEST ( OmniSQLTest  ,
ViewListCommandTest_ListAll   
)

Definition at line 628 of file OmniSQLCommandTest.cpp.

628  {
630  using UnitTestListViewsCmd = ListViewsCmd<ListViewsCommandContextOpsPolicy,
633  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
634 
635  std::ostringstream test_capture_stream;
636  ListViewsCommandMockupContext unit_test_context;
637  auto resolution = CommandResolutionChain<>("\\v",
638  "\\v",
639  1,
640  1,
641  UnitTestListViewsCmd(unit_test_context),
642  test_capture_stream)
643  .is_resolved();
644  EXPECT_TRUE(resolution);
645 
646  std::string output_back_to_input(test_capture_stream.str());
647  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
648  using TokenCount = decltype(extractedTokens)::size_type;
649  EXPECT_EQ(extractedTokens.size(), (TokenCount)5);
650  EXPECT_EQ(extractedTokens[0], "test_view");
651  EXPECT_EQ(extractedTokens[1], "cletus");
652  EXPECT_EQ(extractedTokens[2], "marge");
653  EXPECT_EQ(extractedTokens[3], "marge978");
654  EXPECT_EQ(extractedTokens[4], "marge1025");
655 }
RegexCommandsContextOpsPolicy ListViewsCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListViewsCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [20/30]

TEST ( OmniSQLTest  ,
ViewListCommandTest_EndsWith4Digits   
)

Definition at line 657 of file OmniSQLCommandTest.cpp.

657  {
659  using UnitTestListViewsCmd = ListViewsCmd<ListViewsCommandContextOpsPolicy,
662  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
663 
664  std::ostringstream test_capture_stream;
665  ListViewsCommandMockupContext unit_test_context;
666  auto resolution = CommandResolutionChain<>("\\v .+\\d{4}$",
667  "\\v",
668  1,
669  1,
670  UnitTestListViewsCmd(unit_test_context),
671  test_capture_stream)
672  .is_resolved();
673  EXPECT_TRUE(resolution);
674 
675  std::string output_back_to_input(test_capture_stream.str());
676  auto extractedTokens = TokenExtractor().extract_tokens(output_back_to_input);
677  using TokenCount = decltype(extractedTokens)::size_type;
678  EXPECT_EQ(extractedTokens.size(), (TokenCount)1);
679  EXPECT_EQ(extractedTokens[0], "marge1025");
680 }
RegexCommandsContextOpsPolicy ListViewsCommandContextOpsPolicy
RegexCommandsMockupContextOperations< CONTEXT_OPS_POLICY_TYPE > ListViewsCommandMockupContextOperations
std::vector< std::string > CommandTokenList

◆ TEST() [21/30]

TEST ( OmniSQLTest  ,
ImportDashboardCommandTest_SimpleDashSimpleFilename   
)

Definition at line 701 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

701  {
703  using UnitTestImportDashboardCmd =
704  ImportDashboardCmd<ImportDashboardCommandContextOpsPolicy,
706  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
707 
708  std::ostringstream test_capture_stream;
709  ImportDashboardCommandMockupContext unit_test_context;
710  auto resolution =
712  "\\import_dashboard simpledash unlikely_file_to_over_be_opened_1234.txt",
713  "\\import_dashboard",
714  3,
715  3,
716  UnitTestImportDashboardCmd(unit_test_context),
717  test_capture_stream)
718  .is_resolved();
719  EXPECT_TRUE(resolution);
720  EXPECT_EQ(unit_test_context.view_name, "simpledash");
721  EXPECT_EQ(unit_test_context.view_state, "");
722  EXPECT_EQ(unit_test_context.view_metadata, "");
723 
724  // We are relying on the behavior of not being able to open the file to capture the
725  // filename passed in
726  std::string output_back_to_input(test_capture_stream.str());
727  auto extracted_tokens = TokenExtractor().extract_tokens(output_back_to_input);
728  using TokenCount = decltype(extracted_tokens)::size_type;
729  EXPECT_EQ(extracted_tokens.size(), 5u);
730  EXPECT_EQ(extracted_tokens[4], "`unlikely_file_to_over_be_opened_1234.txt`");
731 }
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [22/30]

TEST ( OmniSQLTest  ,
ImportDashboardCommandTest_SimpleDashComplexFilename   
)

Definition at line 733 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

733  {
735  using UnitTestImportDashboardCmd =
736  ImportDashboardCmd<ImportDashboardCommandContextOpsPolicy,
738  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
739 
740  std::ostringstream test_capture_stream;
741  ImportDashboardCommandMockupContext unit_test_context;
742  auto resolution =
744  "\\import_dashboard simpledash \"C:\\\\Windows is Terrible\\\\lol.txt\"",
745  "\\import_dashboard",
746  3,
747  3,
748  UnitTestImportDashboardCmd(unit_test_context),
749  test_capture_stream)
750  .is_resolved();
751  EXPECT_TRUE(resolution);
752  EXPECT_EQ(unit_test_context.view_name, "simpledash");
753  EXPECT_EQ(unit_test_context.view_state, "");
754  EXPECT_EQ(unit_test_context.view_metadata, "");
755 
756  // We are relying on the behavior of not being able to open the file to capture the
757  // filename passed in
758  std::string output_back_to_input(test_capture_stream.str());
759  auto extracted_tokens = TokenExtractor().extract_tokens(output_back_to_input);
760  using TokenCount = decltype(extracted_tokens)::size_type;
761  EXPECT_EQ(extracted_tokens.size(),
762  7u); // Inflated because of spaces in standard output
763  EXPECT_EQ(extracted_tokens[4], "`C:\\Windows");
764  EXPECT_EQ(extracted_tokens[5], "is");
765  EXPECT_EQ(extracted_tokens[6], "Terrible\\lol.txt`");
766 }
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [23/30]

TEST ( OmniSQLTest  ,
ImportDashboardCommandTest_ComplexDashSimpleFilename   
)

Definition at line 768 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

768  {
770  using UnitTestImportDashboardCmd =
771  ImportDashboardCmd<ImportDashboardCommandContextOpsPolicy,
773  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
774 
775  std::ostringstream test_capture_stream;
776  ImportDashboardCommandMockupContext unit_test_context;
777  auto resolution =
779  "\\import_dashboard \"\\\"Who uses spaces anyway?\\\"\" simpledash.txt",
780  "\\import_dashboard",
781  3,
782  3,
783  UnitTestImportDashboardCmd(unit_test_context),
784  test_capture_stream)
785  .is_resolved();
786  EXPECT_TRUE(resolution);
787  EXPECT_EQ(unit_test_context.view_name, "\"Who uses spaces anyway?\"");
788  EXPECT_EQ(unit_test_context.view_state, "");
789  EXPECT_EQ(unit_test_context.view_metadata, "");
790 
791  // We are relying on the behavior of not being able to open the file to capture the
792  // filename passed in
793  std::string output_back_to_input(test_capture_stream.str());
794  auto extracted_tokens = TokenExtractor().extract_tokens(output_back_to_input);
795  using TokenCount = decltype(extracted_tokens)::size_type;
796  EXPECT_EQ(extracted_tokens.size(),
797  5u); // Inflated because of spaces in standard output
798  EXPECT_EQ(extracted_tokens[4], "`simpledash.txt`");
799 }
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [24/30]

TEST ( OmniSQLTest  ,
ImportDashboardCommandTest_ComplexDashComplexFilename   
)

Definition at line 801 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

801  {
803  using UnitTestImportDashboardCmd =
804  ImportDashboardCmd<ImportDashboardCommandContextOpsPolicy,
806  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
807 
808  std::ostringstream test_capture_stream;
809  ImportDashboardCommandMockupContext unit_test_context;
810  auto resolution = CommandResolutionChain<>(
811  "\\import_dashboard \"\\\"Who uses spaces anyway?\\\"\" "
812  "\"C:\\\\Windows is Terrible\\\\lol.txt\"",
813  "\\import_dashboard",
814  3,
815  3,
816  UnitTestImportDashboardCmd(unit_test_context),
817  test_capture_stream)
818  .is_resolved();
819  EXPECT_TRUE(resolution);
820  EXPECT_EQ(unit_test_context.view_name, "\"Who uses spaces anyway?\"");
821  EXPECT_EQ(unit_test_context.view_state, "");
822  EXPECT_EQ(unit_test_context.view_metadata, "");
823 
824  // We are relying on the behavior of not being able to open the file to capture the
825  // filename passed in
826  std::string output_back_to_input(test_capture_stream.str());
827  auto extracted_tokens = TokenExtractor().extract_tokens(output_back_to_input);
828  using TokenCount = decltype(extracted_tokens)::size_type;
829  EXPECT_EQ(extracted_tokens.size(),
830  7u); // Inflated because of spaces in standard output
831  EXPECT_EQ(extracted_tokens[4], "`C:\\Windows");
832  EXPECT_EQ(extracted_tokens[5], "is");
833  EXPECT_EQ(extracted_tokens[6], "Terrible\\lol.txt`");
834 }
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [25/30]

TEST ( OmniSQLTest  ,
ExportDashboardCommandTest_SimpleDashSimpleFilename   
)

Definition at line 855 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::dashboard_owner, run-benchmark-import::result, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

855  {
857  using UnitTestExportDashboardCmd =
858  ExportDashboardCmd<ExportDashboardCommandContextOpsPolicy,
860  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
861 
862  // Create a directory to force file open to fail
863  static const char* test_filename = "export_unlikely_file_to_over_be_opened_1234.txt";
864  std::string fake_input = std::string("\\export_dashboard simpledash ") + test_filename;
865 
866  auto result = mkdir(test_filename, 0700);
867  EXPECT_EQ(result, 0);
868 
869  std::ostringstream test_capture_stream;
870  ExportDashboardCommandMockupContext unit_test_context;
871  auto resolution =
872  CommandResolutionChain<>(fake_input.c_str(),
873  "\\export_dashboard",
874  3,
875  4,
876  UnitTestExportDashboardCmd(unit_test_context),
877  test_capture_stream)
878  .is_resolved();
879 
880  result = rmdir(test_filename);
881  EXPECT_EQ(result, 0);
882 
883  EXPECT_TRUE(resolution);
884  EXPECT_EQ(unit_test_context.view_name, "simpledash");
885  EXPECT_EQ(unit_test_context.view_state, "");
886  EXPECT_EQ(unit_test_context.view_metadata, "");
887  EXPECT_EQ(unit_test_context.dashboard_owner, "");
888 
889  // The file name is not in the output
890  EXPECT_EQ(std::strstr(test_capture_stream.str().c_str(), test_filename), nullptr);
891 
892  unlink(test_filename);
893 }
std::string dashboard_owner
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [26/30]

TEST ( OmniSQLTest  ,
ExportDashboardCommandTest_SimpleDashComplexFilename   
)

Definition at line 895 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::dashboard_owner, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

895  {
897  using UnitTestExportDashboardCmd =
898  ExportDashboardCmd<ExportDashboardCommandContextOpsPolicy,
900  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
901 
902  static const char* test_filename = "Windows is Terrible.txt";
903  std::string fake_input =
904  std::string("\\export_dashboard simpledash \"") + test_filename + "\"";
905 
906  std::ostringstream test_capture_stream;
907  ExportDashboardCommandMockupContext unit_test_context;
908  auto resolution =
909  CommandResolutionChain<>(fake_input.c_str(),
910  "\\export_dashboard",
911  3,
912  4,
913  UnitTestExportDashboardCmd(unit_test_context),
914  test_capture_stream)
915  .is_resolved();
916 
917  EXPECT_TRUE(resolution);
918  EXPECT_EQ(unit_test_context.view_name, "simpledash");
919  EXPECT_EQ(unit_test_context.view_state, "");
920  EXPECT_EQ(unit_test_context.view_metadata, "");
921  EXPECT_EQ(unit_test_context.dashboard_owner, "");
922 
923  EXPECT_EQ(std::strstr(test_capture_stream.str().c_str(), test_filename), nullptr);
924  unlink(test_filename);
925 }
std::string dashboard_owner
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [27/30]

TEST ( OmniSQLTest  ,
ExportDashboardCommandTest_ComplexDashSimpleFilename   
)

Definition at line 927 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::dashboard_owner, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

927  {
929  using UnitTestExportDashboardCmd =
930  ExportDashboardCmd<ExportDashboardCommandContextOpsPolicy,
932  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
933 
934  static const char* test_filename = "export_simpledash.txt";
935  std::string fake_input =
936  std::string("\\export_dashboard \"\\\"Who uses spaces anyway?\\\"\" ") +
937  test_filename;
938 
939  std::ostringstream test_capture_stream;
940  ExportDashboardCommandMockupContext unit_test_context;
941  auto resolution =
942  CommandResolutionChain<>(fake_input.c_str(),
943  "\\export_dashboard",
944  3,
945  4,
946  UnitTestExportDashboardCmd(unit_test_context),
947  test_capture_stream)
948  .is_resolved();
949  EXPECT_TRUE(resolution);
950  EXPECT_EQ(unit_test_context.view_name, "\"Who uses spaces anyway?\"");
951  EXPECT_EQ(unit_test_context.view_state, "");
952  EXPECT_EQ(unit_test_context.view_metadata, "");
953  EXPECT_EQ(unit_test_context.dashboard_owner, "");
954 
955  EXPECT_EQ(std::strstr(test_capture_stream.str().c_str(), test_filename), nullptr);
956  unlink(test_filename);
957 }
std::string dashboard_owner
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [28/30]

TEST ( OmniSQLTest  ,
ExportDashboardCommandTest_ComplexDashComplexFilename   
)

Definition at line 959 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::dashboard_owner, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

959  {
961  using UnitTestExportDashboardCmd =
962  ExportDashboardCmd<ExportDashboardCommandContextOpsPolicy,
964  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
965 
966  static const char* test_filename = "Windows is Terrible.txt";
967  std::string fake_input =
968  std::string("\\export_dashboard \"\\\"Who uses spaces anyway?\\\"\" \"") +
969  test_filename + "\"";
970 
971  std::ostringstream test_capture_stream;
972  ExportDashboardCommandMockupContext unit_test_context;
973  auto resolution =
974  CommandResolutionChain<>(fake_input.c_str(),
975  "\\export_dashboard",
976  3,
977  4,
978  UnitTestExportDashboardCmd(unit_test_context),
979  test_capture_stream)
980  .is_resolved();
981  EXPECT_TRUE(resolution);
982  EXPECT_EQ(unit_test_context.view_name, "\"Who uses spaces anyway?\"");
983  EXPECT_EQ(unit_test_context.view_state, "");
984  EXPECT_EQ(unit_test_context.view_metadata, "");
985  EXPECT_EQ(unit_test_context.dashboard_owner, "");
986 
987  EXPECT_EQ(std::strstr(test_capture_stream.str().c_str(), test_filename), nullptr);
988  unlink(test_filename);
989 }
std::string dashboard_owner
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [29/30]

TEST ( OmniSQLTest  ,
ExportDashboardCommandTest_ComplexDashComplexFilenameWithOwnerName   
)

Definition at line 991 of file OmniSQLCommandTest.cpp.

References MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::dashboard_owner, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_metadata, MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_name, and MetaClientContext< CLIENT_TYPE, TRANSPORT_TYPE >::view_state.

991  {
993  using UnitTestExportDashboardCmd =
994  ExportDashboardCmd<ExportDashboardCommandContextOpsPolicy,
996  using TokenExtractor = UnitTestOutputTokenizer<std::vector<std::string>>;
997 
998  static const char* test_filename = "Windows is Terrible.txt";
999  std::string fake_input =
1000  std::string("\\export_dashboard \"\\\"Who uses spaces anyway?\\\"\" \"") +
1001  test_filename + "\"" + " ChelseaF.C.";
1002 
1003  std::ostringstream test_capture_stream;
1004  ExportDashboardCommandMockupContext unit_test_context;
1005  auto resolution =
1006  CommandResolutionChain<>(fake_input.c_str(),
1007  "\\export_dashboard",
1008  3,
1009  4,
1010  UnitTestExportDashboardCmd(unit_test_context),
1011  test_capture_stream)
1012  .is_resolved();
1013  EXPECT_TRUE(resolution);
1014  EXPECT_EQ(unit_test_context.view_name, "\"Who uses spaces anyway?\"");
1015  EXPECT_EQ(unit_test_context.view_state, "");
1016  EXPECT_EQ(unit_test_context.view_metadata, "");
1017  EXPECT_EQ(unit_test_context.dashboard_owner, "ChelseaF.C.");
1018 
1019  EXPECT_EQ(std::strstr(test_capture_stream.str().c_str(), test_filename), nullptr);
1020  unlink(test_filename);
1021 }
std::string dashboard_owner
std::string view_state
std::string view_metadata
std::vector< std::string > CommandTokenList

◆ TEST() [30/30]

TEST ( OmniSQLTest  ,
DashboardsCommandTest   
)

Definition at line 1052 of file OmniSQLCommandTest.cpp.

References DashboardsCommandMockupContext::get_dashbaords_invoked.

1052  {
1054  using UnitTestDashboardsCmd =
1055  ListDashboardsCmd<DashboardsCommandContextOpsPolicy,
1057  DashboardsCommandMockupContext unit_test_context;
1058 
1059  auto resolution =
1061  "\\dash", "\\dash", 1, 1, UnitTestDashboardsCmd(unit_test_context))
1062  .is_resolved();
1063 
1064  EXPECT_TRUE(unit_test_context.get_dashbaords_invoked);
1065  EXPECT_TRUE(resolution);
1066 }
std::vector< std::string > CommandTokenList