File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
jdbc/src/test/java/tech/ydb/jdbc Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,23 @@ public void connectOK() throws SQLException {
9393 @ Test
9494 public void connectWrong () throws SQLException {
9595 wrongConnection (connectByProperties ("user1" , "a" ));
96+ wrongConnection (connectByAuthority ("user1" , "a" ));
9697
9798 wrongConnection (connectByProperties ("user2" , "" ));
9899 wrongConnection (connectByProperties ("user2" , null ));
99100 wrongConnection (connectByProperties ("user2" , "pass" ));
100101
102+ wrongConnection (connectByAuthority ("user2" , "" ));
103+ wrongConnection (connectByAuthority ("user2" , null ));
104+ wrongConnection (connectByAuthority ("user2" , "pass" ));
105+
101106 wrongConnection (connectByProperties ("user3" , "" ));
102107 wrongConnection (connectByProperties ("user3" , null ));
103108 wrongConnection (connectByProperties ("user3" , "pw:ss;" ));
109+
110+ wrongConnection (connectByAuthority ("user3" , "" ));
111+ wrongConnection (connectByAuthority ("user3" , null ));
112+ wrongConnection (connectByAuthority ("user3" , "pw:ss;" ));
104113 }
105114
106115 interface ConnectionSupplier {
Original file line number Diff line number Diff line change 2121import java .time .LocalDate ;
2222import java .time .LocalDateTime ;
2323import java .util .Collections ;
24+ import java .util .Iterator ;
2425import java .util .Locale ;
2526
2627import javax .sql .rowset .serial .SerialBlob ;
@@ -180,13 +181,17 @@ public void getMetaData() throws SQLException {
180181
181182 Assertions .assertEquals (22 , metadata .getColumnCount ());
182183
184+ Iterator <String > names = metadata .unwrap (YdbResultSetMetaData .class ).getColumnNames ().iterator ();
183185 for (int index = 0 ; index < metadata .getColumnCount (); index ++) {
184186 int column = index + 1 ;
185187 String name = metadata .getColumnName (column );
186188 Assertions .assertNotNull (name );
187189 Assertions .assertEquals (name , metadata .getColumnLabel (column ));
188190 Assertions .assertEquals (column , ydbMetadata .getColumnIndex (name ));
189191
192+ Assertions .assertTrue (names .hasNext ());
193+ Assertions .assertEquals (name , names .next ());
194+
190195 Assertions .assertFalse (metadata .isAutoIncrement (column ), "All columns are not isAutoIncrement" );
191196 Assertions .assertTrue (metadata .isCaseSensitive (column ), "All columns are isCaseSensitive" );
192197 Assertions .assertFalse (metadata .isSearchable (column ), "All columns are not isSearchable" );
You can’t perform that action at this time.
0 commit comments