|
5 | 5 | import java.sql.SQLException; |
6 | 6 | import java.sql.Types; |
7 | 7 |
|
8 | | -import static org.testng.Assert.*; |
| 8 | +import static org.testng.Assert.assertEquals; |
| 9 | +import static org.testng.Assert.assertFalse; |
| 10 | +import static org.testng.Assert.assertThrows; |
9 | 11 |
|
10 | 12 |
|
11 | 13 | public class ParameterMetaDataImplTest { |
@@ -81,4 +83,17 @@ public void testGetParameterMode() throws SQLException { |
81 | 83 | assertThrows(() -> metaData.getParameterMode(0)); |
82 | 84 | assertThrows(() -> metaData.getParameterMode(2)); |
83 | 85 | } |
| 86 | + |
| 87 | + @Test(groups = {"integration"}) |
| 88 | + public void testColumnOutOfIndex() throws SQLException { |
| 89 | + ParameterMetaDataImpl metaData = new ParameterMetaDataImpl(1); |
| 90 | + int indexAfterLastColumn = 2; |
| 91 | + assertThrows(SQLException.class, () -> metaData.getParameterMode(indexAfterLastColumn)); |
| 92 | + assertThrows(SQLException.class, () -> metaData.getParameterType(indexAfterLastColumn)); |
| 93 | + assertThrows(SQLException.class, () -> metaData.getScale(indexAfterLastColumn)); |
| 94 | + assertThrows(SQLException.class, () -> metaData.getPrecision(indexAfterLastColumn)); |
| 95 | + assertThrows(SQLException.class, () -> metaData.getParameterClassName(indexAfterLastColumn)); |
| 96 | + assertThrows(SQLException.class, () -> metaData.isNullable(indexAfterLastColumn)); |
| 97 | + assertThrows(SQLException.class, () -> metaData.isSigned(indexAfterLastColumn)); |
| 98 | + } |
84 | 99 | } |
0 commit comments