YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/integration-tests/cql_test_base.h
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) YugaByte, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4
// in compliance with the License.  You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software distributed under the License
9
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10
// or implied.  See the License for the specific language governing permissions and limitations
11
// under the License.
12
//
13
14
#ifndef YB_INTEGRATION_TESTS_CQL_TEST_BASE_H
15
#define YB_INTEGRATION_TESTS_CQL_TEST_BASE_H
16
17
#include "yb/integration-tests/cql_test_util.h"
18
#include "yb/integration-tests/mini_cluster.h"
19
#include "yb/integration-tests/yb_mini_cluster_test_base.h"
20
21
#include "yb/yql/cql/cqlserver/cql_server.h"
22
23
namespace yb {
24
25
template <class MiniClusterType>
26
class CqlTestBase : public MiniClusterTestWithClient<MiniClusterType> {
27
 public:
28
  static constexpr auto kDefaultNumMasters = 1;
29
  static constexpr auto kDefaultNumTabletServers = 3;
30
31
  virtual int num_masters() {
32
    return kDefaultNumMasters;
33
  }
34
35
  virtual int num_tablet_servers() {
36
    return kDefaultNumTabletServers;
37
  }
38
39
  void SetUp() override;
40
41
  CHECKED_STATUS RestartCluster();
42
  void ShutdownCluster();
43
  CHECKED_STATUS StartCluster();
44
45
 protected:
46
  void DoTearDown() override;
47
48
0
  virtual void SetUpFlags() {}
49
50
  std::unique_ptr<CppCassandraDriver> driver_;
51
  std::unique_ptr<cqlserver::CQLServer> cql_server_;
52
  typename MiniClusterType::Options mini_cluster_opt_;
53
54
 private:
55
  void SetupClusterOpt();
56
  CHECKED_STATUS StartCQLServer();
57
58
  std::string cql_host_;
59
  uint16_t cql_port_ = 0;
60
};
61
62
} // namespace yb
63
64
#endif // YB_INTEGRATION_TESTS_CQL_TEST_BASE_H