This commit is contained in:
zyyang 2020-11-04 19:12:57 +08:00
parent e21088d57d
commit 60d04f8121
1 changed files with 4 additions and 4 deletions

View File

@ -125,7 +125,7 @@ public class TSDBDriverTest {
@Test @Test
public void testConnectWithProperties() { public void testConnectWithProperties() {
final String jdbcUrl = "jdbc:TAOS://localhost:6030/test?user=root&password=taosdata"; final String jdbcUrl = "jdbc:TAOS://localhost:6030/log?user=root&password=taosdata";
Properties connProps = new Properties(); Properties connProps = new Properties();
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
@ -138,9 +138,9 @@ public class TSDBDriverTest {
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
if (!isTaosdActived) { if (!isTaosdActived) {
System.out.println(e.getMessage());
assertEquals("failure - should throw SQLException", "TDengine Error: Unable to establish connection", e.getMessage()); assertEquals("failure - should throw SQLException", "TDengine Error: Unable to establish connection", e.getMessage());
} } else {
else {
fail("failure - should not throw Exception"); fail("failure - should not throw Exception");
} }
} }
@ -148,7 +148,7 @@ public class TSDBDriverTest {
@Test @Test
public void testConnectWithConfigFile() { public void testConnectWithConfigFile() {
String jdbcUrl = "jdbc:TAOS://:/test?user=root&password=taosdata"; String jdbcUrl = "jdbc:TAOS://:/log?user=root&password=taosdata";
Properties connProps = new Properties(); Properties connProps = new Properties();
connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8"); connProps.setProperty(TSDBDriver.PROPERTY_KEY_CHARSET, "UTF-8");
connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8"); connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");