提交 f52b5fe4 编写于 作者: Z zyyang

change

上级 cb017ca0
......@@ -24,11 +24,10 @@ public class TSDBDriverTest {
"jdbc:TAOS://:/test",
"jdbc:TAOS://localhost:0/?user=root&password=taosdata"
};
private Connection conn;
@Test
public void testConnectWithJdbcURL() {
public void connectWithJdbcURL() {
final String url = "jdbc:TAOS://localhost:6030/log?user=root&password=taosdata";
try {
conn = DriverManager.getConnection(url);
......@@ -40,7 +39,7 @@ public class TSDBDriverTest {
}
@Test
public void testConnectWithProperties() {
public void connectWithProperties() {
final String jdbcUrl = "jdbc:TAOS://localhost:6030/log?user=root&password=taosdata";
Properties connProps = new Properties();
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
......@@ -56,7 +55,7 @@ public class TSDBDriverTest {
}
@Test
public void testConnectWithConfigFile() {
public void connectWithConfigFile() {
String jdbcUrl = "jdbc:TAOS://:/log?user=root&password=taosdata";
Properties connProps = new Properties();
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
......@@ -71,16 +70,6 @@ public class TSDBDriverTest {
}
}
@Test(expected = SQLException.class)
public void testAcceptsURL() throws SQLException {
Driver driver = new TSDBDriver();
for (String url : validURLs) {
assertTrue("failure - acceptsURL(\" " + url + " \") should be true", driver.acceptsURL(url));
}
driver.acceptsURL(null);
fail("acceptsURL throws exception when parameter is null");
}
@Test
public void testParseURL() {
TSDBDriver driver = new TSDBDriver();
......@@ -121,8 +110,19 @@ public class TSDBDriverTest {
assertNull("failure - dbname should be null", actual.getProperty("dbname"));
}
@Test(expected = SQLException.class)
public void acceptsURL() throws SQLException {
Driver driver = new TSDBDriver();
for (String url : validURLs) {
assertTrue("failure - acceptsURL(\" " + url + " \") should be true", driver.acceptsURL(url));
}
driver.acceptsURL(null);
fail("acceptsURL throws exception when parameter is null");
}
@Test
public void testGetPropertyInfo() throws SQLException {
public void getPropertyInfo() throws SQLException {
Driver driver = new TSDBDriver();
final String url = "jdbc:TAOS://localhost:6030/log?user=root&password=taosdata";
Properties connProps = new Properties();
......@@ -142,23 +142,23 @@ public class TSDBDriverTest {
}
@Test
public void testGetMajorVersion() {
assertEquals("failure - getMajorVersion should be 2", 2, new TSDBDriver().getMajorVersion());
public void getMajorVersion() {
assertEquals(2, new TSDBDriver().getMajorVersion());
}
@Test
public void testGetMinorVersion() {
assertEquals("failure - getMinorVersion should be 0", 0, new TSDBDriver().getMinorVersion());
public void getMinorVersion() {
assertEquals(0, new TSDBDriver().getMinorVersion());
}
@Test
public void testJdbcCompliant() {
assertFalse("failure - jdbcCompliant should be false", new TSDBDriver().jdbcCompliant());
public void jdbcCompliant() {
assertFalse(new TSDBDriver().jdbcCompliant());
}
@Test
public void testGetParentLogger() throws SQLFeatureNotSupportedException {
assertNull("failure - getParentLogger should be be null", new TSDBDriver().getParentLogger());
public void getParentLogger() throws SQLFeatureNotSupportedException {
assertNull(new TSDBDriver().getParentLogger());
}
@BeforeClass
......@@ -169,6 +169,4 @@ public class TSDBDriverTest {
e.printStackTrace();
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册