提交 27db778b 编写于 作者: Z zyyang

change

上级 b0515fd7
...@@ -16,8 +16,8 @@ public class ImportTest { ...@@ -16,8 +16,8 @@ public class ImportTest {
String host = "127.0.0.1"; String host = "127.0.0.1";
private static long ts; private static long ts;
@Before @BeforeClass
public void createDatabase() { public void before() {
try { try {
Class.forName("com.taosdata.jdbc.TSDBDriver"); Class.forName("com.taosdata.jdbc.TSDBDriver");
Properties properties = new Properties(); Properties properties = new Properties();
...@@ -27,13 +27,13 @@ public class ImportTest { ...@@ -27,13 +27,13 @@ public class ImportTest {
connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties); connection = DriverManager.getConnection("jdbc:TAOS://" + host + ":0/", properties);
Statement stmt = connection.createStatement(); Statement stmt = connection.createStatement();
stmt.executeUpdate("drop database if exists " + dbName); stmt.execute("create database if not exists " + dbName);
stmt.executeUpdate("create database if not exists " + dbName); stmt.execute("create table if not exists " + dbName + "." + tName + " (ts timestamp, k int, v int)");
stmt.executeUpdate("create table if not exists " + dbName + "." + tName + " (ts timestamp, k int, v int)");
ts = System.currentTimeMillis();
stmt.close(); stmt.close();
ts = System.currentTimeMillis();
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
return; e.printStackTrace();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -99,7 +99,7 @@ public class ImportTest { ...@@ -99,7 +99,7 @@ public class ImportTest {
Assert.assertEquals(100, select()); Assert.assertEquals(100, select());
} }
@After @AfterClass
public void close() { public void close() {
try { try {
if (connection != null) { if (connection != null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册