-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test][E2E] chunjun-e2e complete oracle tests.
- Loading branch information
Showing
13 changed files
with
480 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,105 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>chunjun-connectors</artifactId> | ||
<groupId>com.dtstack.chunjun</groupId> | ||
<version>1.12-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>chunjun-connectors</artifactId> | ||
<groupId>com.dtstack.chunjun</groupId> | ||
<version>1.12-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>chunjun-connector-oracle</artifactId> | ||
<name>ChunJun : Connectors : Oracle</name> | ||
<artifactId>chunjun-connector-oracle</artifactId> | ||
<name>ChunJun : Connectors : Oracle</name> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.dtstack.chunjun</groupId> | ||
<artifactId>chunjun-connector-jdbc-base</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.dtstack.chunjun</groupId> | ||
<artifactId>chunjun-connector-jdbc-base</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.github.noraui</groupId> | ||
<artifactId>ojdbc8</artifactId> | ||
<version>12.2.0.1</version> | ||
</dependency> | ||
</dependencies> | ||
<dependency> | ||
<groupId>com.github.noraui</groupId> | ||
<artifactId>ojdbc8</artifactId> | ||
<version>12.2.0.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
</plugin> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
<artifactSet> | ||
<excludes> | ||
<exclude>org.slf4j:slf4j-api</exclude> | ||
<exclude>log4j:log4j</exclude> | ||
<exclude>ch.qos.logback:*</exclude> | ||
</excludes> | ||
</artifactSet> | ||
<relocations> | ||
<relocation> | ||
<pattern>com.google.common</pattern> | ||
<shadedPattern>shade.core.com.google.common</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-resources</id> | ||
<!-- here the phase you need --> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<copy todir="${basedir}/../../${dist.dir}/connector/oracle/" | ||
file="${basedir}/target/${project.artifactId}-${project.version}.jar"/> | ||
<move file="${basedir}/../../${dist.dir}/connector/oracle/${project.artifactId}-${project.version}.jar" | ||
tofile="${basedir}/../../${dist.dir}/connector/oracle/${project.artifactId}.jar"/> | ||
<delete> | ||
<fileset dir="${basedir}/../../${dist.dir}/connector/oracle/" | ||
includes="${project.artifactId}-*.jar" | ||
excludes="${project.artifactId}.jar"/> | ||
</delete> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-resources</id> | ||
<!-- here the phase you need --> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> | ||
<tasks> | ||
<copy todir="${basedir}/../../${dist.dir}/connector/oracle/" | ||
file="${basedir}/target/${project.artifactId}-${project.version}.jar"/> | ||
<move file="${basedir}/../../${dist.dir}/connector/oracle/${project.artifactId}-${project.version}.jar" | ||
tofile="${basedir}/../../${dist.dir}/connector/oracle/${project.artifactId}.jar"/> | ||
<delete> | ||
<fileset dir="${basedir}/../../${dist.dir}/connector/oracle/" | ||
includes="${project.artifactId}-*.jar" | ||
excludes="${project.artifactId}.jar"/> | ||
</delete> | ||
</tasks> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
...un-e2e/src/test/java/com/dtstack/chunjun/connector/containers/oracle/OracleContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* 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 com.dtstack.chunjun.connector.containers.oracle; | ||
|
||
import org.testcontainers.containers.JdbcDatabaseContainer; | ||
import org.testcontainers.containers.wait.strategy.WaitStrategy; | ||
import org.testcontainers.containers.wait.strategy.WaitStrategyTarget; | ||
import org.testcontainers.images.builder.ImageFromDockerfile; | ||
|
||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
import java.nio.file.Paths; | ||
import java.time.Duration; | ||
|
||
public class OracleContainer extends JdbcDatabaseContainer { | ||
private static final URL ORACLE_DOCKERFILE = | ||
OracleContainer.class.getClassLoader().getResource("docker/oracle/Dockerfile"); | ||
|
||
private static final String ORACLE_HOST = "chunjun-e2e-oracle11"; | ||
|
||
private static final String ORACLE_DRIVER_CLASS = "oracle.jdbc.driver.OracleDriver"; | ||
|
||
private static final Integer ORACLE_PORT = 1521; | ||
|
||
private static final String SID = "xe"; | ||
|
||
private static final String USERNAME = "system"; | ||
|
||
private static final String PASSWORD = "oracle"; | ||
|
||
public OracleContainer() throws URISyntaxException { | ||
super( | ||
new ImageFromDockerfile(ORACLE_HOST, true) | ||
.withDockerfile(Paths.get(ORACLE_DOCKERFILE.toURI()))); | ||
withExposedPorts(ORACLE_PORT); | ||
waitingFor( | ||
new WaitStrategy() { | ||
@Override | ||
public void waitUntilReady(WaitStrategyTarget waitStrategyTarget) {} | ||
|
||
@Override | ||
public WaitStrategy withStartupTimeout(Duration startupTimeout) { | ||
return null; | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public String getDriverClassName() { | ||
return ORACLE_DRIVER_CLASS; | ||
} | ||
|
||
@Override | ||
public String getJdbcUrl() { | ||
return "jdbc:oracle:thin:" | ||
+ this.getUsername() | ||
+ "/" | ||
+ this.getPassword() | ||
+ "@" | ||
+ this.getHost() | ||
+ ":" | ||
+ getMappedPort(ORACLE_PORT) | ||
+ ":" | ||
+ this.getSid(); | ||
} | ||
|
||
@Override | ||
public String getUsername() { | ||
return USERNAME; | ||
} | ||
|
||
@Override | ||
public String getPassword() { | ||
return PASSWORD; | ||
} | ||
|
||
@Override | ||
public String getTestQueryString() { | ||
return "SELECT 1 FROM DUAL"; | ||
} | ||
|
||
public String getSid() { | ||
return SID; | ||
} | ||
|
||
public Integer getOraclePort() { | ||
return this.getMappedPort(1521); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
...src/test/java/com/dtstack/chunjun/connector/test/containers/FlinkStandaloneContainer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.