assertNull(rs.getWarnings());
assertNull(jrs.getRowSetWarnings());
}
public void testConstructor() throws Exception {
JdbcRowSet jrs = newJdbcRowSet();
try {
jrs.absolute(3);
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.addRowSetListener(new Listener());
try {
jrs.afterLast();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.beforeFirst();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.cancelRowUpdates();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.clearParameters();
try {
jrs.clearWarnings();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.close();
// after close
try {
jrs.commit();
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
try {
jrs.deleteRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.findColumn("abc");
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.first();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.getString(1);
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.getAutoCommit();
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
jrs.getCommand();
try {
jrs.getConcurrency();
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
try {
jrs.getCursorName();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.getDataSourceName();
jrs.getEscapeProcessing();
try {
jrs.getFetchDirection();
fail("should throw NullPointerException");
} catch (NullPointerException e) {
// expected
}
jrs.getFetchSize();
try {
jrs.getMatchColumnIndexes();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.getMatchColumnNames();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.getMaxFieldSize();
jrs.getMaxRows();
try {
jrs.getMetaData();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.getPassword();
jrs.getQueryTimeout();
try {
jrs.getRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.getRowSetWarnings();
jrs.getShowDeleted();
jrs.getStatement();
jrs.getTransactionIsolation();
jrs.getType();
jrs.getTypeMap();
jrs.getUrl();
jrs.getUsername();
try {
jrs.getWarnings();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.insertRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.isAfterLast();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.isFirst();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
jrs.isReadOnly();
try {
jrs.moveToCurrentRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.moveToInsertRow();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
try {
jrs.next();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}