Skip to content

Commit ff743bf

Browse files
committed
AJ-697,AJ-852: add test case about run exception
1 parent 5466f49 commit ff743bf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/com/xxdb/DBConnectionTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5912,4 +5912,28 @@ public void Test_DBConnection_ConnectConfig_tryReconnectNums() throws Exception
59125912
assertEquals("2", re.getString());
59135913
}
59145914

5915+
@Test
5916+
public void Test_DBConnection_run_script_exception() throws Exception {
5917+
DBConnection conn = new DBConnection();
5918+
conn.connect(HOST, PORT, "admin", "123456");
5919+
String re = null;
5920+
try{
5921+
conn.run("\"aa\"+[1]");
5922+
}catch(Exception e){
5923+
re = e.getMessage();
5924+
}
5925+
assertEquals(true, re.contains("String cannot be added to a vector that is not of string type. script: \"aa\"+[1]"));
5926+
}
5927+
@Test
5928+
public void Test_DBConnection_run_function_exception() throws IOException, InterruptedException {
5929+
DBConnection conn = new DBConnection();
5930+
String re = null;
5931+
try{
5932+
conn.connect(HOST,PORT,"admin","123456qq", null, true, null);
5933+
}catch(Exception e){
5934+
re = e.getMessage();
5935+
}
5936+
assertEquals(true, re.contains("The user name or password is incorrect. function: login"));
5937+
}
5938+
59155939
}

0 commit comments

Comments
 (0)