File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
main/java/org/tarantool/jdbc
test/java/org/tarantool/jdbc Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -479,13 +479,13 @@ private void throwUnknownClientProperties(Collection<Object> properties) throws
479479 @ Override
480480 public String getClientInfo (String name ) throws SQLException {
481481 checkNotClosed ();
482- throw new SQLFeatureNotSupportedException () ;
482+ return null ;
483483 }
484484
485485 @ Override
486486 public Properties getClientInfo () throws SQLException {
487487 checkNotClosed ();
488- throw new SQLFeatureNotSupportedException ();
488+ return new Properties ();
489489 }
490490
491491 @ Override
Original file line number Diff line number Diff line change 1212import org .junit .jupiter .api .Test ;
1313import org .junit .jupiter .api .function .Executable ;
1414
15+ import java .sql .ClientInfoStatus ;
1516import java .sql .Connection ;
1617import java .sql .DatabaseMetaData ;
1718import java .sql .PreparedStatement ;
2122import java .sql .SQLFeatureNotSupportedException ;
2223import java .sql .Statement ;
2324import java .util .Collections ;
25+ import java .util .Map ;
2426import java .util .Properties ;
2527
2628public class JdbcConnectionIT extends AbstractJdbcIT {
@@ -550,5 +552,19 @@ public void testUnavailableMethodsAfterClose() throws SQLException {
550552 assertSqlExceptionHasStatus (sqlException , SQLStates .CONNECTION_DOES_NOT_EXIST );
551553 }
552554
555+ @ Test
556+ void testSetClientInfoProperties () {
557+ String targetProperty = "ApplicationName" ;
558+
559+ SQLClientInfoException exception = assertThrows (
560+ SQLClientInfoException .class ,
561+ () -> conn .setClientInfo (targetProperty , "TestApp" )
562+ );
563+
564+ Map <String , ClientInfoStatus > failedProperties = exception .getFailedProperties ();
565+ assertEquals (1 , failedProperties .size ());
566+ assertEquals (ClientInfoStatus .REASON_UNKNOWN_PROPERTY , failedProperties .get (targetProperty ));
567+ }
568+
553569}
554570
Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ public void setUp() throws SQLException {
2828 meta = conn .getMetaData ();
2929 }
3030
31+ @ Test
32+ public void testGetSupportedClientInfo () throws SQLException {
33+ ResultSet rs = meta .getClientInfoProperties ();
34+ assertNotNull (rs );
35+ assertFalse (rs .next ());
36+ rs .close ();
37+ }
38+
39+
3140 @ Test
3241 public void testGetTableTypes () throws SQLException {
3342 ResultSet rs = meta .getTableTypes ();
You can’t perform that action at this time.
0 commit comments