Skip to content

Commit 003eb10

Browse files
committed
update test case about replaceColName
1 parent 7876fd6 commit 003eb10

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/com/xxdb/data/BasicTableTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,8 +2576,13 @@ public void Test_BasicTable_replaceColName_newColName_same() throws Exception {
25762576
DBConnection conn = new DBConnection(false, false, false);
25772577
conn.connect(HOST, PORT, "admin", "123456");
25782578
BasicTable bt = (BasicTable) conn.run("t = table(1 2 3 as int1);select * from t");
2579-
bt.replaceColName("int1","int1");
2580-
assertEquals("int1",bt.getColumnName(0));
2579+
String re = null;
2580+
try{
2581+
bt.replaceColName("int1","int1");
2582+
}catch(Exception e){
2583+
re = e.getMessage();
2584+
}
2585+
assertEquals("The newColName 'int1' already exists in table. Column names cannot be duplicated.",re);
25812586
}
25822587
@Test
25832588
public void Test_BasicTable_replaceColName_newColName_exist() throws Exception {

0 commit comments

Comments
 (0)