|
17 | 17 | package io.cdap.plugin.db; |
18 | 18 |
|
19 | 19 | import io.cdap.cdap.api.data.schema.Schema; |
| 20 | +import io.cdap.cdap.api.exception.ProgramFailureException; |
20 | 21 | import org.junit.Assert; |
21 | 22 | import org.junit.Before; |
22 | 23 | import org.junit.Test; |
@@ -162,49 +163,49 @@ public void testGetSchemaThrowsExceptionOnNumericWithZeroPrecision() throws SQLE |
162 | 163 | reader.getSchema(metadata, 1); |
163 | 164 | } |
164 | 165 |
|
165 | | - @Test(expected = SQLException.class) |
| 166 | + @Test(expected = ProgramFailureException.class) |
166 | 167 | public void testGetSchemaThrowsExceptionOnArray() throws SQLException { |
167 | 168 | when(metadata.getColumnType(eq(1))).thenReturn(Types.ARRAY); |
168 | 169 | reader.getSchema(metadata, 1); |
169 | 170 | } |
170 | 171 |
|
171 | | - @Test(expected = SQLException.class) |
| 172 | + @Test(expected = ProgramFailureException.class) |
172 | 173 | public void testGetSchemaThrowsExceptionOnDatalink() throws SQLException { |
173 | 174 | when(metadata.getColumnType(eq(1))).thenReturn(Types.DATALINK); |
174 | 175 | reader.getSchema(metadata, 1); |
175 | 176 | } |
176 | 177 |
|
177 | | - @Test(expected = SQLException.class) |
| 178 | + @Test(expected = ProgramFailureException.class) |
178 | 179 | public void testGetSchemaThrowsExceptionOnDistinct() throws SQLException { |
179 | 180 | when(metadata.getColumnType(eq(1))).thenReturn(Types.DISTINCT); |
180 | 181 | reader.getSchema(metadata, 1); |
181 | 182 | } |
182 | 183 |
|
183 | | - @Test(expected = SQLException.class) |
| 184 | + @Test(expected = ProgramFailureException.class) |
184 | 185 | public void testGetSchemaThrowsExceptionOnJavaObject() throws SQLException { |
185 | 186 | when(metadata.getColumnType(eq(1))).thenReturn(Types.JAVA_OBJECT); |
186 | 187 | reader.getSchema(metadata, 1); |
187 | 188 | } |
188 | 189 |
|
189 | | - @Test(expected = SQLException.class) |
| 190 | + @Test(expected = ProgramFailureException.class) |
190 | 191 | public void testGetSchemaThrowsExceptionOnOther() throws SQLException { |
191 | 192 | when(metadata.getColumnType(eq(1))).thenReturn(Types.OTHER); |
192 | 193 | reader.getSchema(metadata, 1); |
193 | 194 | } |
194 | 195 |
|
195 | | - @Test(expected = SQLException.class) |
| 196 | + @Test(expected = ProgramFailureException.class) |
196 | 197 | public void testGetSchemaThrowsExceptionOnRef() throws SQLException { |
197 | 198 | when(metadata.getColumnType(eq(1))).thenReturn(Types.REF); |
198 | 199 | reader.getSchema(metadata, 1); |
199 | 200 | } |
200 | 201 |
|
201 | | - @Test(expected = SQLException.class) |
| 202 | + @Test(expected = ProgramFailureException.class) |
202 | 203 | public void testGetSchemaThrowsExceptionOnSQLXML() throws SQLException { |
203 | 204 | when(metadata.getColumnType(eq(1))).thenReturn(Types.SQLXML); |
204 | 205 | reader.getSchema(metadata, 1); |
205 | 206 | } |
206 | 207 |
|
207 | | - @Test(expected = SQLException.class) |
| 208 | + @Test(expected = ProgramFailureException.class) |
208 | 209 | public void testGetSchemaThrowsExceptionOnStruct() throws SQLException { |
209 | 210 | when(metadata.getColumnType(eq(1))).thenReturn(Types.STRUCT); |
210 | 211 | reader.getSchema(metadata, 1); |
|
0 commit comments