EMsnap commented on code in PR #8980: URL: https://github.com/apache/inlong/pull/8980#discussion_r1338197821
########## inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/MysqlToRocksTest.java: ########## @@ -0,0 +1,217 @@ +/* + * 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.inlong.sort.tests; + +import org.apache.inlong.sort.tests.utils.FlinkContainerTestEnv; +import org.apache.inlong.sort.tests.utils.JdbcProxy; +import org.apache.inlong.sort.tests.utils.MySqlContainer; +import org.apache.inlong.sort.tests.utils.StarRocksContainer; +import org.apache.inlong.sort.tests.utils.TestUtils; + +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.lifecycle.Startables; +import org.testcontainers.utility.MountableFile; + +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.time.Duration; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +/** + * End-to-end tests for sort-connector-postgres-cdc-v1.15 uber jar. + * Test flink sql Postgres cdc to StarRocks + */ +public class MysqlToRocksTest extends FlinkContainerTestEnv { + + private static final Logger LOG = LoggerFactory.getLogger(PostgresToStarRocksTest.class); + + private static final Path mysqlJar = TestUtils.getResource("sort-connector-mysql-cdc.jar"); + private static final Path jdbcJar = TestUtils.getResource("sort-connector-starrocks.jar"); + private static final Path mysqlJdbcJar = TestUtils.getResource("mysql-driver.jar"); + + private static final Logger STAR_ROCKS_LOG = LoggerFactory.getLogger(StarRocksContainer.class); + + private static final String sqlFile; + + // ---------------------------------------------------------------------------------------- + // StarRocks Variables + // ---------------------------------------------------------------------------------------- + private static final String INTER_CONTAINER_STAR_ROCKS_ALIAS = "starrocks"; + private static final String NEW_STARROCKS_REPOSITORY = "inlong-starrocks"; + private static final String NEW_STARROCKS_TAG = "latest"; + private static final String STAR_ROCKS_IMAGE_NAME = "starrocks/allin1-ubi:3.0.4"; + + static { + try { + sqlFile = + Paths.get(PostgresToStarRocksTest.class.getResource("/flinkSql/mysql_test.sql").toURI()).toString(); + buildStarRocksImage(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + private static String getNewStarRocksImageName() { + return NEW_STARROCKS_REPOSITORY + ":" + NEW_STARROCKS_TAG; + } + + public static void buildStarRocksImage() { Review Comment: duplicate with test code in postgreToStarrocks -- 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-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org