Skip to content

Commit c29837f

Browse files
author
chengyitian
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 7a46231 + d3db3f2 commit c29837f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

test/com/xxdb/DBConnectionTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4875,4 +4875,31 @@ public void test_parseException() throws IOException {
48754875
}
48764876
assertEquals(true, re.contains("fetchSize must be greater than 8192"));
48774877
}
4878+
@Test
4879+
public void test_exception_script() throws IOException {
4880+
DBConnection connection = new DBConnection(false, false, false);
4881+
connection.connect(HOST, PORT, "admin", "123456","", true, ipports);
4882+
String re = null;
4883+
try{
4884+
connection.run("share table(1..100 as name,take(`aaa,100) as name) as table_upload_tb3;\n ;");
4885+
}catch(Exception e){
4886+
re = e.getMessage();
4887+
}
4888+
assertEquals(true, re.contains("Duplicated column name name. "));
4889+
}
4890+
4891+
@Test
4892+
public void test_exception_Function() throws IOException {
4893+
List<Entity> args = new ArrayList<Entity>(1);
4894+
String[] array = {"1.5", "2.5", "A"};
4895+
BasicStringVector vec = new BasicStringVector(array);
4896+
args.add(vec);
4897+
String re = null;
4898+
try{
4899+
Scalar result = (Scalar) conn.run("C", args);
4900+
}catch(Exception e){
4901+
re = e.getMessage();
4902+
}
4903+
assertEquals(true, re.contains("Can't recognize function name C. function: C"));
4904+
}
48784905
}

test/com/xxdb/streaming/client/BasicMessageTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public void test_BasicMessage() throws Exception {
2424
BasicMessage bm = new BasicMessage(0L,"first",bav,map);
2525
assertEquals("(6.4, 9.2)",bm.getValue(1).toString());
2626
assertEquals("China",bm.getValue("mongoDB").toString());
27+
assertEquals("(5,(6.4, 9.2),China,15.48)",bm.getMsg().getString());
2728
}
2829

2930
}

0 commit comments

Comments
 (0)