Unverified Commit 05d94577 authored by Licho's avatar Licho Committed by GitHub

feat: add junit5 for exector (#1528)

* feat: add junit5 for exector * feat: add junit test Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * chore: spotless Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> Signed-off-by: 's avatarlicho <lecho.sun@gmail.com>
parent 73d8ec7a
......@@ -26,35 +26,40 @@ package org.dinky.model;
* @since 2022/2/17 10:59
**/
public enum ColumnType {
STRING("java.lang.String", "STRING"),
JAVA_LANG_BOOLEAN("java.lang.Boolean", "BOOLEAN"),
BOOLEAN("Boolean", "BOOLEAN NOT NULL"),
JAVA_LANG_BYTE("java.lang.Byte", "TINYINT"),
BYTE("byte", "TINYINT NOT NULL"),
JAVA_LANG_SHORT("java.lang.Short", "SMALLINT"),
SHORT("short", "SMALLINT NOT NULL"),
INTEGER("java.lang.Integer", "INT"),
INT("int", "INT NOT NULL"),
JAVA_LANG_LONG("java.lang.Long", "BIGINT"),
LONG("long", "BIGINT NOT NULL"),
JAVA_LANG_FLOAT("java.lang.Float", "FLOAT"),
FLOAT("float", "FLOAT NOT NULL"),
JAVA_LANG_DOUBLE("java.lang.Double", "DOUBLE"),
DOUBLE("double", "DOUBLE NOT NULL"),
DATE("java.sql.Date", "DATE"),
LOCALDATE("java.time.LocalDate", "DATE"),
TIME("java.sql.Time", "TIME"),
LOCALTIME("java.time.LocalTime", "TIME"),
TIMESTAMP("java.sql.Timestamp", "TIMESTAMP"),
LOCALDATETIME("java.time.LocalDateTime", "TIMESTAMP"),
OFFSETDATETIME("java.time.OffsetDateTime", "TIMESTAMP WITH TIME ZONE"),
INSTANT("java.time.Instant", "TIMESTAMP_LTZ"),
DURATION("java.time.Duration", "INVERVAL SECOND"),
PERIOD("java.time.Period", "INTERVAL YEAR TO MONTH"),
DECIMAL("java.math.BigDecimal", "DECIMAL"),
BYTES("byte[]", "BYTES"),
T("T[]", "ARRAY"),
MAP("java.util.Map<K, V>", "MAP");
STRING("java.lang.String", "STRING"), JAVA_LANG_BOOLEAN("java.lang.Boolean", "BOOLEAN"), BOOLEAN("Boolean",
"BOOLEAN NOT NULL"), JAVA_LANG_BYTE("java.lang.Byte", "TINYINT"), BYTE("byte",
"TINYINT NOT NULL"), JAVA_LANG_SHORT("java.lang.Short", "SMALLINT"), SHORT("short",
"SMALLINT NOT NULL"), INTEGER("java.lang.Integer", "INT"), INT("int",
"INT NOT NULL"), JAVA_LANG_LONG("java.lang.Long", "BIGINT"), LONG("long",
"BIGINT NOT NULL"), JAVA_LANG_FLOAT("java.lang.Float", "FLOAT"), FLOAT(
"float", "FLOAT NOT NULL"), JAVA_LANG_DOUBLE("java.lang.Double",
"DOUBLE"), DOUBLE("double", "DOUBLE NOT NULL"), DATE(
"java.sql.Date", "DATE"), LOCALDATE(
"java.time.LocalDate", "DATE"), TIME(
"java.sql.Time", "TIME"), LOCALTIME(
"java.time.LocalTime",
"TIME"), TIMESTAMP(
"java.sql.Timestamp",
"TIMESTAMP"), LOCALDATETIME(
"java.time.LocalDateTime",
"TIMESTAMP"), OFFSETDATETIME(
"java.time.OffsetDateTime",
"TIMESTAMP WITH TIME ZONE"), INSTANT(
"java.time.Instant",
"TIMESTAMP_LTZ"), DURATION(
"java.time.Duration",
"INVERVAL SECOND"), PERIOD(
"java.time.Period",
"INTERVAL YEAR TO MONTH"), DECIMAL(
"java.math.BigDecimal",
"DECIMAL"), BYTES(
"byte[]",
"BYTES"), T(
"T[]",
"ARRAY"), MAP(
"java.util.Map<K, V>",
"MAP");
private String javaType;
private String flinkType;
......
......@@ -78,6 +78,57 @@
</exclusion>
</exclusions>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<type>jar</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
......
/*
*
* 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.dinky.executor;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
/**
*
*/
class SqlManagerTest {
@Test
void getSqlFragment() {
SqlManager sqlManager = new SqlManager();
}
}
......@@ -50,6 +50,7 @@
</modules>
<properties>
<assertj.version>3.21.0</assertj.version>
<clickhouse.version>0.2.6</clickhouse.version>
<commons-email>1.5</commons-email>
<commons-lang3.version>3.3.2</commons-lang3.version>
......@@ -57,6 +58,7 @@
<docker.java.version>3.2.13</docker.java.version>
<druid-starter>1.2.8</druid-starter>
<guava.version>31.1-jre</guava.version>
<hamcrest.version>1.3</hamcrest.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<httpclient.version>4.5.13</httpclient.version>
<hutool.version>5.8.4</hutool.version>
......@@ -65,7 +67,9 @@
<javax.mail>1.6.2</javax.mail>
<jaxb.version>2.3.0</jaxb.version>
<jedis.version>2.9.0</jedis.version>
<jedis.version>2.9.0</jedis.version>
<junit.version>4.12</junit.version>
<junit5.version>5.9.1</junit5.version>
<knife4j.version>3.0.3</knife4j.version>
<log4j.version>2.19.0</log4j.version>
<lombok.version>1.18.24</lombok.version>
......@@ -78,11 +82,13 @@
<maven.compiler.source>${target.java.version}</maven.compiler.source>
<maven.compiler.target>${target.java.version}</maven.compiler.target>
<maven.resource.version>3.2.0</maven.resource.version>
<mockito.version>2.21.0</mockito.version>
<mybatis-plus-boot-starter.version>3.5.1</mybatis-plus-boot-starter.version>
<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
<ojdbc8.version>12.2.0.1</ojdbc8.version>
<poi.version>4.1.2</poi.version>
<postgresql.version>42.2.14</postgresql.version>
<powermock.version>2.0.9</powermock.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<protobuf-java.version>2.5.0</protobuf-java.version>
......@@ -97,10 +103,51 @@
<spotless.version>2.27.1</spotless.version>
<spring-boot-dependencies.version>2.6.13</spring-boot-dependencies.version>
<target.java.version>8</target.java.version>
<testcontainers.version>1.16.2</testcontainers.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit5.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
......@@ -238,18 +285,6 @@
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>provided</scope>
</dependency>
<!-- flyway -->
<!--<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>-->
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot-starter</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment