File tree 3 files changed +27
-2
lines changed
main/java/org/tarantool/jdbc
test/java/org/tarantool/jdbc
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
479
479
@ Override
480
480
public String getClientInfo (String name ) throws SQLException {
481
481
checkNotClosed ();
482
- throw new SQLFeatureNotSupportedException () ;
482
+ return null ;
483
483
}
484
484
485
485
@ Override
486
486
public Properties getClientInfo () throws SQLException {
487
487
checkNotClosed ();
488
- throw new SQLFeatureNotSupportedException ();
488
+ return new Properties ();
489
489
}
490
490
491
491
@ Override
Original file line number Diff line number Diff line change 12
12
import org .junit .jupiter .api .Test ;
13
13
import org .junit .jupiter .api .function .Executable ;
14
14
15
+ import java .sql .ClientInfoStatus ;
15
16
import java .sql .Connection ;
16
17
import java .sql .DatabaseMetaData ;
17
18
import java .sql .PreparedStatement ;
21
22
import java .sql .SQLFeatureNotSupportedException ;
22
23
import java .sql .Statement ;
23
24
import java .util .Collections ;
25
+ import java .util .Map ;
24
26
import java .util .Properties ;
25
27
26
28
public class JdbcConnectionIT extends AbstractJdbcIT {
@@ -550,5 +552,19 @@ public void testUnavailableMethodsAfterClose() throws SQLException {
550
552
assertSqlExceptionHasStatus (sqlException , SQLStates .CONNECTION_DOES_NOT_EXIST );
551
553
}
552
554
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
+
553
569
}
554
570
Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ public void setUp() throws SQLException {
28
28
meta = conn .getMetaData ();
29
29
}
30
30
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
+
31
40
@ Test
32
41
public void testGetTableTypes () throws SQLException {
33
42
ResultSet rs = meta .getTableTypes ();
You can’t perform that action at this time.
0 commit comments