@@ -82,11 +82,11 @@ public abstract class AbstractJdbcInstrumentationTest {
8282
8383 protected abstract InstrumentationExtension testing ();
8484
85- protected Connection instrumentConnection (Connection connection ) throws SQLException {
85+ protected Connection wrap (Connection connection ) throws SQLException {
8686 return connection ;
8787 }
8888
89- protected DataSource instrumentDataSource (DataSource dataSource ) {
89+ protected DataSource wrap (DataSource dataSource ) {
9090 return dataSource ;
9191 }
9292
@@ -376,7 +376,7 @@ public void testBasicStatement(
376376 String url ,
377377 String table )
378378 throws SQLException {
379- connection = instrumentConnection (connection );
379+ connection = wrap (connection );
380380 Statement statement = connection .createStatement ();
381381 cleanup .deferCleanup (statement );
382382 ResultSet resultSet = testing ().runWithSpan ("parent" , () -> statement .executeQuery (query ));
@@ -505,7 +505,7 @@ void testPreparedStatementExecute(
505505 String url ,
506506 String table )
507507 throws SQLException {
508- connection = instrumentConnection (connection );
508+ connection = wrap (connection );
509509 PreparedStatement statement = connection .prepareStatement (query );
510510 cleanup .deferCleanup (statement );
511511 ResultSet resultSet =
@@ -552,7 +552,7 @@ void testPreparedStatementQuery(
552552 String url ,
553553 String table )
554554 throws SQLException {
555- connection = instrumentConnection (connection );
555+ connection = wrap (connection );
556556 PreparedStatement statement = connection .prepareStatement (query );
557557 cleanup .deferCleanup (statement );
558558 ResultSet resultSet = testing ().runWithSpan ("parent" , () -> statement .executeQuery ());
@@ -592,7 +592,7 @@ void testPreparedCall(
592592 String url ,
593593 String table )
594594 throws SQLException {
595- connection = instrumentConnection (connection );
595+ connection = wrap (connection );
596596 CallableStatement statement = connection .prepareCall (query );
597597 cleanup .deferCleanup (statement );
598598 ResultSet resultSet = testing ().runWithSpan ("parent" , () -> statement .executeQuery ());
@@ -731,7 +731,7 @@ void testStatementUpdate(
731731 String url ,
732732 String table )
733733 throws SQLException {
734- connection = instrumentConnection (connection );
734+ connection = wrap (connection );
735735 Statement statement = connection .createStatement ();
736736 cleanup .deferCleanup (statement );
737737 String sql = connection .nativeSQL (query );
@@ -909,7 +909,7 @@ void testPreparedStatementUpdateImpl(
909909 String table ,
910910 ThrowingConsumer <PreparedStatement > action )
911911 throws SQLException {
912- connection = instrumentConnection (connection );
912+ connection = wrap (connection );
913913 String sql = connection .nativeSQL (query );
914914 PreparedStatement statement = connection .prepareStatement (sql );
915915 cleanup .deferCleanup (statement );
@@ -1083,7 +1083,7 @@ void testGetConnection(
10831083 if (init != null ) {
10841084 init .accept (datasource );
10851085 }
1086- DataSource instrumentedDatasource = instrumentDataSource (datasource );
1086+ DataSource instrumentedDatasource = wrap (datasource );
10871087 instrumentedDatasource .getConnection ().close ();
10881088 assertThat (testing ().spans ()).noneMatch (span -> span .getName ().equals ("database.connection" ));
10891089
@@ -1126,7 +1126,7 @@ void testGetConnection(
11261126 @ ValueSource (strings = "testing 123" )
11271127 void testGetClientInfoException (String query ) throws SQLException {
11281128 TestConnection rawConnection = new TestConnection ("jdbc:testdb://localhost" , false );
1129- Connection connection = instrumentConnection (rawConnection );
1129+ Connection connection = wrap (rawConnection );
11301130 cleanup .deferCleanup (connection );
11311131
11321132 Statement statement =
@@ -1214,7 +1214,7 @@ void testProduceProperSpanName(
12141214 String table )
12151215 throws SQLException {
12161216 Driver driver = new TestDriver ();
1217- Connection connection = instrumentConnection (driver .connect (url , null ));
1217+ Connection connection = wrap (driver .connect (url , null ));
12181218 cleanup .deferCleanup (connection );
12191219
12201220 Connection finalConnection = connection ;
@@ -1253,7 +1253,7 @@ void testProduceProperSpanName(
12531253 void testConnectionCached (String connectionPoolName ) throws SQLException {
12541254 String dbType = "hsqldb" ;
12551255 DataSource rawDataSource = createDs (connectionPoolName , dbType , jdbcUrls .get (dbType ));
1256- DataSource dataSource = instrumentDataSource (rawDataSource );
1256+ DataSource dataSource = wrap (rawDataSource );
12571257 DataSource finalDataSource = dataSource ;
12581258 cleanup .deferCleanup (
12591259 () -> {
@@ -1347,7 +1347,7 @@ void testHandleRecursiveStatements(
13471347 throws Exception {
13481348 DbCallingConnection rawConnection =
13491349 new DbCallingConnection (usePreparedStatementInConnection , "jdbc:testdb://localhost" );
1350- Connection connection = instrumentConnection (rawConnection );
1350+ Connection connection = wrap (rawConnection );
13511351
13521352 testing ()
13531353 .runWithSpan (
@@ -1382,7 +1382,7 @@ void testHandleRecursiveStatements(
13821382 @ Test
13831383 void testProxyStatement () throws Exception {
13841384 Connection connection =
1385- instrumentConnection (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
1385+ wrap (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
13861386 Statement statement = connection .createStatement ();
13871387 cleanup .deferCleanup (statement );
13881388 cleanup .deferCleanup (connection );
@@ -1410,7 +1410,7 @@ void testProxyStatement() throws Exception {
14101410 @ Test
14111411 void testProxyPreparedStatement () throws SQLException {
14121412 Connection connection =
1413- instrumentConnection (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
1413+ wrap (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
14141414 PreparedStatement statement = connection .prepareStatement ("SELECT 3" );
14151415 cleanup .deferCleanup (statement );
14161416 cleanup .deferCleanup (connection );
@@ -1480,7 +1480,7 @@ private void testBatchImpl(
14801480 String tableName ,
14811481 ThrowingConsumer <Statement > action )
14821482 throws SQLException {
1483- connection = instrumentConnection (connection );
1483+ connection = wrap (connection );
14841484 Statement createTable = connection .createStatement ();
14851485 createTable .execute ("CREATE TABLE " + tableName + " (id INTEGER not NULL, PRIMARY KEY ( id ))" );
14861486 cleanup .deferCleanup (createTable );
@@ -1534,7 +1534,7 @@ DB_CONNECTION_STRING, emitStableDatabaseSemconv() ? null : url),
15341534 @ MethodSource ("batchStream" )
15351535 void testMultiBatch (String system , Connection connection , String username , String url )
15361536 throws SQLException {
1537- connection = instrumentConnection (connection );
1537+ connection = wrap (connection );
15381538 String tableName1 = "multi_batch_test_1" ;
15391539 String tableName2 = "multi_batch_test_2" ;
15401540 Statement createTable1 = connection .createStatement ();
@@ -1594,7 +1594,7 @@ DB_CONNECTION_STRING, emitStableDatabaseSemconv() ? null : url),
15941594 @ MethodSource ("batchStream" )
15951595 void testSingleItemBatch (String system , Connection connection , String username , String url )
15961596 throws SQLException {
1597- connection = instrumentConnection (connection );
1597+ connection = wrap (connection );
15981598 String tableName = "single_item_batch_test" ;
15991599 Statement createTable = connection .createStatement ();
16001600 createTable .execute ("CREATE TABLE " + tableName + " (id INTEGER not NULL, PRIMARY KEY ( id ))" );
@@ -1635,7 +1635,7 @@ DB_CONNECTION_STRING, emitStableDatabaseSemconv() ? null : url),
16351635 @ MethodSource ("batchStream" )
16361636 void testPreparedBatch (String system , Connection connection , String username , String url )
16371637 throws SQLException {
1638- connection = instrumentConnection (connection );
1638+ connection = wrap (connection );
16391639 String tableName = "prepared_batch_test" ;
16401640 Statement createTable = connection .createStatement ();
16411641 createTable .execute ("CREATE TABLE " + tableName + " (id INTEGER not NULL, PRIMARY KEY ( id ))" );
@@ -1709,7 +1709,7 @@ void testSqlCommenterNotEnabled() throws SQLException {
17091709 @ MethodSource ("transactionOperationsStream" )
17101710 void testCommitTransaction (String system , Connection connection , String username , String url )
17111711 throws SQLException {
1712- Connection instrumentedConnection = instrumentConnection (connection );
1712+ Connection instrumentedConnection = wrap (connection );
17131713 Connection finalConnection = instrumentedConnection ;
17141714
17151715 String tableName = "TXN_COMMIT_TEST_" + system .toUpperCase (Locale .ROOT );
@@ -1771,7 +1771,7 @@ DB_CONNECTION_STRING, emitStableDatabaseSemconv() ? null : url),
17711771 @ MethodSource ("transactionOperationsStream" )
17721772 void testRollbackTransaction (String system , Connection connection , String username , String url )
17731773 throws SQLException {
1774- Connection instrumentedConnection = instrumentConnection (connection );
1774+ Connection instrumentedConnection = wrap (connection );
17751775 Connection finalConnection = instrumentedConnection ;
17761776
17771777 String tableName = "TXN_ROLLBACK_TEST_" + system .toUpperCase (Locale .ROOT );
@@ -1864,7 +1864,7 @@ private PreparedStatement wrapPreparedStatement(PreparedStatement statement) {
18641864 @ Test
18651865 void testPreparedStatementWrapper () throws SQLException {
18661866 Connection connection =
1867- instrumentConnection (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
1867+ wrap (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
18681868 Connection proxyConnection =
18691869 ProxyStatementFactory .proxy (
18701870 Connection .class ,
@@ -1905,7 +1905,7 @@ void testPreparedStatementWrapper() throws SQLException {
19051905 @ Test
19061906 void testStatementWrapper () throws SQLException {
19071907 Connection connection =
1908- instrumentConnection (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
1908+ wrap (new org .h2 .Driver ().connect (jdbcUrls .get ("h2" ), null ));
19091909 Statement statement = connection .createStatement ();
19101910 cleanup .deferCleanup (statement );
19111911 cleanup .deferCleanup (connection );
0 commit comments