Skip to content

Commit 2290883

Browse files
committed
update test case about replaceColName
1 parent e4bf9c3 commit 2290883

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/com/xxdb/data/BasicTableTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public void test_BasicTable_getRowJson()throws Exception{
542542
System.out.println(bTable.getRowJson(0));
543543
assertEquals("{\"sym\":\"s1\",\"d1\":1000000000.02}",bTable.getRowJson(0));
544544
}
545-
@Test
545+
//@Test
546546
public void test_BasicTable_symbol_big_data()throws Exception{
547547
DBConnection conn = new DBConnection(false, false, false);
548548
conn.connect(HOST, PORT, "admin", "123456");
@@ -2517,7 +2517,7 @@ public void Test_BasicTable_replaceColName_originalName_null() throws Exception
25172517
}catch(Exception e){
25182518
re = e.getMessage();
25192519
}
2520-
assertEquals("The param originalColName 'null' does not exist in table.",re);
2520+
assertEquals("The param 'originalColName' or 'newColName' cannot be null or empty.",re);
25212521
}
25222522
@Test
25232523
public void Test_BasicTable_replaceColName_originalName_null_1() throws Exception {
@@ -2584,10 +2584,13 @@ public void Test_BasicTable_replaceColName_newColName_exist() throws Exception {
25842584
DBConnection conn = new DBConnection(false, false, false);
25852585
conn.connect(HOST, PORT, "admin", "123456");
25862586
BasicTable bt = (BasicTable) conn.run("t = table(1 2 3 as int1,`aa`dd`ff as string1);select * from t");
2587-
bt.replaceColName("int1","string1");
2588-
System.out.println(bt.getString());
2589-
assertEquals("int1",bt.getColumnName(0));
2590-
assertEquals("string1",bt.getColumnName(1));
2587+
String re = null;
2588+
try{
2589+
bt.replaceColName("int1","string1");
2590+
}catch(Exception e){
2591+
re = e.getMessage();
2592+
}
2593+
assertEquals("The newColName 'string1' already exists in table. Column names cannot be duplicated.",re);
25912594
}
25922595
@Test
25932596
public void Test_BasicTable_replaceColName_newColName() throws Exception {

0 commit comments

Comments
 (0)