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    *      http://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.assertNull;
23  import static org.junit.jupiter.api.Assertions.assertThrows;
24  import static org.junit.jupiter.api.Assertions.assertTrue;
25  import static org.mockito.Mockito.mock;
26  import static org.mockito.Mockito.times;
27  import static org.mockito.Mockito.verify;
28  
29  import java.sql.DatabaseMetaData;
30  import java.sql.ResultSet;
31  import java.sql.SQLException;
32  
33  import org.junit.jupiter.api.BeforeEach;
34  import org.junit.jupiter.api.Test;
35  
36  /**
37   * Test suite for {@link DelegatingDatabaseMetaData}.
38   */
39  public class TestDelegatingDatabaseMetaData {
40  
41      private TesterConnection testConn;
42      private DelegatingConnection<?> conn;
43      private DelegatingDatabaseMetaData delegate;
44      private DatabaseMetaData obj;
45  
46      @BeforeEach
47      public void setUp() throws Exception {
48          obj = mock(DatabaseMetaData.class);
49          testConn = new TesterConnection("test", "test");
50          conn = new DelegatingConnection<>(testConn);
51          delegate = new DelegatingDatabaseMetaData(conn, obj);
52      }
53  
54      @Test
55      public void testAllProceduresAreCallable() throws Exception {
56          try {
57              delegate.allProceduresAreCallable();
58          } catch (final SQLException e) {}
59          verify(obj, times(1)).allProceduresAreCallable();
60      }
61  
62      @Test
63      public void testAllTablesAreSelectable() throws Exception {
64          try {
65              delegate.allTablesAreSelectable();
66          } catch (final SQLException e) {}
67          verify(obj, times(1)).allTablesAreSelectable();
68      }
69  
70      @Test
71      public void testAutoCommitFailureClosesAllResultSets() throws Exception {
72          try {
73              delegate.autoCommitFailureClosesAllResultSets();
74          } catch (final SQLException e) {}
75          verify(obj, times(1)).autoCommitFailureClosesAllResultSets();
76      }
77  
78      @Test
79      public void testCheckOpen() throws Exception {
80          delegate = new DelegatingDatabaseMetaData(conn, conn.getMetaData());
81          final ResultSet rst = delegate.getSchemas();
82          assertFalse(rst.isClosed());
83          conn.close();
84          assertTrue(rst.isClosed());
85      }
86  
87      @Test
88      public void testDataDefinitionCausesTransactionCommit() throws Exception {
89          try {
90              delegate.dataDefinitionCausesTransactionCommit();
91          } catch (final SQLException e) {}
92          verify(obj, times(1)).dataDefinitionCausesTransactionCommit();
93      }
94  
95      @Test
96      public void testDataDefinitionIgnoredInTransactions() throws Exception {
97          try {
98              delegate.dataDefinitionIgnoredInTransactions();
99          } catch (final SQLException e) {}
100         verify(obj, times(1)).dataDefinitionIgnoredInTransactions();
101     }
102 
103     @Test
104     public void testDeletesAreDetectedInteger() throws Exception {
105         try {
106             delegate.deletesAreDetected(1);
107         } catch (final SQLException e) {}
108         verify(obj, times(1)).deletesAreDetected(1);
109     }
110 
111     @Test
112     public void testDoesMaxRowSizeIncludeBlobs() throws Exception {
113         try {
114             delegate.doesMaxRowSizeIncludeBlobs();
115         } catch (final SQLException e) {}
116         verify(obj, times(1)).doesMaxRowSizeIncludeBlobs();
117     }
118 
119     @Test
120     public void testGeneratedKeyAlwaysReturned() throws Exception {
121         try {
122             delegate.generatedKeyAlwaysReturned();
123         } catch (final SQLException e) {}
124         verify(obj, times(1)).generatedKeyAlwaysReturned();
125     }
126 
127     @Test
128     public void testGetAttributesStringStringStringString() throws Exception {
129         try {
130             delegate.getAttributes("foo","foo","foo","foo");
131         } catch (final SQLException e) {}
132         verify(obj, times(1)).getAttributes("foo","foo","foo","foo");
133     }
134 
135     @Test
136     public void testGetBestRowIdentifierStringStringStringIntegerBoolean() throws Exception {
137         try {
138             delegate.getBestRowIdentifier("foo","foo","foo",1,Boolean.TRUE);
139         } catch (final SQLException e) {}
140         verify(obj, times(1)).getBestRowIdentifier("foo","foo","foo",1,Boolean.TRUE);
141     }
142 
143     @Test
144     public void testGetCatalogs() throws Exception {
145         try {
146             delegate.getCatalogs();
147         } catch (final SQLException e) {}
148         verify(obj, times(1)).getCatalogs();
149     }
150 
151     @Test
152     public void testGetCatalogSeparator() throws Exception {
153         try {
154             delegate.getCatalogSeparator();
155         } catch (final SQLException e) {}
156         verify(obj, times(1)).getCatalogSeparator();
157     }
158 
159     @Test
160     public void testGetCatalogTerm() throws Exception {
161         try {
162             delegate.getCatalogTerm();
163         } catch (final SQLException e) {}
164         verify(obj, times(1)).getCatalogTerm();
165     }
166 
167     @Test
168     public void testGetClientInfoProperties() throws Exception {
169         try {
170             delegate.getClientInfoProperties();
171         } catch (final SQLException e) {}
172         verify(obj, times(1)).getClientInfoProperties();
173     }
174 
175     @Test
176     public void testGetColumnPrivilegesStringStringStringString() throws Exception {
177         try {
178             delegate.getColumnPrivileges("foo","foo","foo","foo");
179         } catch (final SQLException e) {}
180         verify(obj, times(1)).getColumnPrivileges("foo","foo","foo","foo");
181     }
182 
183     @Test
184     public void testGetColumnsStringStringStringString() throws Exception {
185         try {
186             delegate.getColumns("foo","foo","foo","foo");
187         } catch (final SQLException e) {}
188         verify(obj, times(1)).getColumns("foo","foo","foo","foo");
189     }
190 
191     /**
192      * This method is a bit special, and doesn't call the method on the wrapped object,
193      * instead returning the connection from the delegate object itself.
194      * @throws Exception
195      */
196     @Test
197     public void testGetConnection() throws Exception {
198         try {
199             delegate.getConnection();
200         } catch (final SQLException e) {}
201         verify(obj, times(0)).getConnection();
202     }
203 
204     @Test
205     public void testGetCrossReferenceStringStringStringStringStringString() throws Exception {
206         try {
207             delegate.getCrossReference("foo","foo","foo","foo","foo","foo");
208         } catch (final SQLException e) {}
209         verify(obj, times(1)).getCrossReference("foo","foo","foo","foo","foo","foo");
210     }
211 
212     @Test
213     public void testGetDatabaseMajorVersion() throws Exception {
214         try {
215             delegate.getDatabaseMajorVersion();
216         } catch (final SQLException e) {}
217         verify(obj, times(1)).getDatabaseMajorVersion();
218     }
219 
220     @Test
221     public void testGetDatabaseMinorVersion() throws Exception {
222         try {
223             delegate.getDatabaseMinorVersion();
224         } catch (final SQLException e) {}
225         verify(obj, times(1)).getDatabaseMinorVersion();
226     }
227 
228     @Test
229     public void testGetDatabaseProductName() throws Exception {
230         try {
231             delegate.getDatabaseProductName();
232         } catch (final SQLException e) {}
233         verify(obj, times(1)).getDatabaseProductName();
234     }
235 
236     @Test
237     public void testGetDatabaseProductVersion() throws Exception {
238         try {
239             delegate.getDatabaseProductVersion();
240         } catch (final SQLException e) {}
241         verify(obj, times(1)).getDatabaseProductVersion();
242     }
243 
244     @Test
245     public void testGetDefaultTransactionIsolation() throws Exception {
246         try {
247             delegate.getDefaultTransactionIsolation();
248         } catch (final SQLException e) {}
249         verify(obj, times(1)).getDefaultTransactionIsolation();
250     }
251 
252     @Test
253     public void testGetDelegate() throws Exception {
254         assertEquals(obj ,delegate.getDelegate());
255     }
256 
257     @Test
258     public void testGetDriverMajorVersion() throws Exception {
259         delegate.getDriverMajorVersion();
260         verify(obj, times(1)).getDriverMajorVersion();
261     }
262 
263     @Test
264     public void testGetDriverMinorVersion() throws Exception {
265         delegate.getDriverMinorVersion();
266         verify(obj, times(1)).getDriverMinorVersion();
267     }
268 
269     @Test
270     public void testGetDriverName() throws Exception {
271         try {
272             delegate.getDriverName();
273         } catch (final SQLException e) {}
274         verify(obj, times(1)).getDriverName();
275     }
276 
277     @Test
278     public void testGetDriverVersion() throws Exception {
279         try {
280             delegate.getDriverVersion();
281         } catch (final SQLException e) {}
282         verify(obj, times(1)).getDriverVersion();
283     }
284 
285     @Test
286     public void testGetExportedKeysStringStringString() throws Exception {
287         try {
288             delegate.getExportedKeys("foo","foo","foo");
289         } catch (final SQLException e) {}
290         verify(obj, times(1)).getExportedKeys("foo","foo","foo");
291     }
292 
293     @Test
294     public void testGetExtraNameCharacters() throws Exception {
295         try {
296             delegate.getExtraNameCharacters();
297         } catch (final SQLException e) {}
298         verify(obj, times(1)).getExtraNameCharacters();
299     }
300 
301     @Test
302     public void testGetFunctionColumnsStringStringStringString() throws Exception {
303         try {
304             delegate.getFunctionColumns("foo","foo","foo","foo");
305         } catch (final SQLException e) {}
306         verify(obj, times(1)).getFunctionColumns("foo","foo","foo","foo");
307     }
308 
309     @Test
310     public void testGetFunctionsStringStringString() throws Exception {
311         try {
312             delegate.getFunctions("foo","foo","foo");
313         } catch (final SQLException e) {}
314         verify(obj, times(1)).getFunctions("foo","foo","foo");
315     }
316 
317     @Test
318     public void testGetIdentifierQuoteString() throws Exception {
319         try {
320             delegate.getIdentifierQuoteString();
321         } catch (final SQLException e) {}
322         verify(obj, times(1)).getIdentifierQuoteString();
323     }
324 
325     @Test
326     public void testGetImportedKeysStringStringString() throws Exception {
327         try {
328             delegate.getImportedKeys("foo","foo","foo");
329         } catch (final SQLException e) {}
330         verify(obj, times(1)).getImportedKeys("foo","foo","foo");
331     }
332 
333     @Test
334     public void testGetIndexInfoStringStringStringBooleanBoolean() throws Exception {
335         try {
336             delegate.getIndexInfo("foo","foo","foo",Boolean.TRUE,Boolean.TRUE);
337         } catch (final SQLException e) {}
338         verify(obj, times(1)).getIndexInfo("foo","foo","foo",Boolean.TRUE,Boolean.TRUE);
339     }
340 
341     @Test
342     public void testGetJDBCMajorVersion() throws Exception {
343         try {
344             delegate.getJDBCMajorVersion();
345         } catch (final SQLException e) {}
346         verify(obj, times(1)).getJDBCMajorVersion();
347     }
348 
349     @Test
350     public void testGetJDBCMinorVersion() throws Exception {
351         try {
352             delegate.getJDBCMinorVersion();
353         } catch (final SQLException e) {}
354         verify(obj, times(1)).getJDBCMinorVersion();
355     }
356 
357     @Test
358     public void testGetMaxBinaryLiteralLength() throws Exception {
359         try {
360             delegate.getMaxBinaryLiteralLength();
361         } catch (final SQLException e) {}
362         verify(obj, times(1)).getMaxBinaryLiteralLength();
363     }
364 
365     @Test
366     public void testGetMaxCatalogNameLength() throws Exception {
367         try {
368             delegate.getMaxCatalogNameLength();
369         } catch (final SQLException e) {}
370         verify(obj, times(1)).getMaxCatalogNameLength();
371     }
372 
373     @Test
374     public void testGetMaxCharLiteralLength() throws Exception {
375         try {
376             delegate.getMaxCharLiteralLength();
377         } catch (final SQLException e) {}
378         verify(obj, times(1)).getMaxCharLiteralLength();
379     }
380 
381     @Test
382     public void testGetMaxColumnNameLength() throws Exception {
383         try {
384             delegate.getMaxColumnNameLength();
385         } catch (final SQLException e) {}
386         verify(obj, times(1)).getMaxColumnNameLength();
387     }
388 
389     @Test
390     public void testGetMaxColumnsInGroupBy() throws Exception {
391         try {
392             delegate.getMaxColumnsInGroupBy();
393         } catch (final SQLException e) {}
394         verify(obj, times(1)).getMaxColumnsInGroupBy();
395     }
396 
397     @Test
398     public void testGetMaxColumnsInIndex() throws Exception {
399         try {
400             delegate.getMaxColumnsInIndex();
401         } catch (final SQLException e) {}
402         verify(obj, times(1)).getMaxColumnsInIndex();
403     }
404 
405     @Test
406     public void testGetMaxColumnsInOrderBy() throws Exception {
407         try {
408             delegate.getMaxColumnsInOrderBy();
409         } catch (final SQLException e) {}
410         verify(obj, times(1)).getMaxColumnsInOrderBy();
411     }
412 
413     @Test
414     public void testGetMaxColumnsInSelect() throws Exception {
415         try {
416             delegate.getMaxColumnsInSelect();
417         } catch (final SQLException e) {}
418         verify(obj, times(1)).getMaxColumnsInSelect();
419     }
420 
421     @Test
422     public void testGetMaxColumnsInTable() throws Exception {
423         try {
424             delegate.getMaxColumnsInTable();
425         } catch (final SQLException e) {}
426         verify(obj, times(1)).getMaxColumnsInTable();
427     }
428 
429     @Test
430     public void testGetMaxConnections() throws Exception {
431         try {
432             delegate.getMaxConnections();
433         } catch (final SQLException e) {}
434         verify(obj, times(1)).getMaxConnections();
435     }
436 
437     @Test
438     public void testGetMaxCursorNameLength() throws Exception {
439         try {
440             delegate.getMaxCursorNameLength();
441         } catch (final SQLException e) {}
442         verify(obj, times(1)).getMaxCursorNameLength();
443     }
444 
445     @Test
446     public void testGetMaxIndexLength() throws Exception {
447         try {
448             delegate.getMaxIndexLength();
449         } catch (final SQLException e) {}
450         verify(obj, times(1)).getMaxIndexLength();
451     }
452 
453     @Test
454     public void testGetMaxLogicalLobSize() throws Exception {
455         try {
456             delegate.getMaxLogicalLobSize();
457         } catch (final SQLException e) {}
458         verify(obj, times(1)).getMaxLogicalLobSize();
459     }
460 
461     @Test
462     public void testGetMaxProcedureNameLength() throws Exception {
463         try {
464             delegate.getMaxProcedureNameLength();
465         } catch (final SQLException e) {}
466         verify(obj, times(1)).getMaxProcedureNameLength();
467     }
468 
469     @Test
470     public void testGetMaxRowSize() throws Exception {
471         try {
472             delegate.getMaxRowSize();
473         } catch (final SQLException e) {}
474         verify(obj, times(1)).getMaxRowSize();
475     }
476 
477     @Test
478     public void testGetMaxSchemaNameLength() throws Exception {
479         try {
480             delegate.getMaxSchemaNameLength();
481         } catch (final SQLException e) {}
482         verify(obj, times(1)).getMaxSchemaNameLength();
483     }
484 
485     @Test
486     public void testGetMaxStatementLength() throws Exception {
487         try {
488             delegate.getMaxStatementLength();
489         } catch (final SQLException e) {}
490         verify(obj, times(1)).getMaxStatementLength();
491     }
492 
493     @Test
494     public void testGetMaxStatements() throws Exception {
495         try {
496             delegate.getMaxStatements();
497         } catch (final SQLException e) {}
498         verify(obj, times(1)).getMaxStatements();
499     }
500 
501     @Test
502     public void testGetMaxTableNameLength() throws Exception {
503         try {
504             delegate.getMaxTableNameLength();
505         } catch (final SQLException e) {}
506         verify(obj, times(1)).getMaxTableNameLength();
507     }
508 
509     @Test
510     public void testGetMaxTablesInSelect() throws Exception {
511         try {
512             delegate.getMaxTablesInSelect();
513         } catch (final SQLException e) {}
514         verify(obj, times(1)).getMaxTablesInSelect();
515     }
516 
517     @Test
518     public void testGetMaxUserNameLength() throws Exception {
519         try {
520             delegate.getMaxUserNameLength();
521         } catch (final SQLException e) {}
522         verify(obj, times(1)).getMaxUserNameLength();
523     }
524 
525     @Test
526     public void testGetNumericFunctions() throws Exception {
527         try {
528             delegate.getNumericFunctions();
529         } catch (final SQLException e) {}
530         verify(obj, times(1)).getNumericFunctions();
531     }
532 
533     @Test
534     public void testGetPrimaryKeysStringStringString() throws Exception {
535         try {
536             delegate.getPrimaryKeys("foo","foo","foo");
537         } catch (final SQLException e) {}
538         verify(obj, times(1)).getPrimaryKeys("foo","foo","foo");
539     }
540 
541     @Test
542     public void testGetProcedureColumnsStringStringStringString() throws Exception {
543         try {
544             delegate.getProcedureColumns("foo","foo","foo","foo");
545         } catch (final SQLException e) {}
546         verify(obj, times(1)).getProcedureColumns("foo","foo","foo","foo");
547     }
548 
549     @Test
550     public void testGetProceduresStringStringString() throws Exception {
551         try {
552             delegate.getProcedures("foo","foo","foo");
553         } catch (final SQLException e) {}
554         verify(obj, times(1)).getProcedures("foo","foo","foo");
555     }
556 
557     @Test
558     public void testGetProcedureTerm() throws Exception {
559         try {
560             delegate.getProcedureTerm();
561         } catch (final SQLException e) {}
562         verify(obj, times(1)).getProcedureTerm();
563     }
564 
565     @Test
566     public void testGetPseudoColumnsStringStringStringString() throws Exception {
567         try {
568             delegate.getPseudoColumns("foo","foo","foo","foo");
569         } catch (final SQLException e) {}
570         verify(obj, times(1)).getPseudoColumns("foo","foo","foo","foo");
571     }
572 
573     @Test
574     public void testGetResultSetHoldability() throws Exception {
575         try {
576             delegate.getResultSetHoldability();
577         } catch (final SQLException e) {}
578         verify(obj, times(1)).getResultSetHoldability();
579     }
580 
581     @Test
582     public void testGetRowIdLifetime() throws Exception {
583         try {
584             delegate.getRowIdLifetime();
585         } catch (final SQLException e) {}
586         verify(obj, times(1)).getRowIdLifetime();
587     }
588 
589     @Test
590     public void testGetSchemas() throws Exception {
591         try {
592             delegate.getSchemas();
593         } catch (final SQLException e) {}
594         verify(obj, times(1)).getSchemas();
595     }
596 
597     @Test
598     public void testGetSchemasStringString() throws Exception {
599         try {
600             delegate.getSchemas("foo","foo");
601         } catch (final SQLException e) {}
602         verify(obj, times(1)).getSchemas("foo","foo");
603     }
604 
605     @Test
606     public void testGetSchemaTerm() throws Exception {
607         try {
608             delegate.getSchemaTerm();
609         } catch (final SQLException e) {}
610         verify(obj, times(1)).getSchemaTerm();
611     }
612 
613     @Test
614     public void testGetSearchStringEscape() throws Exception {
615         try {
616             delegate.getSearchStringEscape();
617         } catch (final SQLException e) {}
618         verify(obj, times(1)).getSearchStringEscape();
619     }
620 
621     @Test
622     public void testGetSQLKeywords() throws Exception {
623         try {
624             delegate.getSQLKeywords();
625         } catch (final SQLException e) {}
626         verify(obj, times(1)).getSQLKeywords();
627     }
628 
629     @Test
630     public void testGetSQLStateType() throws Exception {
631         try {
632             delegate.getSQLStateType();
633         } catch (final SQLException e) {}
634         verify(obj, times(1)).getSQLStateType();
635     }
636 
637     @Test
638     public void testGetStringFunctions() throws Exception {
639         try {
640             delegate.getStringFunctions();
641         } catch (final SQLException e) {}
642         verify(obj, times(1)).getStringFunctions();
643     }
644 
645     @Test
646     public void testGetSuperTablesStringStringString() throws Exception {
647         try {
648             delegate.getSuperTables("foo","foo","foo");
649         } catch (final SQLException e) {}
650         verify(obj, times(1)).getSuperTables("foo","foo","foo");
651     }
652 
653     @Test
654     public void testGetSuperTypesStringStringString() throws Exception {
655         try {
656             delegate.getSuperTypes("foo","foo","foo");
657         } catch (final SQLException e) {}
658         verify(obj, times(1)).getSuperTypes("foo","foo","foo");
659     }
660 
661     @Test
662     public void testGetSystemFunctions() throws Exception {
663         try {
664             delegate.getSystemFunctions();
665         } catch (final SQLException e) {}
666         verify(obj, times(1)).getSystemFunctions();
667     }
668 
669     @Test
670     public void testGetTablePrivilegesStringStringString() throws Exception {
671         try {
672             delegate.getTablePrivileges("foo","foo","foo");
673         } catch (final SQLException e) {}
674         verify(obj, times(1)).getTablePrivileges("foo","foo","foo");
675     }
676 
677     @Test
678     public void testGetTablesStringStringStringStringArray() throws Exception {
679         try {
680             delegate.getTables("foo","foo","foo",(String[]) null);
681         } catch (final SQLException e) {}
682         verify(obj, times(1)).getTables("foo","foo","foo",(String[]) null);
683     }
684 
685     @Test
686     public void testGetTableTypes() throws Exception {
687         try {
688             delegate.getTableTypes();
689         } catch (final SQLException e) {}
690         verify(obj, times(1)).getTableTypes();
691     }
692 
693     @Test
694     public void testGetTimeDateFunctions() throws Exception {
695         try {
696             delegate.getTimeDateFunctions();
697         } catch (final SQLException e) {}
698         verify(obj, times(1)).getTimeDateFunctions();
699     }
700 
701     @Test
702     public void testGetTypeInfo() throws Exception {
703         try {
704             delegate.getTypeInfo();
705         } catch (final SQLException e) {}
706         verify(obj, times(1)).getTypeInfo();
707     }
708 
709     @Test
710     public void testGetUDTsStringStringStringIntegerArray() throws Exception {
711         try {
712             delegate.getUDTs("foo","foo","foo",(int[]) null);
713         } catch (final SQLException e) {}
714         verify(obj, times(1)).getUDTs("foo","foo","foo",(int[]) null);
715     }
716 
717     @Test
718     public void testGetURL() throws Exception {
719         try {
720             delegate.getURL();
721         } catch (final SQLException e) {}
722         verify(obj, times(1)).getURL();
723     }
724 
725     @Test
726     public void testGetUserName() throws Exception {
727         try {
728             delegate.getUserName();
729         } catch (final SQLException e) {}
730         verify(obj, times(1)).getUserName();
731     }
732 
733     @Test
734     public void testGetVersionColumnsStringStringString() throws Exception {
735         try {
736             delegate.getVersionColumns("foo","foo","foo");
737         } catch (final SQLException e) {}
738         verify(obj, times(1)).getVersionColumns("foo","foo","foo");
739     }
740 
741     @Test
742     public void testInsertsAreDetectedInteger() throws Exception {
743         try {
744             delegate.insertsAreDetected(1);
745         } catch (final SQLException e) {}
746         verify(obj, times(1)).insertsAreDetected(1);
747     }
748 
749     @Test
750     public void testIsCatalogAtStart() throws Exception {
751         try {
752             delegate.isCatalogAtStart();
753         } catch (final SQLException e) {}
754         verify(obj, times(1)).isCatalogAtStart();
755     }
756 
757     @Test
758     public void testIsReadOnly() throws Exception {
759         try {
760             delegate.isReadOnly();
761         } catch (final SQLException e) {}
762         verify(obj, times(1)).isReadOnly();
763     }
764 
765     @Test
766     public void testLocatorsUpdateCopy() throws Exception {
767         try {
768             delegate.locatorsUpdateCopy();
769         } catch (final SQLException e) {}
770         verify(obj, times(1)).locatorsUpdateCopy();
771     }
772 
773     @Test
774     public void testNullArguments() throws Exception {
775         assertThrows(NullPointerException.class, () -> {
776             new DelegatingDatabaseMetaData(null, null);
777         });
778         assertThrows(NullPointerException.class, () -> {
779             new DelegatingDatabaseMetaData(new DelegatingConnection(null), null);
780         });
781     }
782 
783     @Test
784     public void testNullPlusNonNullIsNull() throws Exception {
785         try {
786             delegate.nullPlusNonNullIsNull();
787         } catch (final SQLException e) {}
788         verify(obj, times(1)).nullPlusNonNullIsNull();
789     }
790 
791     @Test
792     public void testNullsAreSortedAtEnd() throws Exception {
793         try {
794             delegate.nullsAreSortedAtEnd();
795         } catch (final SQLException e) {}
796         verify(obj, times(1)).nullsAreSortedAtEnd();
797     }
798 
799     @Test
800     public void testNullsAreSortedAtStart() throws Exception {
801         try {
802             delegate.nullsAreSortedAtStart();
803         } catch (final SQLException e) {}
804         verify(obj, times(1)).nullsAreSortedAtStart();
805     }
806 
807     @Test
808     public void testNullsAreSortedHigh() throws Exception {
809         try {
810             delegate.nullsAreSortedHigh();
811         } catch (final SQLException e) {}
812         verify(obj, times(1)).nullsAreSortedHigh();
813     }
814 
815     @Test
816     public void testNullsAreSortedLow() throws Exception {
817         try {
818             delegate.nullsAreSortedLow();
819         } catch (final SQLException e) {}
820         verify(obj, times(1)).nullsAreSortedLow();
821     }
822 
823     @Test
824     public void testOthersDeletesAreVisibleInteger() throws Exception {
825         try {
826             delegate.othersDeletesAreVisible(1);
827         } catch (final SQLException e) {}
828         verify(obj, times(1)).othersDeletesAreVisible(1);
829     }
830 
831     @Test
832     public void testOthersInsertsAreVisibleInteger() throws Exception {
833         try {
834             delegate.othersInsertsAreVisible(1);
835         } catch (final SQLException e) {}
836         verify(obj, times(1)).othersInsertsAreVisible(1);
837     }
838 
839     @Test
840     public void testOthersUpdatesAreVisibleInteger() throws Exception {
841         try {
842             delegate.othersUpdatesAreVisible(1);
843         } catch (final SQLException e) {}
844         verify(obj, times(1)).othersUpdatesAreVisible(1);
845     }
846 
847     @Test
848     public void testOwnDeletesAreVisibleInteger() throws Exception {
849         try {
850             delegate.ownDeletesAreVisible(1);
851         } catch (final SQLException e) {}
852         verify(obj, times(1)).ownDeletesAreVisible(1);
853     }
854 
855     @Test
856     public void testOwnInsertsAreVisibleInteger() throws Exception {
857         try {
858             delegate.ownInsertsAreVisible(1);
859         } catch (final SQLException e) {}
860         verify(obj, times(1)).ownInsertsAreVisible(1);
861     }
862 
863     @Test
864     public void testOwnUpdatesAreVisibleInteger() throws Exception {
865         try {
866             delegate.ownUpdatesAreVisible(1);
867         } catch (final SQLException e) {}
868         verify(obj, times(1)).ownUpdatesAreVisible(1);
869     }
870 
871     @Test
872     public void testStoresLowerCaseIdentifiers() throws Exception {
873         try {
874             delegate.storesLowerCaseIdentifiers();
875         } catch (final SQLException e) {}
876         verify(obj, times(1)).storesLowerCaseIdentifiers();
877     }
878 
879     @Test
880     public void testStoresLowerCaseQuotedIdentifiers() throws Exception {
881         try {
882             delegate.storesLowerCaseQuotedIdentifiers();
883         } catch (final SQLException e) {}
884         verify(obj, times(1)).storesLowerCaseQuotedIdentifiers();
885     }
886 
887     @Test
888     public void testStoresMixedCaseIdentifiers() throws Exception {
889         try {
890             delegate.storesMixedCaseIdentifiers();
891         } catch (final SQLException e) {}
892         verify(obj, times(1)).storesMixedCaseIdentifiers();
893     }
894 
895     @Test
896     public void testStoresMixedCaseQuotedIdentifiers() throws Exception {
897         try {
898             delegate.storesMixedCaseQuotedIdentifiers();
899         } catch (final SQLException e) {}
900         verify(obj, times(1)).storesMixedCaseQuotedIdentifiers();
901     }
902 
903     @Test
904     public void testStoresUpperCaseIdentifiers() throws Exception {
905         try {
906             delegate.storesUpperCaseIdentifiers();
907         } catch (final SQLException e) {}
908         verify(obj, times(1)).storesUpperCaseIdentifiers();
909     }
910 
911     @Test
912     public void testStoresUpperCaseQuotedIdentifiers() throws Exception {
913         try {
914             delegate.storesUpperCaseQuotedIdentifiers();
915         } catch (final SQLException e) {}
916         verify(obj, times(1)).storesUpperCaseQuotedIdentifiers();
917     }
918 
919     @Test
920     public void testSupportsAlterTableWithAddColumn() throws Exception {
921         try {
922             delegate.supportsAlterTableWithAddColumn();
923         } catch (final SQLException e) {}
924         verify(obj, times(1)).supportsAlterTableWithAddColumn();
925     }
926 
927     @Test
928     public void testSupportsAlterTableWithDropColumn() throws Exception {
929         try {
930             delegate.supportsAlterTableWithDropColumn();
931         } catch (final SQLException e) {}
932         verify(obj, times(1)).supportsAlterTableWithDropColumn();
933     }
934 
935     @Test
936     public void testSupportsANSI92EntryLevelSQL() throws Exception {
937         try {
938             delegate.supportsANSI92EntryLevelSQL();
939         } catch (final SQLException e) {}
940         verify(obj, times(1)).supportsANSI92EntryLevelSQL();
941     }
942 
943     @Test
944     public void testSupportsANSI92FullSQL() throws Exception {
945         try {
946             delegate.supportsANSI92FullSQL();
947         } catch (final SQLException e) {}
948         verify(obj, times(1)).supportsANSI92FullSQL();
949     }
950 
951     @Test
952     public void testSupportsANSI92IntermediateSQL() throws Exception {
953         try {
954             delegate.supportsANSI92IntermediateSQL();
955         } catch (final SQLException e) {}
956         verify(obj, times(1)).supportsANSI92IntermediateSQL();
957     }
958 
959     @Test
960     public void testSupportsBatchUpdates() throws Exception {
961         try {
962             delegate.supportsBatchUpdates();
963         } catch (final SQLException e) {}
964         verify(obj, times(1)).supportsBatchUpdates();
965     }
966 
967     @Test
968     public void testSupportsCatalogsInDataManipulation() throws Exception {
969         try {
970             delegate.supportsCatalogsInDataManipulation();
971         } catch (final SQLException e) {}
972         verify(obj, times(1)).supportsCatalogsInDataManipulation();
973     }
974 
975     @Test
976     public void testSupportsCatalogsInIndexDefinitions() throws Exception {
977         try {
978             delegate.supportsCatalogsInIndexDefinitions();
979         } catch (final SQLException e) {}
980         verify(obj, times(1)).supportsCatalogsInIndexDefinitions();
981     }
982 
983     @Test
984     public void testSupportsCatalogsInPrivilegeDefinitions() throws Exception {
985         try {
986             delegate.supportsCatalogsInPrivilegeDefinitions();
987         } catch (final SQLException e) {}
988         verify(obj, times(1)).supportsCatalogsInPrivilegeDefinitions();
989     }
990 
991     @Test
992     public void testSupportsCatalogsInProcedureCalls() throws Exception {
993         try {
994             delegate.supportsCatalogsInProcedureCalls();
995         } catch (final SQLException e) {}
996         verify(obj, times(1)).supportsCatalogsInProcedureCalls();
997     }
998 
999     @Test
1000     public void testSupportsCatalogsInTableDefinitions() throws Exception {
1001         try {
1002             delegate.supportsCatalogsInTableDefinitions();
1003         } catch (final SQLException e) {}
1004         verify(obj, times(1)).supportsCatalogsInTableDefinitions();
1005     }
1006 
1007     @Test
1008     public void testSupportsColumnAliasing() throws Exception {
1009         try {
1010             delegate.supportsColumnAliasing();
1011         } catch (final SQLException e) {}
1012         verify(obj, times(1)).supportsColumnAliasing();
1013     }
1014 
1015     @Test
1016     public void testSupportsConvert() throws Exception {
1017         try {
1018             delegate.supportsConvert();
1019         } catch (final SQLException e) {}
1020         verify(obj, times(1)).supportsConvert();
1021     }
1022 
1023     @Test
1024     public void testSupportsConvertIntegerInteger() throws Exception {
1025         try {
1026             delegate.supportsConvert(1,1);
1027         } catch (final SQLException e) {}
1028         verify(obj, times(1)).supportsConvert(1,1);
1029     }
1030 
1031     @Test
1032     public void testSupportsCoreSQLGrammar() throws Exception {
1033         try {
1034             delegate.supportsCoreSQLGrammar();
1035         } catch (final SQLException e) {}
1036         verify(obj, times(1)).supportsCoreSQLGrammar();
1037     }
1038 
1039     @Test
1040     public void testSupportsCorrelatedSubqueries() throws Exception {
1041         try {
1042             delegate.supportsCorrelatedSubqueries();
1043         } catch (final SQLException e) {}
1044         verify(obj, times(1)).supportsCorrelatedSubqueries();
1045     }
1046 
1047     @Test
1048     public void testSupportsDataDefinitionAndDataManipulationTransactions() throws Exception {
1049         try {
1050             delegate.supportsDataDefinitionAndDataManipulationTransactions();
1051         } catch (final SQLException e) {}
1052         verify(obj, times(1)).supportsDataDefinitionAndDataManipulationTransactions();
1053     }
1054 
1055     @Test
1056     public void testSupportsDataManipulationTransactionsOnly() throws Exception {
1057         try {
1058             delegate.supportsDataManipulationTransactionsOnly();
1059         } catch (final SQLException e) {}
1060         verify(obj, times(1)).supportsDataManipulationTransactionsOnly();
1061     }
1062 
1063     @Test
1064     public void testSupportsDifferentTableCorrelationNames() throws Exception {
1065         try {
1066             delegate.supportsDifferentTableCorrelationNames();
1067         } catch (final SQLException e) {}
1068         verify(obj, times(1)).supportsDifferentTableCorrelationNames();
1069     }
1070 
1071     @Test
1072     public void testSupportsExpressionsInOrderBy() throws Exception {
1073         try {
1074             delegate.supportsExpressionsInOrderBy();
1075         } catch (final SQLException e) {}
1076         verify(obj, times(1)).supportsExpressionsInOrderBy();
1077     }
1078 
1079     @Test
1080     public void testSupportsExtendedSQLGrammar() throws Exception {
1081         try {
1082             delegate.supportsExtendedSQLGrammar();
1083         } catch (final SQLException e) {}
1084         verify(obj, times(1)).supportsExtendedSQLGrammar();
1085     }
1086 
1087     @Test
1088     public void testSupportsFullOuterJoins() throws Exception {
1089         try {
1090             delegate.supportsFullOuterJoins();
1091         } catch (final SQLException e) {}
1092         verify(obj, times(1)).supportsFullOuterJoins();
1093     }
1094 
1095     @Test
1096     public void testSupportsGetGeneratedKeys() throws Exception {
1097         try {
1098             delegate.supportsGetGeneratedKeys();
1099         } catch (final SQLException e) {}
1100         verify(obj, times(1)).supportsGetGeneratedKeys();
1101     }
1102 
1103     @Test
1104     public void testSupportsGroupBy() throws Exception {
1105         try {
1106             delegate.supportsGroupBy();
1107         } catch (final SQLException e) {}
1108         verify(obj, times(1)).supportsGroupBy();
1109     }
1110 
1111     @Test
1112     public void testSupportsGroupByBeyondSelect() throws Exception {
1113         try {
1114             delegate.supportsGroupByBeyondSelect();
1115         } catch (final SQLException e) {}
1116         verify(obj, times(1)).supportsGroupByBeyondSelect();
1117     }
1118 
1119     @Test
1120     public void testSupportsGroupByUnrelated() throws Exception {
1121         try {
1122             delegate.supportsGroupByUnrelated();
1123         } catch (final SQLException e) {}
1124         verify(obj, times(1)).supportsGroupByUnrelated();
1125     }
1126 
1127     @Test
1128     public void testSupportsIntegrityEnhancementFacility() throws Exception {
1129         try {
1130             delegate.supportsIntegrityEnhancementFacility();
1131         } catch (final SQLException e) {}
1132         verify(obj, times(1)).supportsIntegrityEnhancementFacility();
1133     }
1134 
1135     @Test
1136     public void testSupportsLikeEscapeClause() throws Exception {
1137         try {
1138             delegate.supportsLikeEscapeClause();
1139         } catch (final SQLException e) {}
1140         verify(obj, times(1)).supportsLikeEscapeClause();
1141     }
1142 
1143     @Test
1144     public void testSupportsLimitedOuterJoins() throws Exception {
1145         try {
1146             delegate.supportsLimitedOuterJoins();
1147         } catch (final SQLException e) {}
1148         verify(obj, times(1)).supportsLimitedOuterJoins();
1149     }
1150 
1151     @Test
1152     public void testSupportsMinimumSQLGrammar() throws Exception {
1153         try {
1154             delegate.supportsMinimumSQLGrammar();
1155         } catch (final SQLException e) {}
1156         verify(obj, times(1)).supportsMinimumSQLGrammar();
1157     }
1158 
1159     @Test
1160     public void testSupportsMixedCaseIdentifiers() throws Exception {
1161         try {
1162             delegate.supportsMixedCaseIdentifiers();
1163         } catch (final SQLException e) {}
1164         verify(obj, times(1)).supportsMixedCaseIdentifiers();
1165     }
1166 
1167     @Test
1168     public void testSupportsMixedCaseQuotedIdentifiers() throws Exception {
1169         try {
1170             delegate.supportsMixedCaseQuotedIdentifiers();
1171         } catch (final SQLException e) {}
1172         verify(obj, times(1)).supportsMixedCaseQuotedIdentifiers();
1173     }
1174 
1175     @Test
1176     public void testSupportsMultipleOpenResults() throws Exception {
1177         try {
1178             delegate.supportsMultipleOpenResults();
1179         } catch (final SQLException e) {}
1180         verify(obj, times(1)).supportsMultipleOpenResults();
1181     }
1182 
1183     @Test
1184     public void testSupportsMultipleResultSets() throws Exception {
1185         try {
1186             delegate.supportsMultipleResultSets();
1187         } catch (final SQLException e) {}
1188         verify(obj, times(1)).supportsMultipleResultSets();
1189     }
1190 
1191     @Test
1192     public void testSupportsMultipleTransactions() throws Exception {
1193         try {
1194             delegate.supportsMultipleTransactions();
1195         } catch (final SQLException e) {}
1196         verify(obj, times(1)).supportsMultipleTransactions();
1197     }
1198 
1199     @Test
1200     public void testSupportsNamedParameters() throws Exception {
1201         try {
1202             delegate.supportsNamedParameters();
1203         } catch (final SQLException e) {}
1204         verify(obj, times(1)).supportsNamedParameters();
1205     }
1206 
1207     @Test
1208     public void testSupportsNonNullableColumns() throws Exception {
1209         try {
1210             delegate.supportsNonNullableColumns();
1211         } catch (final SQLException e) {}
1212         verify(obj, times(1)).supportsNonNullableColumns();
1213     }
1214 
1215     @Test
1216     public void testSupportsOpenCursorsAcrossCommit() throws Exception {
1217         try {
1218             delegate.supportsOpenCursorsAcrossCommit();
1219         } catch (final SQLException e) {}
1220         verify(obj, times(1)).supportsOpenCursorsAcrossCommit();
1221     }
1222 
1223     @Test
1224     public void testSupportsOpenCursorsAcrossRollback() throws Exception {
1225         try {
1226             delegate.supportsOpenCursorsAcrossRollback();
1227         } catch (final SQLException e) {}
1228         verify(obj, times(1)).supportsOpenCursorsAcrossRollback();
1229     }
1230 
1231     @Test
1232     public void testSupportsOpenStatementsAcrossCommit() throws Exception {
1233         try {
1234             delegate.supportsOpenStatementsAcrossCommit();
1235         } catch (final SQLException e) {}
1236         verify(obj, times(1)).supportsOpenStatementsAcrossCommit();
1237     }
1238 
1239     @Test
1240     public void testSupportsOpenStatementsAcrossRollback() throws Exception {
1241         try {
1242             delegate.supportsOpenStatementsAcrossRollback();
1243         } catch (final SQLException e) {}
1244         verify(obj, times(1)).supportsOpenStatementsAcrossRollback();
1245     }
1246 
1247     @Test
1248     public void testSupportsOrderByUnrelated() throws Exception {
1249         try {
1250             delegate.supportsOrderByUnrelated();
1251         } catch (final SQLException e) {}
1252         verify(obj, times(1)).supportsOrderByUnrelated();
1253     }
1254 
1255     @Test
1256     public void testSupportsOuterJoins() throws Exception {
1257         try {
1258             delegate.supportsOuterJoins();
1259         } catch (final SQLException e) {}
1260         verify(obj, times(1)).supportsOuterJoins();
1261     }
1262 
1263     @Test
1264     public void testSupportsPositionedDelete() throws Exception {
1265         try {
1266             delegate.supportsPositionedDelete();
1267         } catch (final SQLException e) {}
1268         verify(obj, times(1)).supportsPositionedDelete();
1269     }
1270 
1271     @Test
1272     public void testSupportsPositionedUpdate() throws Exception {
1273         try {
1274             delegate.supportsPositionedUpdate();
1275         } catch (final SQLException e) {}
1276         verify(obj, times(1)).supportsPositionedUpdate();
1277     }
1278 
1279     @Test
1280     public void testSupportsRefCursors() throws Exception {
1281         try {
1282             delegate.supportsRefCursors();
1283         } catch (final SQLException e) {}
1284         verify(obj, times(1)).supportsRefCursors();
1285     }
1286 
1287     @Test
1288     public void testSupportsResultSetConcurrencyIntegerInteger() throws Exception {
1289         try {
1290             delegate.supportsResultSetConcurrency(1,1);
1291         } catch (final SQLException e) {}
1292         verify(obj, times(1)).supportsResultSetConcurrency(1,1);
1293     }
1294 
1295     @Test
1296     public void testSupportsResultSetHoldabilityInteger() throws Exception {
1297         try {
1298             delegate.supportsResultSetHoldability(1);
1299         } catch (final SQLException e) {}
1300         verify(obj, times(1)).supportsResultSetHoldability(1);
1301     }
1302 
1303     @Test
1304     public void testSupportsResultSetTypeInteger() throws Exception {
1305         try {
1306             delegate.supportsResultSetType(1);
1307         } catch (final SQLException e) {}
1308         verify(obj, times(1)).supportsResultSetType(1);
1309     }
1310 
1311     @Test
1312     public void testSupportsSavepoints() throws Exception {
1313         try {
1314             delegate.supportsSavepoints();
1315         } catch (final SQLException e) {}
1316         verify(obj, times(1)).supportsSavepoints();
1317     }
1318 
1319     @Test
1320     public void testSupportsSchemasInDataManipulation() throws Exception {
1321         try {
1322             delegate.supportsSchemasInDataManipulation();
1323         } catch (final SQLException e) {}
1324         verify(obj, times(1)).supportsSchemasInDataManipulation();
1325     }
1326 
1327     @Test
1328     public void testSupportsSchemasInIndexDefinitions() throws Exception {
1329         try {
1330             delegate.supportsSchemasInIndexDefinitions();
1331         } catch (final SQLException e) {}
1332         verify(obj, times(1)).supportsSchemasInIndexDefinitions();
1333     }
1334 
1335     @Test
1336     public void testSupportsSchemasInPrivilegeDefinitions() throws Exception {
1337         try {
1338             delegate.supportsSchemasInPrivilegeDefinitions();
1339         } catch (final SQLException e) {}
1340         verify(obj, times(1)).supportsSchemasInPrivilegeDefinitions();
1341     }
1342 
1343     @Test
1344     public void testSupportsSchemasInProcedureCalls() throws Exception {
1345         try {
1346             delegate.supportsSchemasInProcedureCalls();
1347         } catch (final SQLException e) {}
1348         verify(obj, times(1)).supportsSchemasInProcedureCalls();
1349     }
1350 
1351     @Test
1352     public void testSupportsSchemasInTableDefinitions() throws Exception {
1353         try {
1354             delegate.supportsSchemasInTableDefinitions();
1355         } catch (final SQLException e) {}
1356         verify(obj, times(1)).supportsSchemasInTableDefinitions();
1357     }
1358 
1359     @Test
1360     public void testSupportsSelectForUpdate() throws Exception {
1361         try {
1362             delegate.supportsSelectForUpdate();
1363         } catch (final SQLException e) {}
1364         verify(obj, times(1)).supportsSelectForUpdate();
1365     }
1366 
1367     @Test
1368     public void testSupportsStatementPooling() throws Exception {
1369         try {
1370             delegate.supportsStatementPooling();
1371         } catch (final SQLException e) {}
1372         verify(obj, times(1)).supportsStatementPooling();
1373     }
1374 
1375     @Test
1376     public void testSupportsStoredFunctionsUsingCallSyntax() throws Exception {
1377         try {
1378             delegate.supportsStoredFunctionsUsingCallSyntax();
1379         } catch (final SQLException e) {}
1380         verify(obj, times(1)).supportsStoredFunctionsUsingCallSyntax();
1381     }
1382 
1383     @Test
1384     public void testSupportsStoredProcedures() throws Exception {
1385         try {
1386             delegate.supportsStoredProcedures();
1387         } catch (final SQLException e) {}
1388         verify(obj, times(1)).supportsStoredProcedures();
1389     }
1390 
1391     @Test
1392     public void testSupportsSubqueriesInComparisons() throws Exception {
1393         try {
1394             delegate.supportsSubqueriesInComparisons();
1395         } catch (final SQLException e) {}
1396         verify(obj, times(1)).supportsSubqueriesInComparisons();
1397     }
1398 
1399     @Test
1400     public void testSupportsSubqueriesInExists() throws Exception {
1401         try {
1402             delegate.supportsSubqueriesInExists();
1403         } catch (final SQLException e) {}
1404         verify(obj, times(1)).supportsSubqueriesInExists();
1405     }
1406 
1407     @Test
1408     public void testSupportsSubqueriesInIns() throws Exception {
1409         try {
1410             delegate.supportsSubqueriesInIns();
1411         } catch (final SQLException e) {}
1412         verify(obj, times(1)).supportsSubqueriesInIns();
1413     }
1414 
1415     @Test
1416     public void testSupportsSubqueriesInQuantifieds() throws Exception {
1417         try {
1418             delegate.supportsSubqueriesInQuantifieds();
1419         } catch (final SQLException e) {}
1420         verify(obj, times(1)).supportsSubqueriesInQuantifieds();
1421     }
1422 
1423     @Test
1424     public void testSupportsTableCorrelationNames() throws Exception {
1425         try {
1426             delegate.supportsTableCorrelationNames();
1427         } catch (final SQLException e) {}
1428         verify(obj, times(1)).supportsTableCorrelationNames();
1429     }
1430 
1431     @Test
1432     public void testSupportsTransactionIsolationLevelInteger() throws Exception {
1433         try {
1434             delegate.supportsTransactionIsolationLevel(1);
1435         } catch (final SQLException e) {}
1436         verify(obj, times(1)).supportsTransactionIsolationLevel(1);
1437     }
1438 
1439     @Test
1440     public void testSupportsTransactions() throws Exception {
1441         try {
1442             delegate.supportsTransactions();
1443         } catch (final SQLException e) {}
1444         verify(obj, times(1)).supportsTransactions();
1445     }
1446 
1447     @Test
1448     public void testSupportsUnion() throws Exception {
1449         try {
1450             delegate.supportsUnion();
1451         } catch (final SQLException e) {}
1452         verify(obj, times(1)).supportsUnion();
1453     }
1454 
1455     @Test
1456     public void testSupportsUnionAll() throws Exception {
1457         try {
1458             delegate.supportsUnionAll();
1459         } catch (final SQLException e) {}
1460         verify(obj, times(1)).supportsUnionAll();
1461     }
1462 
1463     @Test
1464     public void testUpdatesAreDetectedInteger() throws Exception {
1465         try {
1466             delegate.updatesAreDetected(1);
1467         } catch (final SQLException e) {}
1468         verify(obj, times(1)).updatesAreDetected(1);
1469     }
1470 
1471     @Test
1472     public void testUsesLocalFilePerTable() throws Exception {
1473         try {
1474             delegate.usesLocalFilePerTable();
1475         } catch (final SQLException e) {}
1476         verify(obj, times(1)).usesLocalFilePerTable();
1477     }
1478 
1479     @Test
1480     public void testUsesLocalFiles() throws Exception {
1481         try {
1482             delegate.usesLocalFiles();
1483         } catch (final SQLException e) {}
1484         verify(obj, times(1)).usesLocalFiles();
1485     }
1486 
1487     @Test
1488     public void testWrap() throws SQLException {
1489         assertEquals(delegate, delegate.unwrap(DatabaseMetaData.class));
1490         assertEquals(delegate, delegate.unwrap(DelegatingDatabaseMetaData.class));
1491         assertEquals(obj, delegate.unwrap(obj.getClass()));
1492         assertNull(delegate.unwrap(String.class));
1493         assertTrue(delegate.isWrapperFor(DatabaseMetaData.class));
1494         assertTrue(delegate.isWrapperFor(DelegatingDatabaseMetaData.class));
1495         assertTrue(delegate.isWrapperFor(obj.getClass()));
1496         assertFalse(delegate.isWrapperFor(String.class));
1497     }
1498 }