1/*
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23package test.rowset;
24
25import java.io.InputStream;
26import java.io.Reader;
27import java.math.BigDecimal;
28import java.sql.Connection;
29import java.sql.Date;
30import java.sql.ResultSet;
31import java.sql.ResultSetMetaData;
32import java.sql.RowId;
33import java.sql.SQLException;
34import java.sql.SQLFeatureNotSupportedException;
35import java.sql.Time;
36import java.sql.Timestamp;
37import java.sql.Types;
38import java.time.LocalDate;
39import java.time.LocalDateTime;
40import java.time.LocalTime;
41import java.util.ArrayList;
42import java.util.Calendar;
43import java.util.HashMap;
44import java.util.List;
45import java.util.Map;
46import javax.sql.RowSet;
47import javax.sql.rowset.BaseRowSet;
48import javax.sql.rowset.CachedRowSet;
49import javax.sql.rowset.RowSetFactory;
50import javax.sql.rowset.RowSetMetaDataImpl;
51import javax.sql.rowset.RowSetProvider;
52import org.testng.Assert;
53import static org.testng.Assert.assertNull;
54import static org.testng.Assert.assertTrue;
55import org.testng.annotations.DataProvider;
56import org.testng.annotations.Test;
57import util.BaseTest;
58import util.StubBlob;
59import util.StubClob;
60import util.StubNClob;
61import util.StubSQLXML;
62
63public abstract class CommonRowSetTests extends BaseTest {
64
65    protected final String stubProvider = "util.StubSyncProvider";
66    protected final String query = "SELECT * FROM SUPERHEROS";
67    private final String url = "jdbc:derby://localhost:1527/myDB";
68    private final String dsName = "jdbc/myDB";
69    private final String user = "Bruce Wayne";
70    private final String password = "The Dark Knight";
71    protected final String COFFEE_HOUSES_TABLE = "COFFEE_HOUSES";
72    protected final String COFFEES_TABLE = "COFFEES";
73    protected final int COFFEE_HOUSES_ROWS = 14;
74    protected final int COFFEES_ROWS = 5;
75    protected final Object[] COFFEES_PRIMARY_KEYS = {1, 2, 3, 4, 5};
76    protected final Object[] COFFEE_HOUSES_PRIMARY_KEYS = {
77        10023, 33002, 10040, 32001, 10042, 10024, 10039, 10041,
78        33005, 33010, 10035, 10037, 10034, 32004
79    };
80
81    /*
82     * COFFEES_HOUSES Table column names
83     */
84    protected final String[] COFFEE_HOUSES_COLUMN_NAMES = {
85        "STORE_ID", "CITY", "COFFEE", "MERCH", "TOTAL"
86    };
87
88    /*
89     * COFFEES Table column names
90     */
91    protected final String[] COFFEES_COLUMN_NAMES = {
92        "COF_ID", "COF_NAME", "SUP_ID", "PRICE", "SALES", "TOTAL"
93    };
94
95    protected RowSetFactory rsf;
96
97    public CommonRowSetTests() {
98        try {
99            rsf = RowSetProvider.newFactory();
100        } catch (SQLException ex) {
101            Assert.fail(ex.getMessage());
102        }
103    }
104
105    // Create an instance of the RowSet we are using
106    protected abstract <T extends RowSet> T newInstance() throws SQLException;
107
108    //DataProvider to use for common tests
109
110    /*
111     * DataProvider used to specify the value to set and check for the
112     * methods for fetch direction
113     */
114    @DataProvider(name = "rowSetFetchDirection")
115    protected Object[][] rowSetFetchDirection() throws Exception {
116        RowSet rs = newInstance();
117        return new Object[][]{
118            {rs, ResultSet.FETCH_FORWARD},
119            {rs, ResultSet.FETCH_REVERSE},
120            {rs, ResultSet.FETCH_UNKNOWN}
121        };
122    }
123
124    /*
125     * DataProvider used to specify the value to set and check for the
126     * methods for Cursor Scroll Type
127     */
128    @DataProvider(name = "rowSetScrollTypes")
129    protected Object[][] rowSetScrollTypes() throws Exception {
130        RowSet rs = newInstance();
131
132        return new Object[][]{
133            {rs, ResultSet.TYPE_FORWARD_ONLY},
134            {rs, ResultSet.TYPE_SCROLL_INSENSITIVE},
135            {rs, ResultSet.TYPE_SCROLL_SENSITIVE}
136        };
137    }
138
139    /*
140     * DataProvider used to specify the value to set and check for
141     * methods using transaction isolation types
142     */
143    @DataProvider(name = "rowSetIsolationTypes")
144    protected Object[][] rowSetIsolationTypes() throws Exception {
145        RowSet rs = newInstance();
146
147        return new Object[][]{
148            {rs, Connection.TRANSACTION_NONE},
149            {rs, Connection.TRANSACTION_READ_COMMITTED},
150            {rs, Connection.TRANSACTION_READ_UNCOMMITTED},
151            {rs, Connection.TRANSACTION_REPEATABLE_READ},
152            {rs, Connection.TRANSACTION_SERIALIZABLE}
153        };
154    }
155
156    /*
157     * DataProvider used to specify the value to set and check for the
158     * methods for Concurrency
159     */
160    @DataProvider(name = "rowSetConcurrencyTypes")
161    protected Object[][] rowSetConcurrencyTypes() throws Exception {
162        RowSet rs = newInstance();
163        return new Object[][]{
164            {rs, ResultSet.CONCUR_READ_ONLY},
165            {rs, ResultSet.CONCUR_UPDATABLE}
166        };
167    }
168
169    /*
170     * DataProvider used to specify the value to set and check for
171     * methods using boolean values
172     */
173    @DataProvider(name = "rowSetTrueFalse")
174    protected Object[][] rowSetTrueFalse() throws Exception {
175        RowSet rs = newInstance();
176        return new Object[][]{
177            {rs, true},
178            {rs, false}
179        };
180    }
181    /*
182     * DataProvider used to specify the type of RowSet to use.  We also must
183     * initialize the RowSet
184     */
185    @DataProvider(name = "rowSetType")
186    protected Object[][] rowSetType() throws Exception {
187
188        RowSet rs = newInstance();
189        return new Object[][]{
190            {rs}
191        };
192    }
193
194    /*
195     * Initializes a RowSet containing the COFFEE_HOUSES data
196     */
197    protected <T extends RowSet> T createCoffeeHousesRowSet() throws SQLException {
198        T rs = (T) newInstance();
199        initCoffeeHousesMetaData((CachedRowSet) rs);
200        createCoffeeHouseRows(rs);
201        // Make sure you are not on the insertRow
202        rs.moveToCurrentRow();
203        return rs;
204    }
205
206    /*
207     * Initializes a RowSet containing the COFFEE_HOUSES data
208     */
209    protected <T extends RowSet> T createCoffeesRowSet() throws SQLException {
210        T rs = (T) newInstance();
211        initCoffeesMetaData((CachedRowSet) rs);
212        createCoffeesRows(rs);
213        // Make sure you are not on the insertRow
214        rs.moveToCurrentRow();
215        return rs;
216    }
217
218    /*
219     * Initializes the COFFEE_HOUSES metadata
220     */
221    private void initCoffeeHousesMetaData(CachedRowSet crs) throws SQLException {
222        RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
223        crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
224
225        /*
226         *  CREATE TABLE COFFEE_HOUSES(
227         *   STORE_ID Integer NOT NULL,
228         *   CITY VARCHAR(32),
229         *   COFFEE INTEGER NOT NULL,
230         *   MERCH INTEGER NOT NULL,
231         *   TOTAL INTEGER NOT NULL,
232         *   PRIMARY KEY (STORE_ID))
233         */
234        rsmd.setColumnCount(COFFEE_HOUSES_COLUMN_NAMES.length);
235        for(int i = 1; i <= COFFEE_HOUSES_COLUMN_NAMES.length; i++){
236            rsmd.setColumnName(i, COFFEE_HOUSES_COLUMN_NAMES[i-1]);
237            rsmd.setColumnLabel(i, rsmd.getColumnName(i));
238        }
239
240        rsmd.setColumnType(1, Types.INTEGER);
241        rsmd.setColumnType(2, Types.VARCHAR);
242        rsmd.setColumnType(3, Types.INTEGER);
243        rsmd.setColumnType(4, Types.INTEGER);
244        rsmd.setColumnType(5, Types.INTEGER);
245        crs.setMetaData(rsmd);
246        crs.setTableName(COFFEE_HOUSES_TABLE);
247
248    }
249
250    /*
251     * Add rows to COFFEE_HOUSES table
252     */
253    protected void createCoffeeHouseRows(RowSet rs) throws SQLException {
254
255        // insert into COFFEE_HOUSES values(10023, 'Mendocino', 3450, 2005, 5455)
256        rs.moveToInsertRow();
257        rs.updateInt(1, 10023);
258        rs.updateString(2, "Mendocino");
259        rs.updateInt(3, 3450);
260        rs.updateInt(4, 2005);
261        rs.updateInt(5, 5455);
262        rs.insertRow();
263        // insert into COFFEE_HOUSES values(33002, 'Seattle', 4699, 3109, 7808)
264        rs.moveToInsertRow();
265        rs.updateInt(1, 33002);
266        rs.updateString(2, "Seattle");
267        rs.updateInt(3, 4699);
268        rs.updateInt(4, 3109);
269        rs.updateInt(5, 7808);
270        rs.insertRow();
271        // insert into COFFEE_HOUSES values(10040, 'SF', 5386, 2841, 8227)
272        rs.moveToInsertRow();
273        rs.updateInt(1, 10040);
274        rs.updateString(2, "SF");
275        rs.updateInt(3, 5386);
276        rs.updateInt(4, 2841);
277        rs.updateInt(5, 8227);
278        rs.insertRow();
279        // insert into COFFEE_HOUSES values(32001, 'Portland', 3147, 3579, 6726)
280        rs.moveToInsertRow();
281        rs.updateInt(1, 32001);
282        rs.updateString(2, "Portland");
283        rs.updateInt(3, 3147);
284        rs.updateInt(4, 3579);
285        rs.updateInt(5, 6726);
286        rs.insertRow();
287        // insert into COFFEE_HOUSES values(10042, 'SF', 2863, 1874, 4710)
288        rs.moveToInsertRow();
289        rs.updateInt(1, 10042);
290        rs.updateString(2, "SF");
291        rs.updateInt(3, 2863);
292        rs.updateInt(4, 1874);
293        rs.updateInt(5, 4710);
294        rs.insertRow();
295        // insert into COFFEE_HOUSES values(10024, 'Sacramento', 1987, 2341, 4328)
296        rs.moveToInsertRow();
297        rs.updateInt(1, 10024);
298        rs.updateString(2, "Sacramento");
299        rs.updateInt(3, 1987);
300        rs.updateInt(4, 2341);
301        rs.updateInt(5, 4328);
302        rs.insertRow();
303        // insert into COFFEE_HOUSES values(10039, 'Carmel', 2691, 1121, 3812)
304        rs.moveToInsertRow();
305        rs.updateInt(1, 10039);
306        rs.updateString(2, "Carmel");
307        rs.updateInt(3, 2691);
308        rs.updateInt(4, 1121);
309        rs.updateInt(5, 3812);
310        rs.insertRow();
311        // insert into COFFEE_HOUSES values(10041, 'LA', 1533, 1007, 2540)
312        rs.moveToInsertRow();
313        rs.updateInt(1, 10041);
314        rs.updateString(2, "LA");
315        rs.updateInt(3, 1533);
316        rs.updateInt(4, 1007);
317        rs.updateInt(5, 2540);
318        rs.insertRow();
319        // insert into COFFEE_HOUSES values(33005, 'Olympia', 2733, 1550, 1550)
320        rs.moveToInsertRow();
321        rs.updateInt(1, 33005);
322        rs.updateString(2, "Olympia");
323        rs.updateInt(3, 2733);
324        rs.updateInt(4, 1550);
325        rs.updateInt(5, 1550);
326        rs.insertRow();
327        // insert into COFFEE_HOUSES values(33010, 'Seattle', 3210, 2177, 5387)
328        rs.moveToInsertRow();
329        rs.updateInt(1, 33010);
330        rs.updateString(2, "Seattle");
331        rs.updateInt(3, 3210);
332        rs.updateInt(4, 2177);
333        rs.updateInt(5, 5387);
334        rs.insertRow();
335        // insert into COFFEE_HOUSES values(10035, 'SF', 1922, 1056, 2978)
336        rs.moveToInsertRow();
337        rs.updateInt(1, 10035);
338        rs.updateString(2, "SF");
339        rs.updateInt(3, 1922);
340        rs.updateInt(4, 1056);
341        rs.updateInt(5, 2978);
342        rs.insertRow();
343        // insert into COFFEE_HOUSES values(10037, 'LA', 2143, 1876, 4019)
344        rs.moveToInsertRow();
345        rs.updateInt(1, 10037);
346        rs.updateString(2, "LA");
347        rs.updateInt(3, 2143);
348        rs.updateInt(4, 1876);
349        rs.updateInt(5, 4019);
350        rs.insertRow();
351        // insert into COFFEE_HOUSES values(10034, 'San_Jose', 1234, 1032, 2266)
352        rs.moveToInsertRow();
353        rs.updateInt(1, 10034);
354        rs.updateString(2, "San Jose");
355        rs.updateInt(3, 1234);
356        rs.updateInt(4, 1032);
357        rs.updateInt(5, 2266);
358        rs.insertRow();
359        // insert into COFFEE_HOUSES values(32004, 'Eugene', 1356, 1112, 2468)
360        rs.moveToInsertRow();
361        rs.updateInt(1, 32004);
362        rs.updateString(2, "Eugene");
363        rs.updateInt(3, 1356);
364        rs.updateInt(4, 1112);
365        rs.updateInt(5, 2468);
366        rs.insertRow();
367        rs.moveToCurrentRow();
368    }
369
370    /*
371     * Initializes the COFFEES metadata
372     */
373    protected void initCoffeesMetaData(CachedRowSet crs) throws SQLException {
374        RowSetMetaDataImpl rsmd = new RowSetMetaDataImpl();
375        crs.setType(RowSet.TYPE_SCROLL_INSENSITIVE);
376
377        /*
378         *  CREATE TABLE COFFEES (
379         *   COF_ID INTEGER NOT NULL,
380         *   COF_NAME VARCHAR(32) NOT NULL,
381         *   SUP_ID INTEGER NOT NULL,
382         *   PRICE NUMBERIC(10,2 NOT NULL,
383         *   SALES INTEGER NOT NULL,
384         *   TOTAL INTEGER NOT NULL,
385         *   PRIMARY KEY (COF_ID),
386         *   FOREIGN KEY (SUP_ID) REFERENCES SUPPLIERS (SUP_ID) )
387         */
388        rsmd.setColumnCount(COFFEES_COLUMN_NAMES.length);
389        for(int i = 1; i <= COFFEES_COLUMN_NAMES.length; i++){
390            rsmd.setColumnName(i, COFFEES_COLUMN_NAMES[i-1]);
391            rsmd.setColumnLabel(i, rsmd.getColumnName(i));
392        }
393
394        rsmd.setColumnType(1, Types.INTEGER);
395        rsmd.setColumnType(2, Types.VARCHAR);
396        rsmd.setColumnType(3, Types.INTEGER);
397        rsmd.setColumnType(4, Types.NUMERIC);
398        rsmd.setPrecision(4, 10);
399        rsmd.setScale(4, 2);
400        rsmd.setColumnType(5, Types.INTEGER);
401        rsmd.setColumnType(6, Types.INTEGER);
402        crs.setMetaData(rsmd);
403        crs.setTableName(COFFEES_TABLE);
404
405    }
406
407    /*
408     * Add rows to COFFEES table
409     */
410    protected void createCoffeesRows(RowSet rs) throws SQLException {
411
412        // insert into COFFEES values(1, 'Colombian', 101, 7.99, 0, 0)
413        rs.moveToInsertRow();
414        rs.updateInt(1, 1);
415        rs.updateString(2, "Colombian");
416        rs.updateInt(3, 101);
417        rs.updateBigDecimal(4, BigDecimal.valueOf(7.99));
418        rs.updateInt(5, 0);
419        rs.updateInt(6, 0);
420        rs.insertRow();
421        // insert into COFFEES values(2, 'French_Roast', 49, 8.99, 0, 0)
422        rs.moveToInsertRow();
423        rs.updateInt(1, 2);
424        rs.updateString(2, "French_Roast");
425        rs.updateInt(3, 49);
426        rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
427        rs.updateInt(5, 0);
428        rs.updateInt(6, 0);
429        rs.insertRow();
430        // insert into COFFEES values(3, 'Espresso', 150, 9.99, 0, 0)
431        rs.moveToInsertRow();
432        rs.updateInt(1, 3);
433        rs.updateString(2, "Espresso");
434        rs.updateInt(3, 150);
435        rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
436        rs.updateInt(5, 0);
437        rs.updateInt(6, 0);
438        rs.insertRow();
439        // insert into COFFEES values(4, 'Colombian_Decaf', 101, 8.99, 0, 0)
440        rs.moveToInsertRow();
441        rs.updateInt(1, 4);
442        rs.updateString(2, "Colombian_Decaf");
443        rs.updateInt(3, 101);
444        rs.updateBigDecimal(4, BigDecimal.valueOf(8.99));
445        rs.updateInt(5, 0);
446        rs.updateInt(6, 0);
447        rs.insertRow();
448        // insert into COFFEES values(5, 'French_Roast_Decaf', 049, 9.99, 0, 0)
449        rs.moveToInsertRow();
450        rs.updateInt(1, 5);
451        rs.updateString(2, "French_Roast_Decaf");
452        rs.updateInt(3, 49);
453        rs.updateBigDecimal(4, BigDecimal.valueOf(9.99));
454        rs.updateInt(5, 0);
455        rs.updateInt(6, 0);
456        rs.insertRow();
457
458    }
459
460
461    /*
462     * Utility method to return the Primary Keys for a RowSet.  The Primary
463     * keys are assumed to be in the first column of the RowSet
464     */
465    protected Object[] getPrimaryKeys(ResultSet rs) throws SQLException {
466        List<? super Object> result = new ArrayList<>();
467        if (rs == null) {
468            return null;
469        }
470        rs.beforeFirst();
471        while (rs.next()) {
472            result.add(rs.getInt(1));
473        }
474        return result.toArray();
475    }
476
477    /*
478     * Utility method to display the RowSet and will return the row count
479     * it found
480     */
481    protected int displayResults(ResultSet rs) throws SQLException {
482        int rows = 0;
483        ResultSetMetaData rsmd = rs.getMetaData();
484        int cols = rsmd.getColumnCount();
485        if (rs != null) {
486            rs.beforeFirst();
487            while (rs.next()) {
488                rows++;
489
490                for (int i = 0; i < cols; i++) {
491                    System.out.print(rs.getString(i + 1) + " ");
492                }
493                System.out.println();
494            }
495        }
496
497        return rows;
498    }
499
500
501     // Insert common tests here
502
503    /*
504     * Validate that getCommand() returns null by default
505     */
506    @Test(dataProvider = "rowSetType")
507    public void commonRowSetTest0000(RowSet rs) {
508        assertNull(rs.getCommand());
509    }
510
511    /*
512     * Validate that getCommand() returns command specified to setCommand
513     */
514    @Test(dataProvider = "rowSetType")
515    public void commonRowSetTest0001(RowSet rs) throws Exception {
516        rs.setCommand(query);
517        assertTrue(rs.getCommand().equals(query));
518    }
519
520
521    /*
522     * Validate that getCurrency() returns the correct default value
523     */
524    @Test(dataProvider = "rowSetType")
525    public void commonRowSetTest0002(RowSet rs) throws Exception {
526        assertTrue(rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE);
527    }
528
529    /*
530     * Validate that getCurrency() returns the correct value
531     * after a call to setConcurrency())
532     */
533    @Test(dataProvider = "rowSetConcurrencyTypes")
534    public void commonRowSetTest0003(RowSet rs, int concurType) throws Exception {
535        rs.setConcurrency(concurType);
536        assertTrue(rs.getConcurrency() == concurType);
537    }
538
539    /*
540     * Validate that getCurrency() throws a SQLException for an invalid value
541     */
542    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
543    public void commonRowSetTest0004(RowSet rs) throws Exception {
544        rs.setConcurrency(ResultSet.CLOSE_CURSORS_AT_COMMIT);
545    }
546
547    /*
548     * Validate that getDataSourceName() returns null by default
549     */
550    @Test(dataProvider = "rowSetType")
551    public void commonRowSetTest0005(RowSet rs) throws Exception {
552        assertTrue(rs.getDataSourceName() == null);
553    }
554
555    /*
556     * Validate that getDataSourceName() returns the value specified
557     * by setDataSourceName() and getUrl() returns null
558     */
559    @Test(dataProvider = "rowSetType")
560    public void commonRowSetTest0006(RowSet rs) throws Exception {
561        rs.setUrl(url);
562        rs.setDataSourceName(dsName);
563        assertTrue(rs.getDataSourceName().equals(dsName));
564        assertNull(rs.getUrl());
565    }
566
567    /*
568     * Validate that setDataSourceName() throws a SQLException for an empty
569     * String specified for the data source name
570     */
571    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
572    public void commonRowSetTest0007(RowSet rs) throws Exception {
573        String dsname = "";
574        rs.setDataSourceName(dsname);
575    }
576
577    /*
578     * Validate that getEscapeProcessing() returns false by default
579     */
580    @Test(dataProvider = "rowSetType")
581    public void commonRowSetTest0008(RowSet rs) throws Exception {
582        assertTrue(rs.getEscapeProcessing());
583    }
584
585    /*
586     * Validate that getEscapeProcessing() returns value set by
587     * setEscapeProcessing()
588     */
589    @Test(dataProvider = "rowSetTrueFalse")
590    public void commonRowSetTest0009(RowSet rs, boolean val) throws Exception {
591        rs.setEscapeProcessing(val);
592        assertTrue(rs.getEscapeProcessing() == val);
593    }
594
595    /*
596     * Validate that getFetchDirection() returns the correct default value
597     */
598    @Test(dataProvider = "rowSetType")
599    public void commonRowSetTest0010(RowSet rs) throws Exception {
600        assertTrue(rs.getFetchDirection() == ResultSet.FETCH_FORWARD);
601    }
602
603    /*
604     * Validate that getFetchDirection() returns the value set by
605     * setFetchDirection()
606     */
607    @Test(dataProvider = "rowSetFetchDirection")
608    public void commonRowSetTest0011(RowSet rs, int direction) throws Exception {
609        rs.setFetchDirection(direction);
610        assertTrue(rs.getFetchDirection() == direction);
611    }
612
613    /*
614     * Validate that setFetchSize() throws a SQLException for an invalid value
615     */
616    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
617    public void commonRowSetTest0013(RowSet rs) throws Exception {
618        rs.setFetchSize(-1);
619    }
620
621    /*
622     * Validate that setFetchSize() throws a SQLException for a
623     * value greater than getMaxRows()
624     */
625    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
626    public void commonRowSetTest0014(RowSet rs) throws Exception {
627        rs.setMaxRows(5);
628        rs.setFetchSize(rs.getMaxRows() + 1);
629    }
630
631    /*
632     * Validate that getFetchSize() returns the correct value after
633     * setFetchSize() has been called
634     */
635    @Test(dataProvider = "rowSetType")
636    public void commonRowSetTest0015(RowSet rs) throws Exception {
637        int maxRows = 150;
638        rs.setFetchSize(0);
639        assertTrue(rs.getFetchSize() == 0);
640        rs.setFetchSize(100);
641        assertTrue(rs.getFetchSize() == 100);
642        rs.setMaxRows(maxRows);
643        rs.setFetchSize(maxRows);
644        assertTrue(rs.getFetchSize() == maxRows);
645    }
646
647    /*
648     * Validate that setMaxFieldSize() throws a SQLException for an invalid value
649     */
650    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
651    public void commonRowSetTest0016(RowSet rs) throws Exception {
652        rs.setMaxFieldSize(-1);
653    }
654
655    /*
656     * Validate that getMaxFieldSize() returns the value set by
657     * setMaxFieldSize()
658     */
659    @Test(dataProvider = "rowSetType")
660    public void commonRowSetTest0017(RowSet rs) throws Exception {
661        rs.setMaxFieldSize(0);
662        assertTrue(rs.getMaxFieldSize() == 0);
663        rs.setMaxFieldSize(100);
664        assertTrue(rs.getMaxFieldSize() == 100);
665        rs.setMaxFieldSize(50);
666        assertTrue(rs.getMaxFieldSize() == 50);
667    }
668
669    /*
670     * Validate that isReadOnly() returns value set by
671     * setReadOnly()
672     */
673    @Test(dataProvider = "rowSetTrueFalse")
674    public void commonRowSetTest0018(RowSet rs, boolean val) throws Exception {
675        rs.setReadOnly(val);
676        assertTrue(rs.isReadOnly() == val);
677    }
678
679    /*
680     * Validate that getTransactionIsolation() returns value set by
681     * setTransactionIsolation()
682     */
683    @Test(dataProvider = "rowSetIsolationTypes")
684    public void commonRowSetTest0019(RowSet rs, int val) throws Exception {
685        rs.setTransactionIsolation(val);
686        assertTrue(rs.getTransactionIsolation() == val);
687    }
688
689    /*
690     * Validate that getType() returns value set by setType()
691     */
692    @Test(dataProvider = "rowSetScrollTypes")
693    public void commonRowSetTest0020(RowSet rs, int val) throws Exception {
694        rs.setType(val);
695        assertTrue(rs.getType() == val);
696    }
697
698    /*
699     * Validate that getEscapeProcessing() returns value set by
700     * setEscapeProcessing()
701     */
702    @Test(dataProvider = "rowSetTrueFalse")
703    public void commonRowSetTest0021(BaseRowSet rs, boolean val) throws Exception {
704        rs.setShowDeleted(val);
705        assertTrue(rs.getShowDeleted() == val);
706    }
707
708    /*
709     * Validate that getTypeMap() returns same value set by
710     * setTypeMap()
711     */
712    @Test(dataProvider = "rowSetType")
713    public void commonRowSetTest0022(RowSet rs) throws Exception {
714        Map<String, Class<?>> map = new HashMap<>();
715        map.put("SUPERHERO", Class.forName("util.SuperHero"));
716        rs.setTypeMap(map);
717        assertTrue(rs.getTypeMap().equals(map));
718    }
719
720    /*
721     * Validate that getUsername() returns same value set by
722     * setUsername()
723     */
724    @Test(dataProvider = "rowSetType")
725    public void commonRowSetTest0023(RowSet rs) throws Exception {
726        rs.setUsername(user);
727        assertTrue(rs.getUsername().equals(user));
728    }
729
730    /*
731     * Validate that getPassword() returns same password set by
732     * setPassword()
733     */
734    @Test(dataProvider = "rowSetType")
735    public void commonRowSetTest0024(RowSet rs) throws Exception {
736        rs.setPassword(password);
737        assertTrue(rs.getPassword().equals(password));
738    }
739
740    /*
741     * Validate that getQueryTimeout() returns same value set by
742     * setQueryTimeout() and that 0 is a valid timeout value
743     */
744    @Test(dataProvider = "rowSetType")
745    public void commonRowSetTest0025(RowSet rs) throws Exception {
746        int timeout = 0;
747        rs.setQueryTimeout(timeout);
748        assertTrue(rs.getQueryTimeout() == timeout);
749    }
750
751    /*
752     * Validate that getQueryTimeout() returns same value set by
753     * setQueryTimeout() and that 0 is a valid timeout value
754     */
755    @Test(dataProvider = "rowSetType")
756    public void commonRowSetTest0026(RowSet rs) throws Exception {
757        int timeout = 10000;
758        rs.setQueryTimeout(timeout);
759        assertTrue(rs.getQueryTimeout() == timeout);
760    }
761
762    /*
763     * Validate that setQueryTimeout() throws a SQLException for a timeout
764     * value < 0
765     */
766    @Test(dataProvider = "rowSetType", expectedExceptions = SQLException.class)
767    public void commonRowSetTest0027(RowSet rs) throws Exception {
768        rs.setQueryTimeout(-1);
769    }
770
771
772    /*
773     * Validate addRowSetListener does not throw an Exception when null is
774     * passed as the parameter
775     */
776    @Test(dataProvider = "rowSetType")
777    public void commonRowSetTest0028(RowSet rs) throws Exception {
778        rs.addRowSetListener(null);
779    }
780
781    /*
782     * Validate removeRowSetListener does not throw an Exception when null is
783     * passed as the parameter
784     */
785    @Test(dataProvider = "rowSetType")
786    public void commonRowSetTest0029(RowSet rs) throws Exception {
787        rs.removeRowSetListener(null);
788    }
789
790    /*
791     * Set two parameters and then validate clearParameters() will clear them
792     */
793    @Test(dataProvider = "rowSetType")
794    public void commonRowSetTest0030(BaseRowSet rs) throws Exception {
795        rs.setInt(1, 1);
796        rs.setString(2, query);
797        assertTrue(rs.getParams().length == 2);
798        rs.clearParameters();
799        assertTrue(rs.getParams().length == 0);
800    }
801
802    /*
803     * Validate that getURL() returns same value set by
804     * setURL()
805     */
806    @Test(dataProvider = "rowSetType")
807    public void commonRowSetTest0031(RowSet rs) throws Exception {
808        rs.setUrl(url);
809        assertTrue(rs.getUrl().equals(url));
810    }
811
812    /*
813     * This method is currently not implemented in BaseRowSet and will
814     * throw a SQLFeatureNotSupportedException
815     */
816    @Test(dataProvider = "rowSetType",
817            expectedExceptions = SQLFeatureNotSupportedException.class)
818    public void commonRowSetTest0100(RowSet rs) throws Exception {
819        InputStream is = null;
820        rs.setAsciiStream(1, is);
821    }
822
823    /*
824     * This method is currently not implemented in BaseRowSet and will
825     * throw a SQLFeatureNotSupportedException
826     */
827    @Test(dataProvider = "rowSetType",
828            expectedExceptions = SQLFeatureNotSupportedException.class)
829    public void commonRowSetTest0101(RowSet rs) throws Exception {
830        InputStream is = null;
831        rs.setAsciiStream("one", is);
832    }
833
834    /*
835     * This method is currently not implemented in BaseRowSet and will
836     * throw a SQLFeatureNotSupportedException
837     */
838    @Test(dataProvider = "rowSetType",
839            expectedExceptions = SQLFeatureNotSupportedException.class)
840    public void commonRowSetTest0102(RowSet rs) throws Exception {
841        InputStream is = null;
842        rs.setAsciiStream("one", is, query.length());
843    }
844
845    /*
846     * This method is currently not implemented in BaseRowSet and will
847     * throw a SQLFeatureNotSupportedException
848     */
849    @Test(dataProvider = "rowSetType",
850            expectedExceptions = SQLFeatureNotSupportedException.class)
851    public void commonRowSetTest0103(RowSet rs) throws Exception {
852        InputStream is = null;
853        rs.setBinaryStream(1, is);
854    }
855
856    /*
857     * This method is currently not implemented in BaseRowSet and will
858     * throw a SQLFeatureNotSupportedException
859     */
860    @Test(dataProvider = "rowSetType",
861            expectedExceptions = SQLFeatureNotSupportedException.class)
862    public void commonRowSetTest0104(RowSet rs) throws Exception {
863        InputStream is = null;
864        rs.setBinaryStream("one", is);
865    }
866
867    /*
868     * This method is currently not implemented in BaseRowSet and will
869     * throw a SQLFeatureNotSupportedException
870     */
871    @Test(dataProvider = "rowSetType",
872            expectedExceptions = SQLFeatureNotSupportedException.class)
873    public void commonRowSetTest0105(RowSet rs) throws Exception {
874        InputStream is = null;
875        rs.setBinaryStream("one", is, query.length());
876    }
877
878    /*
879     * This method is currently not implemented in BaseRowSet and will
880     * throw a SQLFeatureNotSupportedException
881     */
882    @Test(dataProvider = "rowSetType",
883            expectedExceptions = SQLFeatureNotSupportedException.class)
884    public void commonRowSetTest0106(RowSet rs) throws Exception {
885        rs.setBigDecimal("one", BigDecimal.ONE);
886    }
887
888    /*
889     * This method is currently not implemented in BaseRowSet and will
890     * throw a SQLFeatureNotSupportedException
891     */
892    @Test(dataProvider = "rowSetType",
893            expectedExceptions = SQLFeatureNotSupportedException.class)
894    public void commonRowSetTest0107(RowSet rs) throws Exception {
895        InputStream is = null;
896        rs.setBlob(1, is);
897    }
898
899    /*
900     * This method is currently not implemented in BaseRowSet and will
901     * throw a SQLFeatureNotSupportedException
902     */
903    @Test(dataProvider = "rowSetType",
904            expectedExceptions = SQLFeatureNotSupportedException.class)
905    public void commonRowSetTest0108(RowSet rs) throws Exception {
906        InputStream is = null;
907        rs.setBlob("one", is);
908    }
909
910    /*
911     * This method is currently not implemented in BaseRowSet and will
912     * throw a SQLFeatureNotSupportedException
913     */
914    @Test(dataProvider = "rowSetType",
915            expectedExceptions = SQLFeatureNotSupportedException.class)
916    public void commonRowSetTest0109(RowSet rs) throws Exception {
917        InputStream is = null;
918        rs.setBlob("one", is, query.length());
919    }
920
921    /*
922     * This method is currently not implemented in BaseRowSet and will
923     * throw a SQLFeatureNotSupportedException
924     */
925    @Test(dataProvider = "rowSetType",
926            expectedExceptions = SQLFeatureNotSupportedException.class)
927    public void commonRowSetTest0110(RowSet rs) throws Exception {
928        rs.setBlob("one", new StubBlob());
929    }
930
931    /*
932     * This method is currently not implemented in BaseRowSet and will
933     * throw a SQLFeatureNotSupportedException
934     */
935    @Test(dataProvider = "rowSetType",
936            expectedExceptions = SQLFeatureNotSupportedException.class)
937    public void commonRowSetTest0111(RowSet rs) throws Exception {
938        rs.setBoolean("one", true);
939    }
940
941    /*
942     * This method is currently not implemented in BaseRowSet and will
943     * throw a SQLFeatureNotSupportedException
944     */
945    @Test(dataProvider = "rowSetType",
946            expectedExceptions = SQLFeatureNotSupportedException.class)
947    public void commonRowSetTest0112(RowSet rs) throws Exception {
948        byte b = 1;
949        rs.setByte("one", b);
950    }
951
952    /*
953     * This method is currently not implemented in BaseRowSet and will
954     * throw a SQLFeatureNotSupportedException
955     */
956    @Test(dataProvider = "rowSetType",
957            expectedExceptions = SQLFeatureNotSupportedException.class)
958    public void commonRowSetTest0113(RowSet rs) throws Exception {
959        byte b = 1;
960        rs.setBytes("one", new byte[10]);
961    }
962
963    /*
964     * This method is currently not implemented in BaseRowSet and will
965     * throw a SQLFeatureNotSupportedException
966     */
967    @Test(dataProvider = "rowSetType",
968            expectedExceptions = SQLFeatureNotSupportedException.class)
969    public void commonRowSetTest0114(RowSet rs) throws Exception {
970        Reader rdr = null;
971        rs.setCharacterStream("one", rdr, query.length());
972    }
973
974    /*
975     * This method is currently not implemented in BaseRowSet and will
976     * throw a SQLFeatureNotSupportedException
977     */
978    @Test(dataProvider = "rowSetType",
979            expectedExceptions = SQLFeatureNotSupportedException.class)
980    public void commonRowSetTest0115(RowSet rs) throws Exception {
981        Reader rdr = null;
982        rs.setCharacterStream("one", rdr);
983    }
984
985    /*
986     * This method is currently not implemented in BaseRowSet and will
987     * throw a SQLFeatureNotSupportedException
988     */
989    @Test(dataProvider = "rowSetType",
990            expectedExceptions = SQLFeatureNotSupportedException.class)
991    public void commonRowSetTest0116(RowSet rs) throws Exception {
992        Reader rdr = null;
993        rs.setCharacterStream(1, rdr);
994    }
995
996    /*
997     * This method is currently not implemented in BaseRowSet and will
998     * throw a SQLFeatureNotSupportedException
999     */
1000    @Test(dataProvider = "rowSetType",
1001            expectedExceptions = SQLFeatureNotSupportedException.class)
1002    public void commonRowSetTest0117(RowSet rs) throws Exception {
1003        Reader rdr = null;
1004        rs.setClob(1, rdr);
1005    }
1006
1007    /*
1008     * This method is currently not implemented in BaseRowSet and will
1009     * throw a SQLFeatureNotSupportedException
1010     */
1011    @Test(dataProvider = "rowSetType",
1012            expectedExceptions = SQLFeatureNotSupportedException.class)
1013    public void commonRowSetTest0118(RowSet rs) throws Exception {
1014        Reader rdr = null;
1015        rs.setClob("one", rdr);
1016    }
1017
1018    /*
1019     * This method is currently not implemented in BaseRowSet and will
1020     * throw a SQLFeatureNotSupportedException
1021     */
1022    @Test(dataProvider = "rowSetType",
1023            expectedExceptions = SQLFeatureNotSupportedException.class)
1024    public void commonRowSetTest0119(RowSet rs) throws Exception {
1025        Reader rdr = null;
1026        rs.setClob("one", rdr, query.length());
1027    }
1028
1029    /*
1030     * This method is currently not implemented in BaseRowSet and will
1031     * throw a SQLFeatureNotSupportedException
1032     */
1033    @Test(dataProvider = "rowSetType",
1034            expectedExceptions = SQLFeatureNotSupportedException.class)
1035    public void commonRowSetTest0120(RowSet rs) throws Exception {
1036        rs.setClob("one", new StubClob());
1037    }
1038
1039    /*
1040     * This method is currently not implemented in BaseRowSet and will
1041     * throw a SQLFeatureNotSupportedException
1042     */
1043    @Test(dataProvider = "rowSetType",
1044            expectedExceptions = SQLFeatureNotSupportedException.class)
1045    public void commonRowSetTest0121(RowSet rs) throws Exception {
1046        rs.setDate("one", Date.valueOf(LocalDate.now()));
1047    }
1048
1049    /*
1050     * This method is currently not implemented in BaseRowSet and will
1051     * throw a SQLFeatureNotSupportedException
1052     */
1053    @Test(dataProvider = "rowSetType",
1054            expectedExceptions = SQLFeatureNotSupportedException.class)
1055    public void commonRowSetTest0122(RowSet rs) throws Exception {
1056        rs.setDate("one", Date.valueOf(LocalDate.now()),
1057                Calendar.getInstance());
1058    }
1059
1060    /*
1061     * This method is currently not implemented in BaseRowSet and will
1062     * throw a SQLFeatureNotSupportedException
1063     */
1064    @Test(dataProvider = "rowSetType",
1065            expectedExceptions = SQLFeatureNotSupportedException.class)
1066    public void commonRowSetTest0123(RowSet rs) throws Exception {
1067        rs.setTime("one", Time.valueOf(LocalTime.now()));
1068    }
1069
1070    /*
1071     * This method is currently not implemented in BaseRowSet and will
1072     * throw a SQLFeatureNotSupportedException
1073     */
1074    @Test(dataProvider = "rowSetType",
1075            expectedExceptions = SQLFeatureNotSupportedException.class)
1076    public void commonRowSetTest0124(RowSet rs) throws Exception {
1077        rs.setTime("one", Time.valueOf(LocalTime.now()),
1078                Calendar.getInstance());
1079    }
1080
1081    /*
1082     * This method is currently not implemented in BaseRowSet and will
1083     * throw a SQLFeatureNotSupportedException
1084     */
1085    @Test(dataProvider = "rowSetType",
1086            expectedExceptions = SQLFeatureNotSupportedException.class)
1087    public void commonRowSetTest0125(RowSet rs) throws Exception {
1088        rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()));
1089    }
1090
1091    /*
1092     * This method is currently not implemented in BaseRowSet and will
1093     * throw a SQLFeatureNotSupportedException
1094     */
1095    @Test(dataProvider = "rowSetType",
1096            expectedExceptions = SQLFeatureNotSupportedException.class)
1097    public void commonRowSetTest0126(RowSet rs) throws Exception {
1098        rs.setTimestamp("one", Timestamp.valueOf(LocalDateTime.now()),
1099                Calendar.getInstance());
1100    }
1101
1102    /*
1103     * This method is currently not implemented in BaseRowSet and will
1104     * throw a SQLFeatureNotSupportedException
1105     */
1106    @Test(dataProvider = "rowSetType",
1107            expectedExceptions = SQLFeatureNotSupportedException.class)
1108    public void commonRowSetTest0127(RowSet rs) throws Exception {
1109        rs.setDouble("one", 2.0d);
1110    }
1111
1112    /*
1113     * This method is currently not implemented in BaseRowSet and will
1114     * throw a SQLFeatureNotSupportedException
1115     */
1116    @Test(dataProvider = "rowSetType",
1117            expectedExceptions = SQLFeatureNotSupportedException.class)
1118    public void commonRowSetTest0128(RowSet rs) throws Exception {
1119        rs.setFloat("one", 2.0f);
1120    }
1121
1122    /*
1123     * This method is currently not implemented in BaseRowSet and will
1124     * throw a SQLFeatureNotSupportedException
1125     */
1126    @Test(dataProvider = "rowSetType",
1127            expectedExceptions = SQLFeatureNotSupportedException.class)
1128    public void commonRowSetTest0129(RowSet rs) throws Exception {
1129        rs.setInt("one", 21);
1130    }
1131
1132    /*
1133     * This method is currently not implemented in BaseRowSet and will
1134     * throw a SQLFeatureNotSupportedException
1135     */
1136    @Test(dataProvider = "rowSetType",
1137            expectedExceptions = SQLFeatureNotSupportedException.class)
1138    public void commonRowSetTest0130(RowSet rs) throws Exception {
1139        rs.setLong("one", 21l);
1140    }
1141
1142    /*
1143     * This method is currently not implemented in BaseRowSet and will
1144     * throw a SQLFeatureNotSupportedException
1145     */
1146    @Test(dataProvider = "rowSetType",
1147            expectedExceptions = SQLFeatureNotSupportedException.class)
1148    public void commonRowSetTest0131(RowSet rs) throws Exception {
1149        Reader rdr = null;
1150        rs.setNCharacterStream("one", rdr, query.length());
1151    }
1152
1153    /*
1154     * This method is currently not implemented in BaseRowSet and will
1155     * throw a SQLFeatureNotSupportedException
1156     */
1157    @Test(dataProvider = "rowSetType",
1158            expectedExceptions = SQLFeatureNotSupportedException.class)
1159    public void commonRowSetTest0132(RowSet rs) throws Exception {
1160        Reader rdr = null;
1161        rs.setNCharacterStream("one", rdr);
1162    }
1163
1164    /*
1165     * This method is currently not implemented in BaseRowSet and will
1166     * throw a SQLFeatureNotSupportedException
1167     */
1168    @Test(dataProvider = "rowSetType",
1169            expectedExceptions = SQLFeatureNotSupportedException.class)
1170    public void commonRowSetTest0133(RowSet rs) throws Exception {
1171        Reader rdr = null;
1172        rs.setNCharacterStream(1, rdr);
1173    }
1174
1175    /*
1176     * This method is currently not implemented in BaseRowSet and will
1177     * throw a SQLFeatureNotSupportedException
1178     */
1179    @Test(dataProvider = "rowSetType",
1180            expectedExceptions = SQLFeatureNotSupportedException.class)
1181    public void commonRowSetTest0134(RowSet rs) throws Exception {
1182        Reader rdr = null;
1183        rs.setNCharacterStream(1, rdr, query.length());
1184    }
1185
1186    /*
1187     * This method is currently not implemented in BaseRowSet and will
1188     * throw a SQLFeatureNotSupportedException
1189     */
1190    @Test(dataProvider = "rowSetType",
1191            expectedExceptions = SQLFeatureNotSupportedException.class)
1192    public void commonRowSetTest0135(RowSet rs) throws Exception {
1193        Reader rdr = null;
1194        rs.setClob("one", rdr);
1195    }
1196
1197    /*
1198     * This method is currently not implemented in BaseRowSet and will
1199     * throw a SQLFeatureNotSupportedException
1200     */
1201    @Test(dataProvider = "rowSetType",
1202            expectedExceptions = SQLFeatureNotSupportedException.class)
1203    public void commonRowSetTest0136(RowSet rs) throws Exception {
1204        Reader rdr = null;
1205        rs.setClob("one", rdr, query.length());
1206    }
1207
1208    /*
1209     * This method is currently not implemented in BaseRowSet and will
1210     * throw a SQLFeatureNotSupportedException
1211     */
1212    @Test(dataProvider = "rowSetType",
1213            expectedExceptions = SQLFeatureNotSupportedException.class)
1214    public void commonRowSetTest0137(RowSet rs) throws Exception {
1215        rs.setNClob("one", new StubNClob());
1216    }
1217
1218    /*
1219     * This method is currently not implemented in BaseRowSet and will
1220     * throw a SQLFeatureNotSupportedException
1221     */
1222    @Test(dataProvider = "rowSetType",
1223            expectedExceptions = SQLFeatureNotSupportedException.class)
1224    public void commonRowSetTest0138(RowSet rs) throws Exception {
1225        Reader rdr = null;
1226        rs.setNClob(1, rdr);
1227    }
1228
1229    /*
1230     * This method is currently not implemented in BaseRowSet and will
1231     * throw a SQLFeatureNotSupportedException
1232     */
1233    @Test(dataProvider = "rowSetType",
1234            expectedExceptions = SQLFeatureNotSupportedException.class)
1235    public void commonRowSetTest0139(RowSet rs) throws Exception {
1236        Reader rdr = null;
1237        rs.setNClob(1, rdr, query.length());
1238    }
1239
1240    /*
1241     * This method is currently not implemented in BaseRowSet and will
1242     * throw a SQLFeatureNotSupportedException
1243     */
1244    @Test(dataProvider = "rowSetType",
1245            expectedExceptions = SQLFeatureNotSupportedException.class)
1246    public void commonRowSetTest0140(RowSet rs) throws Exception {
1247        rs.setNClob(1, new StubNClob());
1248    }
1249
1250    /*
1251     * This method is currently not implemented in BaseRowSet and will
1252     * throw a SQLFeatureNotSupportedException
1253     */
1254    @Test(dataProvider = "rowSetType",
1255            expectedExceptions = SQLFeatureNotSupportedException.class)
1256    public void commonRowSetTest0141(RowSet rs) throws Exception {
1257        rs.setNString(1, query);
1258    }
1259
1260    /*
1261     * This method is currently not implemented in BaseRowSet and will
1262     * throw a SQLFeatureNotSupportedException
1263     */
1264    @Test(dataProvider = "rowSetType",
1265            expectedExceptions = SQLFeatureNotSupportedException.class)
1266    public void commonRowSetTest0142(RowSet rs) throws Exception {
1267        rs.setNull("one", Types.INTEGER);
1268    }
1269
1270    /*
1271     * This method is currently not implemented in BaseRowSet and will
1272     * throw a SQLFeatureNotSupportedException
1273     */
1274    @Test(dataProvider = "rowSetType",
1275            expectedExceptions = SQLFeatureNotSupportedException.class)
1276    public void commonRowSetTest0143(RowSet rs) throws Exception {
1277        rs.setNull("one", Types.INTEGER, "my.type");
1278    }
1279
1280    /*
1281     * This method is currently not implemented in BaseRowSet and will
1282     * throw a SQLFeatureNotSupportedException
1283     */
1284    @Test(dataProvider = "rowSetType",
1285            expectedExceptions = SQLFeatureNotSupportedException.class)
1286    public void commonRowSetTest0144(RowSet rs) throws Exception {
1287        rs.setObject("one", query, Types.VARCHAR);
1288    }
1289
1290    /*
1291     * This method is currently not implemented in BaseRowSet and will
1292     * throw a SQLFeatureNotSupportedException
1293     */
1294    @Test(dataProvider = "rowSetType",
1295            expectedExceptions = SQLFeatureNotSupportedException.class)
1296    public void commonRowSetTest0145(RowSet rs) throws Exception {
1297        rs.setObject("one", query, Types.VARCHAR, 0);
1298    }
1299
1300    /*
1301     * This method is currently not implemented in BaseRowSet and will
1302     * throw a SQLFeatureNotSupportedException
1303     */
1304    @Test(dataProvider = "rowSetType",
1305            expectedExceptions = SQLFeatureNotSupportedException.class)
1306    public void commonRowSetTest0146(RowSet rs) throws Exception {
1307        rs.setObject("one", query);
1308    }
1309
1310    /*
1311     * This method is currently not implemented in BaseRowSet and will
1312     * throw a SQLFeatureNotSupportedException
1313     */
1314    @Test(dataProvider = "rowSetType",
1315            expectedExceptions = SQLFeatureNotSupportedException.class)
1316    public void commonRowSetTest0147(RowSet rs) throws Exception {
1317        RowId aRowid = null;
1318        rs.setRowId("one", aRowid);
1319    }
1320
1321    /*
1322     * This method is currently not implemented in BaseRowSet and will
1323     * throw a SQLFeatureNotSupportedException
1324     */
1325    @Test(dataProvider = "rowSetType",
1326            expectedExceptions = SQLFeatureNotSupportedException.class)
1327    public void commonRowSetTest0148(RowSet rs) throws Exception {
1328        rs.setSQLXML("one", new StubSQLXML());
1329    }
1330
1331    /*
1332     * This method is currently not implemented in BaseRowSet and will
1333     * throw a SQLFeatureNotSupportedException
1334     */
1335    @Test(dataProvider = "rowSetType",
1336            expectedExceptions = SQLFeatureNotSupportedException.class)
1337    public void commonRowSetTest0149(RowSet rs) throws Exception {
1338        rs.setSQLXML(1, new StubSQLXML());
1339    }
1340
1341    /*
1342     * This method is currently not implemented in BaseRowSet and will
1343     * throw a SQLFeatureNotSupportedException
1344     */
1345    @Test(dataProvider = "rowSetType",
1346            expectedExceptions = SQLFeatureNotSupportedException.class)
1347    public void commonRowSetTest0150(RowSet rs) throws Exception {
1348        rs.setNString(1, query);
1349    }
1350
1351    /*
1352     * This method is currently not implemented in BaseRowSet and will
1353     * throw a SQLFeatureNotSupportedException
1354     */
1355    @Test(dataProvider = "rowSetType",
1356            expectedExceptions = SQLFeatureNotSupportedException.class)
1357    public void commonRowSetTest0151(RowSet rs) throws Exception {
1358        rs.setNString("one", query);
1359    }
1360
1361    /*
1362     * This method is currently not implemented in BaseRowSet and will
1363     * throw a SQLFeatureNotSupportedException
1364     */
1365    @Test(dataProvider = "rowSetType",
1366            expectedExceptions = SQLFeatureNotSupportedException.class)
1367    public void commonRowSetTest0152(RowSet rs) throws Exception {
1368        short val = 21;
1369        rs.setShort("one", val);
1370    }
1371
1372}
1373