Skip to content

Commit cb5a692

Browse files
committed
AJ-456,AJ-448:update test case about addColumn
1 parent d1191ee commit cb5a692

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

test/com/xxdb/data/BasicTableTest.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -633,18 +633,15 @@ public void Test_BasicTable_addColumn_col_null() throws Exception {
633633
}
634634
@Test
635635
public void Test_BasicTable_addColumn_dataLength_not_match() throws Exception {
636-
DBConnection conn = new DBConnection(false, false, false);
637-
conn.connect(HOST, PORT, "admin", "123456");
638-
BasicTable bt = (BasicTable) conn.run("t = table(1 2 3 as int1);select * from t");
639-
System.out.println(bt.getString());
636+
BasicTable bt = createBasicTable();
640637
BasicBooleanVector bbv = new BasicBooleanVector(1);
641-
bbv.setNull(0);
642-
bbv.add((byte) 1);
643-
// bbv.add((byte) 0);
644-
System.out.println(bbv.getString());
645-
bt.addColumn("col1", bbv);
646-
System.out.println(bt.getString());
647-
assertEquals("[,true,]",bt.getColumn(1).getString());
638+
String re = null;
639+
try{
640+
bt.addColumn("col1", bbv);
641+
}catch(Exception e){
642+
re = e.getMessage();
643+
}
644+
assertEquals("The length of column col1 must be the same as the first column length: 2.",re);
648645
}
649646
@Test
650647
public void Test_BasicTable_addColumn_BOOL() throws Exception {

0 commit comments

Comments
 (0)