Skip to content

Commit aba306f

Browse files
committed
fix failing tests
1 parent ed113d6 commit aba306f

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4585,7 +4585,8 @@ <T> List<T> findMatchingBigQueryObjects(
45854585
Function<T, String> nameExtractor,
45864586
String pattern,
45874587
Pattern regex,
4588-
BigQueryJdbcCustomLogger logger) {
4588+
BigQueryJdbcCustomLogger logger)
4589+
throws InterruptedException {
45894590

45904591
boolean needsList = needsListing(pattern);
45914592
List<T> resultList = new ArrayList<>();
@@ -4639,14 +4640,17 @@ <T> List<T> findMatchingBigQueryObjects(
46394640
logger.warning(
46404641
"BigQueryException finding %ss for pattern '%s': %s (Code: %d)",
46414642
objectTypeName, pattern, e.getMessage(), e.getCode());
4643+
throw e;
46424644
}
46434645
} catch (InterruptedException e) {
46444646
Thread.currentThread().interrupt();
46454647
logger.warning("Interrupted while finding " + objectTypeName + "s.");
4648+
throw e;
46464649
} catch (Exception e) {
46474650
logger.severe(
46484651
"Unexpected exception finding %ss for pattern '%s': %s",
46494652
objectTypeName, pattern, e.getMessage());
4653+
throw new RuntimeException(e);
46504654
}
46514655
return resultList;
46524656
}
@@ -4923,6 +4927,9 @@ private List<Dataset> fetchMatchingDatasets(
49234927
if (datasets != null) {
49244928
allDatasets.addAll(datasets);
49254929
}
4930+
} catch (InterruptedException e) {
4931+
Thread.currentThread().interrupt();
4932+
break;
49264933
} catch (Exception e) {
49274934
if (catalog != null) {
49284935
throw new SQLException("Failed to fetch matching datasets for project " + project, e);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ public void testSortResults_Procedures_EmptyList() {
10171017
}
10181018

10191019
@Test
1020-
public void testFindMatchingBigQueryObjects_Routines_ListWithPattern() {
1020+
public void testFindMatchingBigQueryObjects_Routines_ListWithPattern() throws Exception {
10211021
String catalog = "p-cat";
10221022
String schema = "d-sch";
10231023
String pattern = "proc_%";
@@ -1063,7 +1063,7 @@ public void testFindMatchingBigQueryObjects_Routines_ListWithPattern() {
10631063
}
10641064

10651065
@Test
1066-
public void testFindMatchingBigQueryObjects_Routines_ListNoPattern() {
1066+
public void testFindMatchingBigQueryObjects_Routines_ListNoPattern() throws Exception {
10671067
String catalog = "p-cat";
10681068
String schema = "d-sch";
10691069
String pattern = null;
@@ -1102,7 +1102,7 @@ public void testFindMatchingBigQueryObjects_Routines_ListNoPattern() {
11021102
}
11031103

11041104
@Test
1105-
public void testFindMatchingBigQueryObjects_Routines_GetSpecific() {
1105+
public void testFindMatchingBigQueryObjects_Routines_GetSpecific() throws Exception {
11061106
String catalog = "p-cat";
11071107
String schema = "d-sch";
11081108
String procNameExact = "exactprocname";

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITDatabaseMetadataTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,9 @@ public void testDatabaseMetaDataGetFunctions() throws SQLException {
937937
rsEmptyFunction.next(), "Empty function name pattern should return no results");
938938
rsEmptyFunction.close();
939939

940-
// Test 9: Null catalog
940+
// Test 9: Null catalog should return all functions (spec-compliant)
941941
ResultSet rsNullCatalog = databaseMetaData.getFunctions(null, testSchema, null);
942-
Assertions.assertFalse(rsNullCatalog.next(), "Null catalog should return no results");
942+
Assertions.assertTrue(rsNullCatalog.next(), "Null catalog should return results");
943943
rsNullCatalog.close();
944944
connection.close();
945945
}

0 commit comments

Comments
 (0)