Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7322502
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f7322502
编写于
6月 09, 2020
作者:
S
Shuaiqiang Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tests: add test
上级
2bb969a9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
211 addition
and
123 deletion
+211
-123
src/connector/jdbc/pom.xml
src/connector/jdbc/pom.xml
+134
-117
src/connector/jdbc/src/test/java/TestPreparedStatement.java
src/connector/jdbc/src/test/java/TestPreparedStatement.java
+1
-0
src/connector/jdbc/src/test/java/com/taosdata/jdbc/AsyncSubscribeTest.java
...c/src/test/java/com/taosdata/jdbc/AsyncSubscribeTest.java
+1
-1
src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java
...ctor/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java
+5
-4
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SelectTest.java
...ctor/jdbc/src/test/java/com/taosdata/jdbc/SelectTest.java
+65
-0
src/connector/jdbc/src/test/java/com/taosdata/jdbc/StableTest.java
...ctor/jdbc/src/test/java/com/taosdata/jdbc/StableTest.java
+4
-0
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
...r/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
+1
-1
未找到文件。
src/connector/jdbc/pom.xml
浏览文件 @
f7322502
<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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
1.0.3
</version>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<description>
TDengine JDBC Driver
</description>
<licenses>
<license>
<name>
GNU AFFERO GENERAL PUBLIC LICENSE Version 3
</name>
<url>
https://github.com/taosdata/TDengine/blob/master/LICENSE
</url>
<distribution>
repo
</distribution>
</license>
</licenses>
<scm>
<connection>
scm:git:git://github.com/taosdata/TDengine.git
</connection>
<developerConnection>
scm:git:git@github.com:taosdata/TDengine.git
</developerConnection>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<tag>
HEAD
</tag>
</scm>
<developers>
<developer>
<name>
taosdata
</name>
<email>
support@taosdata.com
</email>
<organization>
https://www.taosdata.com/
</organization>
<organizationUrl>
https://www.taosdata.com/
</organizationUrl>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<maven-compiler-plugin.version>
3.6.0
</maven-compiler-plugin.version>
<commons-logging.version>
1.1.2
</commons-logging.version>
<commons-lang3.version>
3.5
</commons-lang3.version>
</properties>
<dependencies>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
${commons-logging.version}
</version>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
${commons-lang3.version}
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.8.2
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.0.0
</version>
<configuration>
<descriptors>
<!--<descriptor>src/main/assembly/assembly.xml</descriptor>-->
<descriptor>
src/main/assembly/assembly-jar.xml
</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
${maven-compiler-plugin.version}
</version>
<configuration>
<encoding>
UTF-8
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<debug>
true
</debug>
<showDeprecation>
true
</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.12.4
</version>
<configuration>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.taosdata.jdbc
</groupId>
<artifactId>
taos-jdbcdriver
</artifactId>
<version>
1.0.3
</version>
<packaging>
jar
</packaging>
<name>
JDBCDriver
</name>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<description>
TDengine JDBC Driver
</description>
<licenses>
<license>
<name>
GNU AFFERO GENERAL PUBLIC LICENSE Version 3
</name>
<url>
https://github.com/taosdata/TDengine/blob/master/LICENSE
</url>
<distribution>
repo
</distribution>
</license>
</licenses>
<scm>
<connection>
scm:git:git://github.com/taosdata/TDengine.git
</connection>
<developerConnection>
scm:git:git@github.com:taosdata/TDengine.git
</developerConnection>
<url>
https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc
</url>
<tag>
HEAD
</tag>
</scm>
<developers>
<developer>
<name>
taosdata
</name>
<email>
support@taosdata.com
</email>
<organization>
https://www.taosdata.com/
</organization>
<organizationUrl>
https://www.taosdata.com/
</organizationUrl>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
<maven-compiler-plugin.version>
3.6.0
</maven-compiler-plugin.version>
<commons-logging.version>
1.1.2
</commons-logging.version>
<commons-lang3.version>
3.5
</commons-lang3.version>
</properties>
<dependencies>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
<version>
${commons-logging.version}
</version>
<exclusions>
<exclusion>
<groupId>
*
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
${commons-lang3.version}
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.8.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.jacoco
</groupId>
<artifactId>
jacoco-maven-plugin
</artifactId>
<version>
0.8.3
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
3.0.0
</version>
<configuration>
<descriptors>
<descriptor>
src/main/assembly/assembly-jar.xml
</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
${maven-compiler-plugin.version}
</version>
<configuration>
<encoding>
UTF-8
</encoding>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<debug>
true
</debug>
<showDeprecation>
true
</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<version>
2.12.4
</version>
<configuration>
<testFailureIgnore>
true
</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>
org.jacoco
</groupId>
<artifactId>
jacoco-maven-plugin
</artifactId>
<version>
0.8.3
</version>
<configuration>
<includes>
<include>
com/**/*
</include>
</includes>
</configuration>
<executions>
<execution>
<id>
pre-test
</id>
<goals>
<goal>
prepare-agent
</goal>
</goals>
</execution>
<execution>
<id>
post-test
</id>
<phase>
test
</phase>
<goals>
<goal>
report
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
src/connector/jdbc/src/test/java/TestPreparedStatement.java
浏览文件 @
f7322502
...
...
@@ -22,6 +22,7 @@ public class TestPreparedStatement {
}
}
resSet
.
close
();
pstmt
.
close
();
connection
.
close
();
}
catch
(
Exception
e
)
{
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/
TSDB
AsyncSubscribeTest.java
→
src/connector/jdbc/src/test/java/com/taosdata/jdbc/AsyncSubscribeTest.java
浏览文件 @
f7322502
...
...
@@ -12,7 +12,7 @@ import java.util.Properties;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
TSDB
AsyncSubscribeTest
{
public
class
AsyncSubscribeTest
{
Connection
connection
=
null
;
Statement
statement
=
null
;
String
dbName
=
"test"
;
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/
TSDB
ImportTest.java
→
src/connector/jdbc/src/test/java/com/taosdata/jdbc/ImportTest.java
浏览文件 @
f7322502
...
...
@@ -9,7 +9,7 @@ import java.util.Properties;
import
static
org
.
junit
.
Assert
.
assertEquals
;
public
class
TSDB
ImportTest
{
public
class
ImportTest
{
Connection
connection
=
null
;
Statement
statement
=
null
;
String
dbName
=
"test"
;
...
...
@@ -36,7 +36,7 @@ public class TSDBImportTest {
}
@Test
public
void
insert
Into
()
throws
Exception
{
public
void
insert
Data
()
throws
Exception
{
long
ts
=
1496732686000
l
;
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
...
...
@@ -49,6 +49,7 @@ public class TSDBImportTest {
@Test
public
void
selectData
()
throws
Exception
{
insertData
();
String
sql
=
"select * from test.t0"
;
ResultSet
resSet
=
statement
.
executeQuery
(
sql
);
...
...
@@ -61,7 +62,7 @@ public class TSDBImportTest {
}
@Test
public
void
import
Into
()
throws
Exception
{
public
void
import
Data
()
throws
Exception
{
// 避免时间重复
long
ts
=
1496732686000
l
;
...
...
@@ -78,7 +79,7 @@ public class TSDBImportTest {
assertEquals
(
10
,
rows
);
}
//
@After
@After
public
void
close
()
throws
Exception
{
statement
.
executeUpdate
(
"drop database "
+
dbName
);
statement
.
close
();
...
...
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SelectTest.java
0 → 100644
浏览文件 @
f7322502
package
com.taosdata.jdbc
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.sql.*
;
import
java.util.Properties
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
public
class
SelectTest
{
Connection
connection
=
null
;
Statement
statement
=
null
;
String
dbName
=
"test"
;
String
tName
=
"t0"
;
String
host
=
"localhost"
;
@Before
public
void
createDatabaseAndTable
()
throws
SQLException
{
try
{
Class
.
forName
(
"com.taosdata.jdbc.TSDBDriver"
);
}
catch
(
ClassNotFoundException
e
)
{
return
;
}
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
TSDBDriver
.
PROPERTY_KEY_HOST
,
host
);
connection
=
DriverManager
.
getConnection
(
"jdbc:TAOS://"
+
host
+
":0/"
+
"?user=root&password=taosdata"
,
properties
);
statement
=
connection
.
createStatement
();
statement
.
executeUpdate
(
"drop database if exists "
+
dbName
);
statement
.
executeUpdate
(
"create database if not exists "
+
dbName
);
statement
.
executeUpdate
(
"create table if not exists "
+
dbName
+
"."
+
tName
+
" (ts timestamp, k int, v int)"
);
}
@Test
public
void
selectData
()
throws
SQLException
{
long
ts
=
1496732686000
l
;
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
ts
++;
int
row
=
statement
.
executeUpdate
(
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
", "
+
(
100
+
i
)
+
", "
+
i
+
")"
);
System
.
out
.
println
(
"insert into "
+
dbName
+
"."
+
tName
+
" values ("
+
ts
+
", "
+
(
100
+
i
)
+
", "
+
i
+
")\t"
+
row
);
assertEquals
(
1
,
row
);
}
String
sql
=
"select * from "
+
dbName
+
"."
+
tName
;
ResultSet
resSet
=
statement
.
executeQuery
(
sql
);
int
num
=
0
;
while
(
resSet
.
next
())
{
num
++;
}
resSet
.
close
();
assertEquals
(
num
,
50
);
}
public
void
close
()
throws
SQLException
{
statement
.
executeUpdate
(
"drop database "
+
dbName
);
statement
.
close
();
connection
.
close
();
}
}
src/connector/jdbc/src/test/java/com/taosdata/jdbc/StableTest.java
0 → 100644
浏览文件 @
f7322502
package
com.taosdata.jdbc
;
public
class
StableTest
{
}
src/connector/jdbc/src/test/java/com/taosdata/jdbc/
TSDB
SubscribeTest.java
→
src/connector/jdbc/src/test/java/com/taosdata/jdbc/SubscribeTest.java
浏览文件 @
f7322502
...
...
@@ -12,7 +12,7 @@ import java.util.Properties;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
TSDB
SubscribeTest
{
public
class
SubscribeTest
{
Connection
connection
=
null
;
Statement
statement
=
null
;
String
dbName
=
"test"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录