You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactored tests: Moved datatype-related stream tests to LobsStreaming test, removed redundant cleanup logging, and handled table cleanup in @AfterEach.
stmt.executeUpdate("CREATE TABLE " + tableName + " (col1 XML NULL)");
309
+
stmt.executeUpdate("INSERT INTO " + tableName + " (col1) VALUES ('<root><child>Hello</child></root>')");
310
+
stmt.executeUpdate("INSERT INTO " + tableName + " (col1) VALUES (NULL)");
311
+
312
+
try (ResultSetrs = stmt.executeQuery("SELECT col1 FROM " + tableName)) {
313
+
introwIndex = 0;
314
+
while (rs.next()) {
315
+
rowIndex++;
316
+
try {
317
+
InputStreamasciiStream = rs.getAsciiStream(1);
318
+
if (rowIndex == 1) {
319
+
fail("Expected SQLException was not thrown for non-null value"); // Non-null value: Should throw an exception
320
+
} else {
321
+
assertNull(asciiStream, "Expected null for NULL value, but got a non-null InputStream"); // Null value: Should return null without throwing an exception
322
+
}
323
+
} catch (SQLExceptione) {
324
+
if (rowIndex == 1) {
325
+
assertTrue(e.getMessage().contains("The conversion from xml to AsciiStream is unsupported."),
stmt.executeUpdate("CREATE TABLE " + tableName + " (col1 XML NULL)");
3093
-
stmt.executeUpdate("INSERT INTO " + tableName + " (col1) VALUES ('<root><child>Hello</child></root>')");
3094
-
stmt.executeUpdate("INSERT INTO " + tableName + " (col1) VALUES (NULL)");
3095
-
3096
-
try (ResultSetrs = stmt.executeQuery("SELECT col1 FROM " + tableName)) {
3097
-
introwIndex = 0;
3098
-
while (rs.next()) {
3099
-
rowIndex++;
3100
-
try {
3101
-
InputStreamasciiStream = rs.getAsciiStream(1);
3102
-
if (rowIndex == 1) {
3103
-
fail("Expected SQLException was not thrown for non-null value"); // Non-null value: Should throw an exception
3104
-
} else {
3105
-
assertNull(asciiStream, "Expected null for NULL value, but got a non-null InputStream"); // Null value: Should return null without throwing an exception
3106
-
}
3107
-
} catch (SQLExceptione) {
3108
-
if (rowIndex == 1) {
3109
-
assertTrue(e.getMessage().contains("The conversion from xml to AsciiStream is unsupported."),
0 commit comments