You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/10/12 06:54:43 UTC

[GitHub] [incubator-seatunnel] hailin0 commented on a diff in pull request #3017: [Feature][Connector-V2] Jdbc connector support SAP HANA.

hailin0 commented on code in PR #3017:
URL: https://github.com/apache/incubator-seatunnel/pull/3017#discussion_r993061586


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-jdbc-e2e/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcSapHanaIT.java:
##########
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+package org.apache.seatunnel.connectors.seatunnel.jdbc;
+
+import static org.awaitility.Awaitility.given;
+
+import org.apache.seatunnel.connectors.seatunnel.jdbc.util.JdbcCompareUtil;
+import org.apache.seatunnel.e2e.common.TestResource;
+import org.apache.seatunnel.e2e.common.TestSuiteBase;
+import org.apache.seatunnel.e2e.common.container.TestContainer;
+import org.apache.seatunnel.e2e.common.util.ContainerUtil;
+
+import com.google.common.collect.Lists;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.TestTemplate;
+import org.testcontainers.containers.Container;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.lifecycle.Startables;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+@Slf4j
+public class JdbcSapHanaIT extends TestSuiteBase implements TestResource {
+
+    private static final String SAP_HANA_DOCKER_IMAGE = "sergeyzharko/saphana";
+
+    private static final String SAP_HANA_CONTAINER_HOST = "e2e_saphana";
+
+    private static final int SAP_HANA_PORT = 39015;
+
+    private static final int SAP_HANA_CONTAINER_PORT = 39015;
+
+    private static final String SAP_HANA_CONNECT_URL = "jdbc:sap://%s:39015";
+
+    private static final String SAP_HANA_JDBC_DRIVER = "com.sap.db.jdbc.Driver";
+
+    private static final String SOURCE_TABLE = "E2E_TABLE_SOURCE";
+
+    private static final String SINK_TABLE = "E2E_TABLE_SINK";
+
+    private static final String SAP_HANA_USERNAME = "SYSDBA";
+
+    private static final String SAP_HANA_PASSWORD = "SYSDBA";
+
+    private static final String SAP_HANA_DATABASE = "E2E_TEST";
+
+    private Connection jdbcConnection;
+
+    private GenericContainer<?> dbServer;
+
+    @Override
+    public void startUp() throws Exception {
+        dbServer = new GenericContainer<>(SAP_HANA_DOCKER_IMAGE)
+            .withNetwork(NETWORK)
+            .withNetworkAliases(SAP_HANA_CONTAINER_HOST)
+            .withLogConsumer(new Slf4jLogConsumer(log));

Review Comment:
   ```suggestion
               .withLogConsumer(new Slf4jLogConsumer(DockerLoggerFactory.getLogger(SAP_HANA_DOCKER_IMAGE)));
   ```
   
   https://github.com/apache/incubator-seatunnel/pull/3028



-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org