提交 a96a7e89 编写于 作者: H huolibo

[feat]<TD-10424>:change junit test method

上级 41ecacf1
...@@ -72,13 +72,12 @@ public class OpenTSDBMigrateTest { ...@@ -72,13 +72,12 @@ public class OpenTSDBMigrateTest {
while (rs.next()) { while (rs.next()) {
Assert.assertEquals(jObject.getString("metric").replaceAll("\\.", "_"), rs.getString(1)); Assert.assertEquals(jObject.getString("metric").replaceAll("\\.", "_"), rs.getString(1));
} }
statement.execute("drop table " + jObject.getString("metric").replaceAll("\\.", "_"));
rs.close(); rs.close();
statement.close(); statement.close();
} }
@BeforeClass @Before
public static void beforeClass() { public void beforeClass() {
final String url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata"; final String url = "jdbc:TAOS://" + host + ":6030/?user=root&password=taosdata";
try { try {
conn = (TSDBConnection) DriverManager.getConnection(url); conn = (TSDBConnection) DriverManager.getConnection(url);
...@@ -91,8 +90,8 @@ public class OpenTSDBMigrateTest { ...@@ -91,8 +90,8 @@ public class OpenTSDBMigrateTest {
} }
} }
@AfterClass @After
public static void afterClass() { public void afterClass() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
stmt.execute("drop database if exists " + dbname); stmt.execute("drop database if exists " + dbname);
stmt.close(); stmt.close();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册