justing-bq commented on code in PR #47788:
URL: https://github.com/apache/arrow/pull/47788#discussion_r2445577714


##########
cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.h:
##########
@@ -0,0 +1,237 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/testing/gtest_util.h"
+#include "arrow/util/io_util.h"
+#include "arrow/util/utf8.h"
+
+#include "arrow/flight/server_middleware.h"
+#include "arrow/flight/sql/client.h"
+#include "arrow/flight/sql/example/sqlite_server.h"
+#include "arrow/flight/sql/odbc/odbc_impl/encoding_utils.h"
+
+#ifdef _WIN32
+#  include <windows.h>
+#endif
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+#include <type_traits>
+
+#include "arrow/flight/sql/odbc/odbc_impl/odbc_connection.h"
+
+// For DSN registration
+#include "arrow/flight/sql/odbc/odbc_impl/system_dsn.h"
+
+#define TEST_CONNECT_STR "ARROW_FLIGHT_SQL_ODBC_CONN"
+#define TEST_DSN "Apache Arrow Flight SQL Test DSN"
+
+namespace arrow::flight::sql::odbc {
+
+class FlightSQLODBCRemoteTestBase : public ::testing::Test {
+ public:
+  /// \brief Allocate environment and connection handles
+  void AllocEnvConnHandles(SQLINTEGER odbc_ver = SQL_OV_ODBC3);
+  /// \brief Connect to Arrow Flight SQL server using connection string 
defined in
+  /// environment variable "ARROW_FLIGHT_SQL_ODBC_CONN", allocate statement 
handle.
+  /// Connects using ODBC Ver 3 by default
+  void Connect(SQLINTEGER odbc_ver = SQL_OV_ODBC3);
+  /// \brief Connect to Arrow Flight SQL server using connection string
+  void ConnectWithString(std::string connection_str);
+  /// \brief Disconnect from server
+  void Disconnect();
+  /// \brief Get connection string from environment variable 
"ARROW_FLIGHT_SQL_ODBC_CONN"
+  std::string virtual GetConnectionString();
+  /// \brief Get invalid connection string based on connection string defined 
in
+  /// environment variable "ARROW_FLIGHT_SQL_ODBC_CONN"
+  std::string virtual GetInvalidConnectionString();
+  /// \brief Return a SQL query that selects all data types
+  std::wstring virtual GetQueryAllDataTypes();
+
+  /** ODBC Environment. */
+  SQLHENV env = 0;
+
+  /** ODBC Connect. */
+  SQLHDBC conn = 0;
+
+  /** ODBC Statement. */
+  SQLHSTMT stmt = 0;
+
+ protected:
+  void SetUp() override;
+};
+
+static constexpr std::string_view authorization_header = "authorization";
+static constexpr std::string_view bearer_prefix = "Bearer ";
+static constexpr std::string_view test_token = "t0k3n";

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to