View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.dbcp2;
19  
20  import static org.junit.jupiter.api.Assertions.assertEquals;
21  import static org.junit.jupiter.api.Assertions.assertFalse;
22  import static org.junit.jupiter.api.Assertions.assertNotNull;
23  import static org.junit.jupiter.api.Assertions.assertNull;
24  import static org.junit.jupiter.api.Assertions.assertThrows;
25  import static org.junit.jupiter.api.Assertions.assertTrue;
26  import static org.mockito.Mockito.mock;
27  import static org.mockito.Mockito.times;
28  import static org.mockito.Mockito.verify;
29  
30  import java.sql.DatabaseMetaData;
31  import java.sql.ResultSet;
32  import java.sql.SQLException;
33  
34  import org.junit.jupiter.api.BeforeEach;
35  import org.junit.jupiter.api.Test;
36  import org.mockito.Mockito;
37  
38  /**
39   * Test suite for {@link DelegatingDatabaseMetaData}.
40   */
41  public class TestDelegatingDatabaseMetaData {
42  
43      private TesterConnection testConn;
44      private DelegatingConnection<?> conn;
45      private DelegatingDatabaseMetaData delegate;
46      private DelegatingDatabaseMetaData delegateSpy;
47      private DatabaseMetaData obj;
48  
49      @BeforeEach
50      public void setUp() throws Exception {
51          obj = mock(DatabaseMetaData.class);
52          testConn = new TesterConnection("test", "test");
53          conn = new DelegatingConnection<>(testConn);
54          delegate = new DelegatingDatabaseMetaData(conn, obj);
55          delegateSpy = Mockito.spy(delegate);
56      }
57  
58      @Test
59      void testAllProceduresAreCallable() throws Exception {
60          try {
61              delegate.allProceduresAreCallable();
62          } catch (final SQLException e) {
63              // ignore
64          }
65          verify(obj, times(1)).allProceduresAreCallable();
66          // SQLException
67          Mockito.when(obj.allProceduresAreCallable()).thenThrow(SQLException.class);
68          // The default handler rethrows
69          assertThrows(SQLException.class, delegate::allProceduresAreCallable);
70      }
71  
72      @Test
73      void testAllTablesAreSelectable() throws Exception {
74          try {
75              delegate.allTablesAreSelectable();
76          } catch (final SQLException e) {
77              // ignore
78          }
79          verify(obj, times(1)).allTablesAreSelectable();
80          // SQLException
81          Mockito.when(obj.allTablesAreSelectable()).thenThrow(SQLException.class);
82          // The default handler rethrows
83          assertThrows(SQLException.class, delegate::allTablesAreSelectable);
84      }
85  
86      @Test
87      void testAutoCommitFailureClosesAllResultSets() throws Exception {
88          try {
89              delegate.autoCommitFailureClosesAllResultSets();
90          } catch (final SQLException e) {
91              // ignore
92          }
93          verify(obj, times(1)).autoCommitFailureClosesAllResultSets();
94          // SQLException
95          Mockito.when(obj.autoCommitFailureClosesAllResultSets()).thenThrow(SQLException.class);
96          // The default handler rethrows
97          assertThrows(SQLException.class, delegate::autoCommitFailureClosesAllResultSets);
98      }
99  
100     @Test
101     void testCheckOpen() throws Exception {
102         delegate = new DelegatingDatabaseMetaData(conn, conn.getMetaData());
103         final ResultSet rst = delegate.getSchemas();
104         assertFalse(rst.isClosed());
105         conn.close();
106         assertTrue(rst.isClosed());
107     }
108 
109     @Test
110     void testDataDefinitionCausesTransactionCommit() throws Exception {
111         try {
112             delegate.dataDefinitionCausesTransactionCommit();
113         } catch (final SQLException e) {
114             // ignore
115         }
116         verify(obj, times(1)).dataDefinitionCausesTransactionCommit();
117         // SQLException
118         Mockito.when(obj.dataDefinitionCausesTransactionCommit()).thenThrow(SQLException.class);
119         // The default handler rethrows
120         assertThrows(SQLException.class, delegate::dataDefinitionCausesTransactionCommit);
121     }
122 
123     @Test
124     void testDataDefinitionIgnoredInTransactions() throws Exception {
125         try {
126             delegate.dataDefinitionIgnoredInTransactions();
127         } catch (final SQLException e) {
128             // ignore
129         }
130         verify(obj, times(1)).dataDefinitionIgnoredInTransactions();
131         // SQLException
132         Mockito.when(obj.dataDefinitionIgnoredInTransactions()).thenThrow(SQLException.class);
133         // The default handler rethrows
134         assertThrows(SQLException.class, delegate::dataDefinitionIgnoredInTransactions);
135     }
136 
137     @Test
138     void testDeletesAreDetectedInteger() throws Exception {
139         try {
140             delegate.deletesAreDetected(1);
141         } catch (final SQLException e) {
142             // ignore
143         }
144         verify(obj, times(1)).deletesAreDetected(1);
145         // SQLException
146         Mockito.when(obj.deletesAreDetected(1)).thenThrow(SQLException.class);
147         // The default handler rethrows
148         assertThrows(SQLException.class, () -> delegate.deletesAreDetected(1));
149     }
150 
151     @Test
152     void testDoesMaxRowSizeIncludeBlobs() throws Exception {
153         try {
154             delegate.doesMaxRowSizeIncludeBlobs();
155         } catch (final SQLException e) {
156             // ignore
157         }
158         verify(obj, times(1)).doesMaxRowSizeIncludeBlobs();
159         // SQLException
160         Mockito.when(obj.doesMaxRowSizeIncludeBlobs()).thenThrow(SQLException.class);
161         // The default handler rethrows
162         assertThrows(SQLException.class, delegate::doesMaxRowSizeIncludeBlobs);
163     }
164 
165     @Test
166     void testGeneratedKeyAlwaysReturned() throws Exception {
167         try {
168             delegate.generatedKeyAlwaysReturned();
169         } catch (final SQLException e) {
170             // ignore
171         }
172         verify(obj, times(1)).generatedKeyAlwaysReturned();
173         // SQLException
174         Mockito.when(obj.generatedKeyAlwaysReturned()).thenThrow(SQLException.class);
175         // The default handler rethrows
176         assertThrows(SQLException.class, delegate::generatedKeyAlwaysReturned);
177     }
178 
179     @Test
180     void testGetAttributesStringStringStringString() throws Exception {
181         try {
182             delegate.getAttributes("foo", "foo", "foo", "foo");
183         } catch (final SQLException e) {
184             // ignore
185         }
186         verify(obj, times(1)).getAttributes("foo", "foo", "foo", "foo");
187     }
188 
189     @Test
190     void testGetBestRowIdentifierStringStringStringIntegerBoolean() throws Exception {
191         try {
192             delegate.getBestRowIdentifier("foo", "foo", "foo", 1, Boolean.TRUE);
193         } catch (final SQLException e) {
194             // ignore
195         }
196         verify(obj, times(1)).getBestRowIdentifier("foo", "foo", "foo", 1, Boolean.TRUE);
197     }
198 
199     @Test
200     void testGetCatalogs() throws Exception {
201         try {
202             delegate.getCatalogs();
203         } catch (final SQLException e) {
204             // ignore
205         }
206         verify(obj, times(1)).getCatalogs();
207         // SQLException
208         Mockito.when(obj.getCatalogs()).thenThrow(SQLException.class);
209         // The default handler rethrows
210         assertThrows(SQLException.class, delegate::getCatalogs);
211     }
212 
213     @Test
214     void testGetCatalogSeparator() throws Exception {
215         try {
216             delegate.getCatalogSeparator();
217         } catch (final SQLException e) {
218             // ignore
219         }
220         verify(obj, times(1)).getCatalogSeparator();
221         // SQLException
222         Mockito.when(obj.getCatalogSeparator()).thenThrow(SQLException.class);
223         // The default handler rethrows
224         assertThrows(SQLException.class, delegate::getCatalogSeparator);
225     }
226 
227     @Test
228     void testGetCatalogTerm() throws Exception {
229         try {
230             delegate.getCatalogTerm();
231         } catch (final SQLException e) {
232             // ignore
233         }
234         verify(obj, times(1)).getCatalogTerm();
235         // SQLException
236         Mockito.when(obj.getCatalogTerm()).thenThrow(SQLException.class);
237         // The default handler rethrows
238         assertThrows(SQLException.class, delegate::getCatalogTerm);
239     }
240 
241     @Test
242     void testGetClientInfoProperties() throws Exception {
243         try {
244             delegate.getClientInfoProperties();
245         } catch (final SQLException e) {
246             // ignore
247         }
248         verify(obj, times(1)).getClientInfoProperties();
249         // SQLException
250         Mockito.when(obj.getClientInfoProperties()).thenThrow(SQLException.class);
251         // The default handler rethrows
252         assertThrows(SQLException.class, delegate::getClientInfoProperties);
253     }
254 
255     @Test
256     void testGetColumnPrivilegesStringStringStringString() throws Exception {
257         try {
258             delegate.getColumnPrivileges("foo", "foo", "foo", "foo");
259         } catch (final SQLException e) {
260             // ignore
261         }
262         verify(obj, times(1)).getColumnPrivileges("foo", "foo", "foo", "foo");
263     }
264 
265     @Test
266     void testGetColumnsStringStringStringString() throws Exception {
267         try {
268             delegate.getColumns("foo", "foo", "foo", "foo");
269         } catch (final SQLException e) {
270             // ignore
271         }
272         verify(obj, times(1)).getColumns("foo", "foo", "foo", "foo");
273     }
274 
275     /**
276      * This method is a bit special, and doesn't call the method on the wrapped object, instead returning the connection from the delegate object itself.
277      *
278      * @throws Exception
279      */
280     @Test
281     void testGetConnection() throws Exception {
282         try {
283             delegate.getConnection();
284         } catch (final SQLException e) {
285             // ignore
286         }
287         verify(obj, times(0)).getConnection();
288     }
289 
290     @Test
291     void testGetCrossReferenceStringStringStringStringStringString() throws Exception {
292         try {
293             delegate.getCrossReference("foo", "foo", "foo", "foo", "foo", "foo");
294         } catch (final SQLException e) {
295             // ignore
296         }
297         verify(obj, times(1)).getCrossReference("foo", "foo", "foo", "foo", "foo", "foo");
298     }
299 
300     @Test
301     void testGetDatabaseMajorVersion() throws Exception {
302         try {
303             delegate.getDatabaseMajorVersion();
304         } catch (final SQLException e) {
305             // ignore
306         }
307         verify(obj, times(1)).getDatabaseMajorVersion();
308         // SQLException
309         Mockito.when(obj.getDatabaseMajorVersion()).thenThrow(SQLException.class);
310         // The default handler rethrows
311         assertThrows(SQLException.class, delegate::getDatabaseMajorVersion);
312     }
313 
314     @Test
315     void testGetDatabaseMinorVersion() throws Exception {
316         try {
317             delegate.getDatabaseMinorVersion();
318         } catch (final SQLException e) {
319             // ignore
320         }
321         verify(obj, times(1)).getDatabaseMinorVersion();
322         // SQLException
323         Mockito.when(obj.getDatabaseMinorVersion()).thenThrow(SQLException.class);
324         // The default handler rethrows
325         assertThrows(SQLException.class, delegate::getDatabaseMinorVersion);
326     }
327 
328     @Test
329     void testGetDatabaseProductName() throws Exception {
330         try {
331             delegate.getDatabaseProductName();
332         } catch (final SQLException e) {
333             // ignore
334         }
335         verify(obj, times(1)).getDatabaseProductName();
336         // SQLException
337         Mockito.when(obj.getDatabaseProductName()).thenThrow(SQLException.class);
338         // The default handler rethrows
339         assertThrows(SQLException.class, delegate::getDatabaseProductName);
340     }
341 
342     @Test
343     void testGetDatabaseProductVersion() throws Exception {
344         try {
345             delegate.getDatabaseProductVersion();
346         } catch (final SQLException e) {
347             // ignore
348         }
349         verify(obj, times(1)).getDatabaseProductVersion();
350     }
351 
352     @Test
353     void testGetDefaultTransactionIsolation() throws Exception {
354         try {
355             delegate.getDefaultTransactionIsolation();
356         } catch (final SQLException e) {
357             // ignore
358         }
359         verify(obj, times(1)).getDefaultTransactionIsolation();
360     }
361 
362     @Test
363     void testGetDelegate() throws Exception {
364         assertEquals(obj, delegate.getDelegate());
365     }
366 
367     @Test
368     void testGetDriverMajorVersion() throws Exception {
369         delegate.getDriverMajorVersion();
370         verify(obj, times(1)).getDriverMajorVersion();
371     }
372 
373     @Test
374     void testGetDriverMinorVersion() throws Exception {
375         delegate.getDriverMinorVersion();
376         verify(obj, times(1)).getDriverMinorVersion();
377     }
378 
379     @Test
380     void testGetDriverName() throws Exception {
381         try {
382             delegate.getDriverName();
383         } catch (final SQLException e) {
384             // ignore
385         }
386         verify(obj, times(1)).getDriverName();
387     }
388 
389     @Test
390     void testGetDriverVersion() throws Exception {
391         try {
392             delegate.getDriverVersion();
393         } catch (final SQLException e) {
394             // ignore
395         }
396         verify(obj, times(1)).getDriverVersion();
397     }
398 
399     @Test
400     void testGetExportedKeysStringStringString() throws Exception {
401         try {
402             delegate.getExportedKeys("foo", "foo", "foo");
403         } catch (final SQLException e) {
404             // ignore
405         }
406         verify(obj, times(1)).getExportedKeys("foo", "foo", "foo");
407     }
408 
409     @Test
410     void testGetExtraNameCharacters() throws Exception {
411         try {
412             delegate.getExtraNameCharacters();
413         } catch (final SQLException e) {
414             // ignore
415         }
416         verify(obj, times(1)).getExtraNameCharacters();
417     }
418 
419     @Test
420     void testGetFunctionColumnsStringStringStringString() throws Exception {
421         try {
422             delegate.getFunctionColumns("foo", "foo", "foo", "foo");
423         } catch (final SQLException e) {
424             // ignore
425         }
426         verify(obj, times(1)).getFunctionColumns("foo", "foo", "foo", "foo");
427     }
428 
429     @Test
430     void testGetFunctionsStringStringString() throws Exception {
431         try {
432             delegate.getFunctions("foo", "foo", "foo");
433         } catch (final SQLException e) {
434             // ignore
435         }
436         verify(obj, times(1)).getFunctions("foo", "foo", "foo");
437     }
438 
439     @Test
440     void testGetIdentifierQuoteString() throws Exception {
441         try {
442             delegate.getIdentifierQuoteString();
443         } catch (final SQLException e) {
444             // ignore
445         }
446         verify(obj, times(1)).getIdentifierQuoteString();
447     }
448 
449     @Test
450     void testGetImportedKeysStringStringString() throws Exception {
451         try {
452             delegate.getImportedKeys("foo", "foo", "foo");
453         } catch (final SQLException e) {
454             // ignore
455         }
456         verify(obj, times(1)).getImportedKeys("foo", "foo", "foo");
457     }
458 
459     @Test
460     void testGetIndexInfoStringStringStringBooleanBoolean() throws Exception {
461         try {
462             delegate.getIndexInfo("foo", "foo", "foo", Boolean.TRUE, Boolean.TRUE);
463         } catch (final SQLException e) {
464             // ignore
465         }
466         verify(obj, times(1)).getIndexInfo("foo", "foo", "foo", Boolean.TRUE, Boolean.TRUE);
467     }
468 
469     @Test
470     void testGetInnermostDelegate() {
471         assertNotNull(delegate.getInnermostDelegate());
472     }
473 
474     @Test
475     void testGetJDBCMajorVersion() throws Exception {
476         try {
477             delegate.getJDBCMajorVersion();
478         } catch (final SQLException e) {
479             // ignore
480         }
481         verify(obj, times(1)).getJDBCMajorVersion();
482     }
483 
484     @Test
485     void testGetJDBCMinorVersion() throws Exception {
486         try {
487             delegate.getJDBCMinorVersion();
488         } catch (final SQLException e) {
489             // ignore
490         }
491         verify(obj, times(1)).getJDBCMinorVersion();
492     }
493 
494     @Test
495     void testGetMaxBinaryLiteralLength() throws Exception {
496         try {
497             delegate.getMaxBinaryLiteralLength();
498         } catch (final SQLException e) {
499             // ignore
500         }
501         verify(obj, times(1)).getMaxBinaryLiteralLength();
502     }
503 
504     @Test
505     void testGetMaxCatalogNameLength() throws Exception {
506         try {
507             delegate.getMaxCatalogNameLength();
508         } catch (final SQLException e) {
509             // ignore
510         }
511         verify(obj, times(1)).getMaxCatalogNameLength();
512     }
513 
514     @Test
515     void testGetMaxCharLiteralLength() throws Exception {
516         try {
517             delegate.getMaxCharLiteralLength();
518         } catch (final SQLException e) {
519             // ignore
520         }
521         verify(obj, times(1)).getMaxCharLiteralLength();
522     }
523 
524     @Test
525     void testGetMaxColumnNameLength() throws Exception {
526         try {
527             delegate.getMaxColumnNameLength();
528         } catch (final SQLException e) {
529             // ignore
530         }
531         verify(obj, times(1)).getMaxColumnNameLength();
532     }
533 
534     @Test
535     void testGetMaxColumnsInGroupBy() throws Exception {
536         try {
537             delegate.getMaxColumnsInGroupBy();
538         } catch (final SQLException e) {
539             // ignore
540         }
541         verify(obj, times(1)).getMaxColumnsInGroupBy();
542     }
543 
544     @Test
545     void testGetMaxColumnsInIndex() throws Exception {
546         try {
547             delegate.getMaxColumnsInIndex();
548         } catch (final SQLException e) {
549             // ignore
550         }
551         verify(obj, times(1)).getMaxColumnsInIndex();
552     }
553 
554     @Test
555     void testGetMaxColumnsInOrderBy() throws Exception {
556         try {
557             delegate.getMaxColumnsInOrderBy();
558         } catch (final SQLException e) {
559             // ignore
560         }
561         verify(obj, times(1)).getMaxColumnsInOrderBy();
562     }
563 
564     @Test
565     void testGetMaxColumnsInSelect() throws Exception {
566         try {
567             delegate.getMaxColumnsInSelect();
568         } catch (final SQLException e) {
569             // ignore
570         }
571         verify(obj, times(1)).getMaxColumnsInSelect();
572     }
573 
574     @Test
575     void testGetMaxColumnsInTable() throws Exception {
576         try {
577             delegate.getMaxColumnsInTable();
578         } catch (final SQLException e) {
579             // ignore
580         }
581         verify(obj, times(1)).getMaxColumnsInTable();
582     }
583 
584     @Test
585     void testGetMaxConnections() throws Exception {
586         try {
587             delegate.getMaxConnections();
588         } catch (final SQLException e) {
589             // ignore
590         }
591         verify(obj, times(1)).getMaxConnections();
592     }
593 
594     @Test
595     void testGetMaxCursorNameLength() throws Exception {
596         try {
597             delegate.getMaxCursorNameLength();
598         } catch (final SQLException e) {
599             // ignore
600         }
601         verify(obj, times(1)).getMaxCursorNameLength();
602     }
603 
604     @Test
605     void testGetMaxIndexLength() throws Exception {
606         try {
607             delegate.getMaxIndexLength();
608         } catch (final SQLException e) {
609             // ignore
610         }
611         verify(obj, times(1)).getMaxIndexLength();
612     }
613 
614     @Test
615     void testGetMaxLogicalLobSize() throws Exception {
616         try {
617             delegate.getMaxLogicalLobSize();
618         } catch (final SQLException e) {
619             // ignore
620         }
621         verify(obj, times(1)).getMaxLogicalLobSize();
622     }
623 
624     @Test
625     void testGetMaxProcedureNameLength() throws Exception {
626         try {
627             delegate.getMaxProcedureNameLength();
628         } catch (final SQLException e) {
629             // ignore
630         }
631         verify(obj, times(1)).getMaxProcedureNameLength();
632     }
633 
634     @Test
635     void testGetMaxRowSize() throws Exception {
636         try {
637             delegate.getMaxRowSize();
638         } catch (final SQLException e) {
639             // ignore
640         }
641         verify(obj, times(1)).getMaxRowSize();
642     }
643 
644     @Test
645     void testGetMaxSchemaNameLength() throws Exception {
646         try {
647             delegate.getMaxSchemaNameLength();
648         } catch (final SQLException e) {
649             // ignore
650         }
651         verify(obj, times(1)).getMaxSchemaNameLength();
652     }
653 
654     @Test
655     void testGetMaxStatementLength() throws Exception {
656         try {
657             delegate.getMaxStatementLength();
658         } catch (final SQLException e) {
659             // ignore
660         }
661         verify(obj, times(1)).getMaxStatementLength();
662     }
663 
664     @Test
665     void testGetMaxStatements() throws Exception {
666         try {
667             delegate.getMaxStatements();
668         } catch (final SQLException e) {
669             // ignore
670         }
671         verify(obj, times(1)).getMaxStatements();
672     }
673 
674     @Test
675     void testGetMaxTableNameLength() throws Exception {
676         try {
677             delegate.getMaxTableNameLength();
678         } catch (final SQLException e) {
679             // ignore
680         }
681         verify(obj, times(1)).getMaxTableNameLength();
682     }
683 
684     @Test
685     void testGetMaxTablesInSelect() throws Exception {
686         try {
687             delegate.getMaxTablesInSelect();
688         } catch (final SQLException e) {
689             // ignore
690         }
691         verify(obj, times(1)).getMaxTablesInSelect();
692     }
693 
694     @Test
695     void testGetMaxUserNameLength() throws Exception {
696         try {
697             delegate.getMaxUserNameLength();
698         } catch (final SQLException e) {
699             // ignore
700         }
701         verify(obj, times(1)).getMaxUserNameLength();
702     }
703 
704     @Test
705     void testGetNumericFunctions() throws Exception {
706         try {
707             delegate.getNumericFunctions();
708         } catch (final SQLException e) {
709             // ignore
710         }
711         verify(obj, times(1)).getNumericFunctions();
712     }
713 
714     @Test
715     void testGetPrimaryKeysStringStringString() throws Exception {
716         try {
717             delegate.getPrimaryKeys("foo", "foo", "foo");
718         } catch (final SQLException e) {
719             // ignore
720         }
721         verify(obj, times(1)).getPrimaryKeys("foo", "foo", "foo");
722     }
723 
724     @Test
725     void testGetProcedureColumnsStringStringStringString() throws Exception {
726         try {
727             delegate.getProcedureColumns("foo", "foo", "foo", "foo");
728         } catch (final SQLException e) {
729             // ignore
730         }
731         verify(obj, times(1)).getProcedureColumns("foo", "foo", "foo", "foo");
732     }
733 
734     @Test
735     void testGetProceduresStringStringString() throws Exception {
736         try {
737             delegate.getProcedures("foo", "foo", "foo");
738         } catch (final SQLException e) {
739             // ignore
740         }
741         verify(obj, times(1)).getProcedures("foo", "foo", "foo");
742     }
743 
744     @Test
745     void testGetProcedureTerm() throws Exception {
746         try {
747             delegate.getProcedureTerm();
748         } catch (final SQLException e) {
749             // ignore
750         }
751         verify(obj, times(1)).getProcedureTerm();
752     }
753 
754     @Test
755     void testGetPseudoColumnsStringStringStringString() throws Exception {
756         try {
757             delegate.getPseudoColumns("foo", "foo", "foo", "foo");
758         } catch (final SQLException e) {
759             // ignore
760         }
761         verify(obj, times(1)).getPseudoColumns("foo", "foo", "foo", "foo");
762     }
763 
764     @Test
765     void testGetResultSetHoldability() throws Exception {
766         try {
767             delegate.getResultSetHoldability();
768         } catch (final SQLException e) {
769             // ignore
770         }
771         verify(obj, times(1)).getResultSetHoldability();
772     }
773 
774     @Test
775     void testGetRowIdLifetime() throws Exception {
776         try {
777             delegate.getRowIdLifetime();
778         } catch (final SQLException e) {
779             // ignore
780         }
781         verify(obj, times(1)).getRowIdLifetime();
782     }
783 
784     @Test
785     void testGetSchemas() throws Exception {
786         try {
787             delegate.getSchemas();
788         } catch (final SQLException e) {
789             // ignore
790         }
791         verify(obj, times(1)).getSchemas();
792     }
793 
794     @Test
795     void testGetSchemasStringString() throws Exception {
796         try {
797             delegate.getSchemas("foo", "foo");
798         } catch (final SQLException e) {
799             // ignore
800         }
801         verify(obj, times(1)).getSchemas("foo", "foo");
802     }
803 
804     @Test
805     void testGetSchemaTerm() throws Exception {
806         try {
807             delegate.getSchemaTerm();
808         } catch (final SQLException e) {
809             // ignore
810         }
811         verify(obj, times(1)).getSchemaTerm();
812     }
813 
814     @Test
815     void testGetSearchStringEscape() throws Exception {
816         try {
817             delegate.getSearchStringEscape();
818         } catch (final SQLException e) {
819             // ignore
820         }
821         verify(obj, times(1)).getSearchStringEscape();
822     }
823 
824     @Test
825     void testGetSQLKeywords() throws Exception {
826         try {
827             delegate.getSQLKeywords();
828         } catch (final SQLException e) {
829             // ignore
830         }
831         verify(obj, times(1)).getSQLKeywords();
832     }
833 
834     @Test
835     void testGetSQLStateType() throws Exception {
836         try {
837             delegate.getSQLStateType();
838         } catch (final SQLException e) {
839             // ignore
840         }
841         verify(obj, times(1)).getSQLStateType();
842     }
843 
844     @Test
845     void testGetStringFunctions() throws Exception {
846         try {
847             delegate.getStringFunctions();
848         } catch (final SQLException e) {
849             // ignore
850         }
851         verify(obj, times(1)).getStringFunctions();
852     }
853 
854     @Test
855     void testGetSuperTablesStringStringString() throws Exception {
856         try {
857             delegate.getSuperTables("foo", "foo", "foo");
858         } catch (final SQLException e) {
859             // ignore
860         }
861         verify(obj, times(1)).getSuperTables("foo", "foo", "foo");
862     }
863 
864     @Test
865     void testGetSuperTypesStringStringString() throws Exception {
866         try {
867             delegate.getSuperTypes("foo", "foo", "foo");
868         } catch (final SQLException e) {
869             // ignore
870         }
871         verify(obj, times(1)).getSuperTypes("foo", "foo", "foo");
872     }
873 
874     @Test
875     void testGetSystemFunctions() throws Exception {
876         try {
877             delegate.getSystemFunctions();
878         } catch (final SQLException e) {
879             // ignore
880         }
881         verify(obj, times(1)).getSystemFunctions();
882     }
883 
884     @Test
885     void testGetTablePrivilegesStringStringString() throws Exception {
886         try {
887             delegate.getTablePrivileges("foo", "foo", "foo");
888         } catch (final SQLException e) {
889             // ignore
890         }
891         verify(obj, times(1)).getTablePrivileges("foo", "foo", "foo");
892     }
893 
894     @Test
895     void testGetTablesStringStringStringStringArray() throws Exception {
896         try {
897             delegate.getTables("foo", "foo", "foo", (String[]) null);
898         } catch (final SQLException e) {
899             // ignore
900         }
901         verify(obj, times(1)).getTables("foo", "foo", "foo", (String[]) null);
902     }
903 
904     @Test
905     void testGetTableTypes() throws Exception {
906         try {
907             delegate.getTableTypes();
908         } catch (final SQLException e) {
909             // ignore
910         }
911         verify(obj, times(1)).getTableTypes();
912     }
913 
914     @Test
915     void testGetTimeDateFunctions() throws Exception {
916         try {
917             delegate.getTimeDateFunctions();
918         } catch (final SQLException e) {
919             // ignore
920         }
921         verify(obj, times(1)).getTimeDateFunctions();
922     }
923 
924     @Test
925     void testGetTypeInfo() throws Exception {
926         try {
927             delegate.getTypeInfo();
928         } catch (final SQLException e) {
929             // ignore
930         }
931         verify(obj, times(1)).getTypeInfo();
932     }
933 
934     @Test
935     void testGetUDTsStringStringStringIntegerArray() throws Exception {
936         try {
937             delegate.getUDTs("foo", "foo", "foo", (int[]) null);
938         } catch (final SQLException e) {
939             // ignore
940         }
941         verify(obj, times(1)).getUDTs("foo", "foo", "foo", (int[]) null);
942     }
943 
944     @Test
945     void testGetURL() throws Exception {
946         try {
947             delegate.getURL();
948         } catch (final SQLException e) {
949             // ignore
950         }
951         verify(obj, times(1)).getURL();
952     }
953 
954     @Test
955     void testGetUserName() throws Exception {
956         try {
957             delegate.getUserName();
958         } catch (final SQLException e) {
959             // ignore
960         }
961         verify(obj, times(1)).getUserName();
962     }
963 
964     @Test
965     void testGetVersionColumnsStringStringString() throws Exception {
966         try {
967             delegate.getVersionColumns("foo", "foo", "foo");
968         } catch (final SQLException e) {
969             // ignore
970         }
971         verify(obj, times(1)).getVersionColumns("foo", "foo", "foo");
972     }
973 
974     @Test
975     void testInsertsAreDetectedInteger() throws Exception {
976         try {
977             delegate.insertsAreDetected(1);
978         } catch (final SQLException e) {
979             // ignore
980         }
981         verify(obj, times(1)).insertsAreDetected(1);
982     }
983 
984     @Test
985     void testIsCatalogAtStart() throws Exception {
986         try {
987             delegate.isCatalogAtStart();
988         } catch (final SQLException e) {
989             // ignore
990         }
991         verify(obj, times(1)).isCatalogAtStart();
992     }
993 
994     @Test
995     void testIsReadOnly() throws Exception {
996         try {
997             delegate.isReadOnly();
998         } catch (final SQLException e) {
999             // ignore
1000         }
1001         verify(obj, times(1)).isReadOnly();
1002     }
1003 
1004     @Test
1005     void testLocatorsUpdateCopy() throws Exception {
1006         try {
1007             delegate.locatorsUpdateCopy();
1008         } catch (final SQLException e) {
1009             // ignore
1010         }
1011         verify(obj, times(1)).locatorsUpdateCopy();
1012     }
1013 
1014     @Test
1015     void testNullArguments() throws Exception {
1016         assertThrows(NullPointerException.class, () -> new DelegatingDatabaseMetaData(null, null));
1017         assertThrows(NullPointerException.class, () -> new DelegatingDatabaseMetaData(new DelegatingConnection(null), null));
1018     }
1019 
1020     @Test
1021     void testNullPlusNonNullIsNull() throws Exception {
1022         try {
1023             delegate.nullPlusNonNullIsNull();
1024         } catch (final SQLException e) {
1025             // ignore
1026         }
1027         verify(obj, times(1)).nullPlusNonNullIsNull();
1028     }
1029 
1030     @Test
1031     void testNullsAreSortedAtEnd() throws Exception {
1032         try {
1033             delegate.nullsAreSortedAtEnd();
1034         } catch (final SQLException e) {
1035             // ignore
1036         }
1037         verify(obj, times(1)).nullsAreSortedAtEnd();
1038     }
1039 
1040     @Test
1041     void testNullsAreSortedAtStart() throws Exception {
1042         try {
1043             delegate.nullsAreSortedAtStart();
1044         } catch (final SQLException e) {
1045             // ignore
1046         }
1047         verify(obj, times(1)).nullsAreSortedAtStart();
1048     }
1049 
1050     @Test
1051     void testNullsAreSortedHigh() throws Exception {
1052         try {
1053             delegate.nullsAreSortedHigh();
1054         } catch (final SQLException e) {
1055             // ignore
1056         }
1057         verify(obj, times(1)).nullsAreSortedHigh();
1058     }
1059 
1060     @Test
1061     void testNullsAreSortedLow() throws Exception {
1062         try {
1063             delegate.nullsAreSortedLow();
1064         } catch (final SQLException e) {
1065             // ignore
1066         }
1067         verify(obj, times(1)).nullsAreSortedLow();
1068     }
1069 
1070     @Test
1071     void testOthersDeletesAreVisibleInteger() throws Exception {
1072         try {
1073             delegate.othersDeletesAreVisible(1);
1074         } catch (final SQLException e) {
1075             // ignore
1076         }
1077         verify(obj, times(1)).othersDeletesAreVisible(1);
1078     }
1079 
1080     @Test
1081     void testOthersInsertsAreVisibleInteger() throws Exception {
1082         try {
1083             delegate.othersInsertsAreVisible(1);
1084         } catch (final SQLException e) {
1085             // ignore
1086         }
1087         verify(obj, times(1)).othersInsertsAreVisible(1);
1088     }
1089 
1090     @Test
1091     void testOthersUpdatesAreVisibleInteger() throws Exception {
1092         try {
1093             delegate.othersUpdatesAreVisible(1);
1094         } catch (final SQLException e) {
1095             // ignore
1096         }
1097         verify(obj, times(1)).othersUpdatesAreVisible(1);
1098     }
1099 
1100     @Test
1101     void testOwnDeletesAreVisibleInteger() throws Exception {
1102         try {
1103             delegate.ownDeletesAreVisible(1);
1104         } catch (final SQLException e) {
1105             // ignore
1106         }
1107         verify(obj, times(1)).ownDeletesAreVisible(1);
1108     }
1109 
1110     @Test
1111     void testOwnInsertsAreVisibleInteger() throws Exception {
1112         try {
1113             delegate.ownInsertsAreVisible(1);
1114         } catch (final SQLException e) {
1115             // ignore
1116         }
1117         verify(obj, times(1)).ownInsertsAreVisible(1);
1118     }
1119 
1120     @Test
1121     void testOwnUpdatesAreVisibleInteger() throws Exception {
1122         try {
1123             delegate.ownUpdatesAreVisible(1);
1124         } catch (final SQLException e) {
1125             // ignore
1126         }
1127         verify(obj, times(1)).ownUpdatesAreVisible(1);
1128     }
1129 
1130     @Test
1131     void testStoresLowerCaseIdentifiers() throws Exception {
1132         try {
1133             delegate.storesLowerCaseIdentifiers();
1134         } catch (final SQLException e) {
1135             // ignore
1136         }
1137         verify(obj, times(1)).storesLowerCaseIdentifiers();
1138     }
1139 
1140     @Test
1141     void testStoresLowerCaseQuotedIdentifiers() throws Exception {
1142         try {
1143             delegate.storesLowerCaseQuotedIdentifiers();
1144         } catch (final SQLException e) {
1145             // ignore
1146         }
1147         verify(obj, times(1)).storesLowerCaseQuotedIdentifiers();
1148     }
1149 
1150     @Test
1151     void testStoresMixedCaseIdentifiers() throws Exception {
1152         try {
1153             delegate.storesMixedCaseIdentifiers();
1154         } catch (final SQLException e) {
1155             // ignore
1156         }
1157         verify(obj, times(1)).storesMixedCaseIdentifiers();
1158     }
1159 
1160     @Test
1161     void testStoresMixedCaseQuotedIdentifiers() throws Exception {
1162         try {
1163             delegate.storesMixedCaseQuotedIdentifiers();
1164         } catch (final SQLException e) {
1165             // ignore
1166         }
1167         verify(obj, times(1)).storesMixedCaseQuotedIdentifiers();
1168     }
1169 
1170     @Test
1171     void testStoresUpperCaseIdentifiers() throws Exception {
1172         try {
1173             delegate.storesUpperCaseIdentifiers();
1174         } catch (final SQLException e) {
1175             // ignore
1176         }
1177         verify(obj, times(1)).storesUpperCaseIdentifiers();
1178     }
1179 
1180     @Test
1181     void testStoresUpperCaseQuotedIdentifiers() throws Exception {
1182         try {
1183             delegate.storesUpperCaseQuotedIdentifiers();
1184         } catch (final SQLException e) {
1185             // ignore
1186         }
1187         verify(obj, times(1)).storesUpperCaseQuotedIdentifiers();
1188     }
1189 
1190     @Test
1191     void testSupportsAlterTableWithAddColumn() throws Exception {
1192         try {
1193             delegate.supportsAlterTableWithAddColumn();
1194         } catch (final SQLException e) {
1195             // ignore
1196         }
1197         verify(obj, times(1)).supportsAlterTableWithAddColumn();
1198     }
1199 
1200     @Test
1201     void testSupportsAlterTableWithDropColumn() throws Exception {
1202         try {
1203             delegate.supportsAlterTableWithDropColumn();
1204         } catch (final SQLException e) {
1205             // ignore
1206         }
1207         verify(obj, times(1)).supportsAlterTableWithDropColumn();
1208     }
1209 
1210     @Test
1211     void testSupportsANSI92EntryLevelSQL() throws Exception {
1212         try {
1213             delegate.supportsANSI92EntryLevelSQL();
1214         } catch (final SQLException e) {
1215             // ignore
1216         }
1217         verify(obj, times(1)).supportsANSI92EntryLevelSQL();
1218     }
1219 
1220     @Test
1221     void testSupportsANSI92FullSQL() throws Exception {
1222         try {
1223             delegate.supportsANSI92FullSQL();
1224         } catch (final SQLException e) {
1225             // ignore
1226         }
1227         verify(obj, times(1)).supportsANSI92FullSQL();
1228     }
1229 
1230     @Test
1231     void testSupportsANSI92IntermediateSQL() throws Exception {
1232         try {
1233             delegate.supportsANSI92IntermediateSQL();
1234         } catch (final SQLException e) {
1235             // ignore
1236         }
1237         verify(obj, times(1)).supportsANSI92IntermediateSQL();
1238     }
1239 
1240     @Test
1241     void testSupportsBatchUpdates() throws Exception {
1242         try {
1243             delegate.supportsBatchUpdates();
1244         } catch (final SQLException e) {
1245             // ignore
1246         }
1247         verify(obj, times(1)).supportsBatchUpdates();
1248     }
1249 
1250     @Test
1251     void testSupportsCatalogsInDataManipulation() throws Exception {
1252         try {
1253             delegate.supportsCatalogsInDataManipulation();
1254         } catch (final SQLException e) {
1255             // ignore
1256         }
1257         verify(obj, times(1)).supportsCatalogsInDataManipulation();
1258     }
1259 
1260     @Test
1261     void testSupportsCatalogsInIndexDefinitions() throws Exception {
1262         try {
1263             delegate.supportsCatalogsInIndexDefinitions();
1264         } catch (final SQLException e) {
1265             // ignore
1266         }
1267         verify(obj, times(1)).supportsCatalogsInIndexDefinitions();
1268     }
1269 
1270     @Test
1271     void testSupportsCatalogsInPrivilegeDefinitions() throws Exception {
1272         try {
1273             delegate.supportsCatalogsInPrivilegeDefinitions();
1274         } catch (final SQLException e) {
1275             // ignore
1276         }
1277         verify(obj, times(1)).supportsCatalogsInPrivilegeDefinitions();
1278     }
1279 
1280     @Test
1281     void testSupportsCatalogsInProcedureCalls() throws Exception {
1282         try {
1283             delegate.supportsCatalogsInProcedureCalls();
1284         } catch (final SQLException e) {
1285             // ignore
1286         }
1287         verify(obj, times(1)).supportsCatalogsInProcedureCalls();
1288     }
1289 
1290     @Test
1291     void testSupportsCatalogsInTableDefinitions() throws Exception {
1292         try {
1293             delegate.supportsCatalogsInTableDefinitions();
1294         } catch (final SQLException e) {
1295             // ignore
1296         }
1297         verify(obj, times(1)).supportsCatalogsInTableDefinitions();
1298     }
1299 
1300     @Test
1301     void testSupportsColumnAliasing() throws Exception {
1302         try {
1303             delegate.supportsColumnAliasing();
1304         } catch (final SQLException e) {
1305             // ignore
1306         }
1307         verify(obj, times(1)).supportsColumnAliasing();
1308     }
1309 
1310     @Test
1311     void testSupportsConvert() throws Exception {
1312         try {
1313             delegate.supportsConvert();
1314         } catch (final SQLException e) {
1315             // ignore
1316         }
1317         verify(obj, times(1)).supportsConvert();
1318     }
1319 
1320     @Test
1321     void testSupportsConvertIntegerInteger() throws Exception {
1322         try {
1323             delegate.supportsConvert(1, 1);
1324         } catch (final SQLException e) {
1325             // ignore
1326         }
1327         verify(obj, times(1)).supportsConvert(1, 1);
1328     }
1329 
1330     @Test
1331     void testSupportsCoreSQLGrammar() throws Exception {
1332         try {
1333             delegate.supportsCoreSQLGrammar();
1334         } catch (final SQLException e) {
1335             // ignore
1336         }
1337         verify(obj, times(1)).supportsCoreSQLGrammar();
1338     }
1339 
1340     @Test
1341     void testSupportsCorrelatedSubqueries() throws Exception {
1342         try {
1343             delegate.supportsCorrelatedSubqueries();
1344         } catch (final SQLException e) {
1345             // ignore
1346         }
1347         verify(obj, times(1)).supportsCorrelatedSubqueries();
1348     }
1349 
1350     @Test
1351     void testSupportsDataDefinitionAndDataManipulationTransactions() throws Exception {
1352         try {
1353             delegate.supportsDataDefinitionAndDataManipulationTransactions();
1354         } catch (final SQLException e) {
1355             // ignore
1356         }
1357         verify(obj, times(1)).supportsDataDefinitionAndDataManipulationTransactions();
1358     }
1359 
1360     @Test
1361     void testSupportsDataManipulationTransactionsOnly() throws Exception {
1362         try {
1363             delegate.supportsDataManipulationTransactionsOnly();
1364         } catch (final SQLException e) {
1365             // ignore
1366         }
1367         verify(obj, times(1)).supportsDataManipulationTransactionsOnly();
1368     }
1369 
1370     @Test
1371     void testSupportsDifferentTableCorrelationNames() throws Exception {
1372         try {
1373             delegate.supportsDifferentTableCorrelationNames();
1374         } catch (final SQLException e) {
1375             // ignore
1376         }
1377         verify(obj, times(1)).supportsDifferentTableCorrelationNames();
1378     }
1379 
1380     @Test
1381     void testSupportsExpressionsInOrderBy() throws Exception {
1382         try {
1383             delegate.supportsExpressionsInOrderBy();
1384         } catch (final SQLException e) {
1385             // ignore
1386         }
1387         verify(obj, times(1)).supportsExpressionsInOrderBy();
1388     }
1389 
1390     @Test
1391     void testSupportsExtendedSQLGrammar() throws Exception {
1392         try {
1393             delegate.supportsExtendedSQLGrammar();
1394         } catch (final SQLException e) {
1395             // ignore
1396         }
1397         verify(obj, times(1)).supportsExtendedSQLGrammar();
1398     }
1399 
1400     @Test
1401     void testSupportsFullOuterJoins() throws Exception {
1402         try {
1403             delegate.supportsFullOuterJoins();
1404         } catch (final SQLException e) {
1405             // ignore
1406         }
1407         verify(obj, times(1)).supportsFullOuterJoins();
1408     }
1409 
1410     @Test
1411     void testSupportsGetGeneratedKeys() throws Exception {
1412         try {
1413             delegate.supportsGetGeneratedKeys();
1414         } catch (final SQLException e) {
1415             // ignore
1416         }
1417         verify(obj, times(1)).supportsGetGeneratedKeys();
1418     }
1419 
1420     @Test
1421     void testSupportsGroupBy() throws Exception {
1422         try {
1423             delegate.supportsGroupBy();
1424         } catch (final SQLException e) {
1425             // ignore
1426         }
1427         verify(obj, times(1)).supportsGroupBy();
1428     }
1429 
1430     @Test
1431     void testSupportsGroupByBeyondSelect() throws Exception {
1432         try {
1433             delegate.supportsGroupByBeyondSelect();
1434         } catch (final SQLException e) {
1435             // ignore
1436         }
1437         verify(obj, times(1)).supportsGroupByBeyondSelect();
1438     }
1439 
1440     @Test
1441     void testSupportsGroupByUnrelated() throws Exception {
1442         try {
1443             delegate.supportsGroupByUnrelated();
1444         } catch (final SQLException e) {
1445             // ignore
1446         }
1447         verify(obj, times(1)).supportsGroupByUnrelated();
1448     }
1449 
1450     @Test
1451     void testSupportsIntegrityEnhancementFacility() throws Exception {
1452         try {
1453             delegate.supportsIntegrityEnhancementFacility();
1454         } catch (final SQLException e) {
1455             // ignore
1456         }
1457         verify(obj, times(1)).supportsIntegrityEnhancementFacility();
1458     }
1459 
1460     @Test
1461     void testSupportsLikeEscapeClause() throws Exception {
1462         try {
1463             delegate.supportsLikeEscapeClause();
1464         } catch (final SQLException e) {
1465             // ignore
1466         }
1467         verify(obj, times(1)).supportsLikeEscapeClause();
1468     }
1469 
1470     @Test
1471     void testSupportsLimitedOuterJoins() throws Exception {
1472         try {
1473             delegate.supportsLimitedOuterJoins();
1474         } catch (final SQLException e) {
1475             // ignore
1476         }
1477         verify(obj, times(1)).supportsLimitedOuterJoins();
1478     }
1479 
1480     @Test
1481     void testSupportsMinimumSQLGrammar() throws Exception {
1482         try {
1483             delegate.supportsMinimumSQLGrammar();
1484         } catch (final SQLException e) {
1485             // ignore
1486         }
1487         verify(obj, times(1)).supportsMinimumSQLGrammar();
1488     }
1489 
1490     @Test
1491     void testSupportsMixedCaseIdentifiers() throws Exception {
1492         try {
1493             delegate.supportsMixedCaseIdentifiers();
1494         } catch (final SQLException e) {
1495             // ignore
1496         }
1497         verify(obj, times(1)).supportsMixedCaseIdentifiers();
1498     }
1499 
1500     @Test
1501     void testSupportsMixedCaseQuotedIdentifiers() throws Exception {
1502         try {
1503             delegate.supportsMixedCaseQuotedIdentifiers();
1504         } catch (final SQLException e) {
1505             // ignore
1506         }
1507         verify(obj, times(1)).supportsMixedCaseQuotedIdentifiers();
1508     }
1509 
1510     @Test
1511     void testSupportsMultipleOpenResults() throws Exception {
1512         try {
1513             delegate.supportsMultipleOpenResults();
1514         } catch (final SQLException e) {
1515             // ignore
1516         }
1517         verify(obj, times(1)).supportsMultipleOpenResults();
1518     }
1519 
1520     @Test
1521     void testSupportsMultipleResultSets() throws Exception {
1522         try {
1523             delegate.supportsMultipleResultSets();
1524         } catch (final SQLException e) {
1525             // ignore
1526         }
1527         verify(obj, times(1)).supportsMultipleResultSets();
1528     }
1529 
1530     @Test
1531     void testSupportsMultipleTransactions() throws Exception {
1532         try {
1533             delegate.supportsMultipleTransactions();
1534         } catch (final SQLException e) {
1535             // ignore
1536         }
1537         verify(obj, times(1)).supportsMultipleTransactions();
1538     }
1539 
1540     @Test
1541     void testSupportsNamedParameters() throws Exception {
1542         try {
1543             delegate.supportsNamedParameters();
1544         } catch (final SQLException e) {
1545             // ignore
1546         }
1547         verify(obj, times(1)).supportsNamedParameters();
1548     }
1549 
1550     @Test
1551     void testSupportsNonNullableColumns() throws Exception {
1552         try {
1553             delegate.supportsNonNullableColumns();
1554         } catch (final SQLException e) {
1555             // ignore
1556         }
1557         verify(obj, times(1)).supportsNonNullableColumns();
1558     }
1559 
1560     @Test
1561     void testSupportsOpenCursorsAcrossCommit() throws Exception {
1562         try {
1563             delegate.supportsOpenCursorsAcrossCommit();
1564         } catch (final SQLException e) {
1565             // ignore
1566         }
1567         verify(obj, times(1)).supportsOpenCursorsAcrossCommit();
1568     }
1569 
1570     @Test
1571     void testSupportsOpenCursorsAcrossRollback() throws Exception {
1572         try {
1573             delegate.supportsOpenCursorsAcrossRollback();
1574         } catch (final SQLException e) {
1575             // ignore
1576         }
1577         verify(obj, times(1)).supportsOpenCursorsAcrossRollback();
1578     }
1579 
1580     @Test
1581     void testSupportsOpenStatementsAcrossCommit() throws Exception {
1582         try {
1583             delegate.supportsOpenStatementsAcrossCommit();
1584         } catch (final SQLException e) {
1585             // ignore
1586         }
1587         verify(obj, times(1)).supportsOpenStatementsAcrossCommit();
1588     }
1589 
1590     @Test
1591     void testSupportsOpenStatementsAcrossRollback() throws Exception {
1592         try {
1593             delegate.supportsOpenStatementsAcrossRollback();
1594         } catch (final SQLException e) {
1595             // ignore
1596         }
1597         verify(obj, times(1)).supportsOpenStatementsAcrossRollback();
1598     }
1599 
1600     @Test
1601     void testSupportsOrderByUnrelated() throws Exception {
1602         try {
1603             delegate.supportsOrderByUnrelated();
1604         } catch (final SQLException e) {
1605             // ignore
1606         }
1607         verify(obj, times(1)).supportsOrderByUnrelated();
1608     }
1609 
1610     @Test
1611     void testSupportsOuterJoins() throws Exception {
1612         try {
1613             delegate.supportsOuterJoins();
1614         } catch (final SQLException e) {
1615             // ignore
1616         }
1617         verify(obj, times(1)).supportsOuterJoins();
1618     }
1619 
1620     @Test
1621     void testSupportsPositionedDelete() throws Exception {
1622         try {
1623             delegate.supportsPositionedDelete();
1624         } catch (final SQLException e) {
1625             // ignore
1626         }
1627         verify(obj, times(1)).supportsPositionedDelete();
1628     }
1629 
1630     @Test
1631     void testSupportsPositionedUpdate() throws Exception {
1632         try {
1633             delegate.supportsPositionedUpdate();
1634         } catch (final SQLException e) {
1635             // ignore
1636         }
1637         verify(obj, times(1)).supportsPositionedUpdate();
1638     }
1639 
1640     @Test
1641     void testSupportsRefCursors() throws Exception {
1642         try {
1643             delegate.supportsRefCursors();
1644         } catch (final SQLException e) {
1645             // ignore
1646         }
1647         verify(obj, times(1)).supportsRefCursors();
1648     }
1649 
1650     @Test
1651     void testSupportsResultSetConcurrencyIntegerInteger() throws Exception {
1652         try {
1653             delegate.supportsResultSetConcurrency(1, 1);
1654         } catch (final SQLException e) {
1655             // ignore
1656         }
1657         verify(obj, times(1)).supportsResultSetConcurrency(1, 1);
1658     }
1659 
1660     @Test
1661     void testSupportsResultSetHoldabilityInteger() throws Exception {
1662         try {
1663             delegate.supportsResultSetHoldability(1);
1664         } catch (final SQLException e) {
1665             // ignore
1666         }
1667         verify(obj, times(1)).supportsResultSetHoldability(1);
1668     }
1669 
1670     @Test
1671     void testSupportsResultSetTypeInteger() throws Exception {
1672         try {
1673             delegate.supportsResultSetType(1);
1674         } catch (final SQLException e) {
1675             // ignore
1676         }
1677         verify(obj, times(1)).supportsResultSetType(1);
1678     }
1679 
1680     @Test
1681     void testSupportsSavepoints() throws Exception {
1682         try {
1683             delegate.supportsSavepoints();
1684         } catch (final SQLException e) {
1685             // ignore
1686         }
1687         verify(obj, times(1)).supportsSavepoints();
1688     }
1689 
1690     @Test
1691     void testSupportsSchemasInDataManipulation() throws Exception {
1692         try {
1693             delegate.supportsSchemasInDataManipulation();
1694         } catch (final SQLException e) {
1695             // ignore
1696         }
1697         verify(obj, times(1)).supportsSchemasInDataManipulation();
1698     }
1699 
1700     @Test
1701     void testSupportsSchemasInIndexDefinitions() throws Exception {
1702         try {
1703             delegate.supportsSchemasInIndexDefinitions();
1704         } catch (final SQLException e) {
1705             // ignore
1706         }
1707         verify(obj, times(1)).supportsSchemasInIndexDefinitions();
1708     }
1709 
1710     @Test
1711     void testSupportsSchemasInPrivilegeDefinitions() throws Exception {
1712         try {
1713             delegate.supportsSchemasInPrivilegeDefinitions();
1714         } catch (final SQLException e) {
1715             // ignore
1716         }
1717         verify(obj, times(1)).supportsSchemasInPrivilegeDefinitions();
1718     }
1719 
1720     @Test
1721     void testSupportsSchemasInProcedureCalls() throws Exception {
1722         try {
1723             delegate.supportsSchemasInProcedureCalls();
1724         } catch (final SQLException e) {
1725             // ignore
1726         }
1727         verify(obj, times(1)).supportsSchemasInProcedureCalls();
1728     }
1729 
1730     @Test
1731     void testSupportsSchemasInTableDefinitions() throws Exception {
1732         try {
1733             delegate.supportsSchemasInTableDefinitions();
1734         } catch (final SQLException e) {
1735             // ignore
1736         }
1737         verify(obj, times(1)).supportsSchemasInTableDefinitions();
1738     }
1739 
1740     @Test
1741     void testSupportsSelectForUpdate() throws Exception {
1742         try {
1743             delegate.supportsSelectForUpdate();
1744         } catch (final SQLException e) {
1745             // ignore
1746         }
1747         verify(obj, times(1)).supportsSelectForUpdate();
1748     }
1749 
1750     @Test
1751     void testSupportsStatementPooling() throws Exception {
1752         try {
1753             delegate.supportsStatementPooling();
1754         } catch (final SQLException e) {
1755             // ignore
1756         }
1757         verify(obj, times(1)).supportsStatementPooling();
1758     }
1759 
1760     @Test
1761     void testSupportsStoredFunctionsUsingCallSyntax() throws Exception {
1762         try {
1763             delegate.supportsStoredFunctionsUsingCallSyntax();
1764         } catch (final SQLException e) {
1765             // ignore
1766         }
1767         verify(obj, times(1)).supportsStoredFunctionsUsingCallSyntax();
1768     }
1769 
1770     @Test
1771     void testSupportsStoredProcedures() throws Exception {
1772         try {
1773             delegate.supportsStoredProcedures();
1774         } catch (final SQLException e) {
1775             // ignore
1776         }
1777         verify(obj, times(1)).supportsStoredProcedures();
1778     }
1779 
1780     @Test
1781     void testSupportsSubqueriesInComparisons() throws Exception {
1782         try {
1783             delegate.supportsSubqueriesInComparisons();
1784         } catch (final SQLException e) {
1785             // ignore
1786         }
1787         verify(obj, times(1)).supportsSubqueriesInComparisons();
1788     }
1789 
1790     @Test
1791     void testSupportsSubqueriesInExists() throws Exception {
1792         try {
1793             delegate.supportsSubqueriesInExists();
1794         } catch (final SQLException e) {
1795             // ignore
1796         }
1797         verify(obj, times(1)).supportsSubqueriesInExists();
1798     }
1799 
1800     @Test
1801     void testSupportsSubqueriesInIns() throws Exception {
1802         try {
1803             delegate.supportsSubqueriesInIns();
1804         } catch (final SQLException e) {
1805             // ignore
1806         }
1807         verify(obj, times(1)).supportsSubqueriesInIns();
1808     }
1809 
1810     @Test
1811     void testSupportsSubqueriesInQuantifieds() throws Exception {
1812         try {
1813             delegate.supportsSubqueriesInQuantifieds();
1814         } catch (final SQLException e) {
1815             // ignore
1816         }
1817         verify(obj, times(1)).supportsSubqueriesInQuantifieds();
1818     }
1819 
1820     @Test
1821     void testSupportsTableCorrelationNames() throws Exception {
1822         try {
1823             delegate.supportsTableCorrelationNames();
1824         } catch (final SQLException e) {
1825             // ignore
1826         }
1827         verify(obj, times(1)).supportsTableCorrelationNames();
1828     }
1829 
1830     @Test
1831     void testSupportsTransactionIsolationLevelInteger() throws Exception {
1832         try {
1833             delegate.supportsTransactionIsolationLevel(1);
1834         } catch (final SQLException e) {
1835             // ignore
1836         }
1837         verify(obj, times(1)).supportsTransactionIsolationLevel(1);
1838     }
1839 
1840     @Test
1841     void testSupportsTransactions() throws Exception {
1842         try {
1843             delegate.supportsTransactions();
1844         } catch (final SQLException e) {
1845             // ignore
1846         }
1847         verify(obj, times(1)).supportsTransactions();
1848     }
1849 
1850     @Test
1851     void testSupportsUnion() throws Exception {
1852         try {
1853             delegate.supportsUnion();
1854         } catch (final SQLException e) {
1855             // ignore
1856         }
1857         verify(obj, times(1)).supportsUnion();
1858     }
1859 
1860     @Test
1861     void testSupportsUnionAll() throws Exception {
1862         try {
1863             delegate.supportsUnionAll();
1864         } catch (final SQLException e) {
1865             // ignore
1866         }
1867         verify(obj, times(1)).supportsUnionAll();
1868     }
1869 
1870     @Test
1871     void testUpdatesAreDetectedInteger() throws Exception {
1872         try {
1873             delegate.updatesAreDetected(1);
1874         } catch (final SQLException e) {
1875             // ignore
1876         }
1877         verify(obj, times(1)).updatesAreDetected(1);
1878     }
1879 
1880     @Test
1881     void testUsesLocalFilePerTable() throws Exception {
1882         try {
1883             delegate.usesLocalFilePerTable();
1884         } catch (final SQLException e) {
1885             // ignore
1886         }
1887         verify(obj, times(1)).usesLocalFilePerTable();
1888     }
1889 
1890     @Test
1891     void testUsesLocalFiles() throws Exception {
1892         try {
1893             delegate.usesLocalFiles();
1894         } catch (final SQLException e) {
1895             // ignore
1896         }
1897         verify(obj, times(1)).usesLocalFiles();
1898     }
1899 
1900     @Test
1901     void testWrap() throws SQLException {
1902         assertEquals(delegate, delegate.unwrap(DatabaseMetaData.class));
1903         assertEquals(delegate, delegate.unwrap(DelegatingDatabaseMetaData.class));
1904         assertEquals(obj, delegate.unwrap(obj.getClass()));
1905         assertNull(delegate.unwrap(String.class));
1906         assertTrue(delegate.isWrapperFor(DatabaseMetaData.class));
1907         assertTrue(delegate.isWrapperFor(DelegatingDatabaseMetaData.class));
1908         assertTrue(delegate.isWrapperFor(obj.getClass()));
1909         assertFalse(delegate.isWrapperFor(String.class));
1910     }
1911 }