diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index 7d372c2b9..01cf75b54 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
- category: ['ResultSetTestSuite,OthersTestSuite,LoaderTestSuite,DiagnosticTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'ArrowTestSuite,CoreTestSuite', 'FipsTestSuite']
+ category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
@@ -74,7 +74,7 @@ jobs:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
- category: ['ResultSetTestSuite,OthersTestSuite,LoaderTestSuite,DiagnosticTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'ArrowTestSuite,CoreTestSuite', 'FipsTestSuite']
+ category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
@@ -107,7 +107,7 @@ jobs:
matrix:
image: [ 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17', 'jdbc-centos7-openjdk21' ]
cloud: [ 'AWS', 'AZURE', 'GCP' ]
- category: ['ResultSetTestSuite,OthersTestSuite,LoaderTestSuite,DiagnosticTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'ArrowTestSuite,CoreTestSuite', 'FipsTestSuite']
+ category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['', '-Dthin-jar']
steps:
- uses: actions/checkout@v1
@@ -129,7 +129,7 @@ jobs:
matrix:
image: [ 'jdbc-centos7-openjdk8' ]
cloud: [ 'AWS' ]
- category: ['ResultSetTestSuite,OthersTestSuite,LoaderTestSuite,DiagnosticTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'ArrowTestSuite,CoreTestSuite']
+ category: ['OthersTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'CoreTestSuite,LoaderTestSuite,ResultSetTestSuite']
is_old_driver: ['true']
steps:
- uses: actions/checkout@v1
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 72c788c36..76e948b1d 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,7 @@
+**JDBC Driver 3.20.0**
+
+- \||Please Refer to Release Notes at https://docs.snowflake.com/en/release-notes/clients-drivers/jdbc
+
**JDBC Driver 3.19.1**
- \||Please Refer to Release Notes at https://docs.snowflake.com/en/release-notes/clients-drivers/jdbc
diff --git a/FIPS/pom.xml b/FIPS/pom.xml
index f0cbadd8f..74dafc9d2 100644
--- a/FIPS/pom.xml
+++ b/FIPS/pom.xml
@@ -5,12 +5,12 @@
net.snowflake
snowflake-jdbc-parent
- 3.19.2-SNAPSHOT
+ 3.20.1-SNAPSHOT
../parent-pom.xml
snowflake-jdbc-fips
- 3.19.2-SNAPSHOT
+ 3.20.1-SNAPSHOT
jar
snowflake-jdbc-fips
diff --git a/FIPS/scripts/check_content.sh b/FIPS/scripts/check_content.sh
index 565159073..a30eacec6 100755
--- a/FIPS/scripts/check_content.sh
+++ b/FIPS/scripts/check_content.sh
@@ -6,7 +6,7 @@ set -o pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-if jar tvf $DIR/../target/snowflake-jdbc-fips.jar | awk '{print $8}' | grep -v -E "^(net|com)/snowflake" | grep -v -E "(com|net)/\$" | grep -v -E "^META-INF" | grep -v -E "^mozilla" | grep -v -E "^com/sun/jna" | grep -v com/sun/ | grep -v mime.types | grep -v -E "^com/github/" | grep -v -E "^aix/" | grep -v -E "^darwin/" | grep -v -E "^freebsd/" | grep -v -E "^linux/" | grep -v -E "^win/"; then
+if jar tvf $DIR/../target/snowflake-jdbc-fips.jar | awk '{print $8}' | grep -v -E "/$" | grep -v -E "^(net|com)/snowflake" | grep -v -E "(com|net)/\$" | grep -v -E "^META-INF" | grep -v -E "^mozilla" | grep -v -E "^com/sun/jna" | grep -v com/sun/ | grep -v mime.types | grep -v -E "^com/github/luben/zstd/" | grep -v -E "^aix/" | grep -v -E "^darwin/" | grep -v -E "^freebsd/" | grep -v -E "^linux/" | grep -v -E "^win/"; then
echo "[ERROR] JDBC jar includes class not under the snowflake namespace"
exit 1
fi
diff --git a/README.rst b/README.rst
index c2e296e95..a9d3cacb2 100644
--- a/README.rst
+++ b/README.rst
@@ -214,3 +214,8 @@ Support
Feel free to file an issue or submit a PR here for general cases. For official support, contact Snowflake support at:
https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge
+
+Note
+----------
+
+This driver currently does not support GCP regional endpoints. Please ensure that any workloads using through this driver do not require support for regional endpoints on GCP. If you have questions about this, please contact Snowflake Support.
diff --git a/ci/scripts/check_content.sh b/ci/scripts/check_content.sh
index 3a0747be2..1af33e56a 100755
--- a/ci/scripts/check_content.sh
+++ b/ci/scripts/check_content.sh
@@ -8,12 +8,12 @@ set -o pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
-if jar tvf $DIR/../../target/snowflake-jdbc${package_modifier}.jar | awk '{print $8}' | grep -v -E "^(net|com)/snowflake" | grep -v -E "(com|net)/\$" | grep -v -E "^META-INF" | grep -v -E "^mozilla" | grep -v -E "^com/sun/jna" | grep -v com/sun/ | grep -v mime.types | grep -v -E "^com/github/" | grep -v -E "^aix/" | grep -v -E "^darwin/" | grep -v -E "^freebsd/" | grep -v -E "^linux/" | grep -v -E "^win/"; then
+if jar tvf $DIR/../../target/snowflake-jdbc${package_modifier}.jar | awk '{print $8}' | grep -v -E "/$" | grep -v -E "^(net|com)/snowflake" | grep -v -E "(com|net)/\$" | grep -v -E "^META-INF" | grep -v -E "^mozilla" | grep -v -E "^com/sun/jna" | grep -v com/sun/ | grep -v mime.types | grep -v -E "^com/github/luben/zstd/" | grep -v -E "^aix/" | grep -v -E "^darwin/" | grep -v -E "^freebsd/" | grep -v -E "^linux/" | grep -v -E "^win/"; then
echo "[ERROR] JDBC jar includes class not under the snowflake namespace"
exit 1
fi
-if jar tvf $DIR/../../target/snowflake-jdbc${package_modifier}.jar | awk '{print $8}' | grep -E "^META-INF/versions/.*.class" | grep -v -E "^META-INF/versions/.*/(net|com)/snowflake" | grep -v -E "^META-INF/versions/.*/com/github" | grep -v -E "^aix/" | grep -v -E "^darwin/" | grep -v -E "^freebsd/" | grep -v -E "^linux/" | grep -v -E "^win/"; then
+if jar tvf $DIR/../../target/snowflake-jdbc${package_modifier}.jar | awk '{print $8}' | grep -E "^META-INF/versions/.*.class" | grep -v -E "^META-INF/versions/.*/(net|com)/snowflake"; then
echo "[ERROR] JDBC jar includes multi-release classes not under the snowflake namespace"
exit 1
fi
diff --git a/parent-pom.xml b/parent-pom.xml
index d57da9fd0..d2a3867d0 100644
--- a/parent-pom.xml
+++ b/parent-pom.xml
@@ -5,7 +5,7 @@
net.snowflake
snowflake-jdbc-parent
- 3.19.2-SNAPSHOT
+ 3.20.1-SNAPSHOT
pom
@@ -35,7 +35,7 @@
1.2
1.17.0
1.4
- 2.11.0
+ 2.17.0
1.2
1.5.4
0.9.5.4
diff --git a/pom.xml b/pom.xml
index 0f1bce3a9..0cbc22747 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,13 +6,13 @@
net.snowflake
snowflake-jdbc-parent
- 3.19.2-SNAPSHOT
+ 3.20.1-SNAPSHOT
./parent-pom.xml
${artifactId}
- 3.19.2-SNAPSHOT
+ 3.20.1-SNAPSHOT
jar
${artifactId}
diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
index bd03ddd55..b385e04c2 100644
--- a/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
+++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeDriver.java
@@ -37,7 +37,7 @@ public class SnowflakeDriver implements Driver {
static SnowflakeDriver INSTANCE;
public static final Properties EMPTY_PROPERTIES = new Properties();
- public static String implementVersion = "3.19.2";
+ public static String implementVersion = "3.20.1";
static int majorVersion = 0;
static int minorVersion = 0;
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
index 4bec46ca7..0f8014ef6 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java
@@ -695,7 +695,7 @@ private SFPair createUploadStream(
final InputStream stream;
FileInputStream srcFileStream = null;
try {
- if (isEncrypting() && getEncryptionKeySize() < 256) {
+ if (isEncrypting() && getEncryptionKeySize() <= 256) {
try {
final InputStream uploadStream =
uploadFromStream
diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
index 003d894ae..31341c5a3 100644
--- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
+++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java
@@ -1036,7 +1036,7 @@ private SFPair createUploadStream(
final InputStream stream;
FileInputStream srcFileStream = null;
try {
- if (isEncrypting() && getEncryptionKeySize() < 256) {
+ if (isEncrypting() && getEncryptionKeySize() <= 256) {
try {
final InputStream uploadStream =
uploadFromStream
diff --git a/src/test/java/com/snowflake/client/jdbc/SnowflakeDriverIT.java b/src/test/java/com/snowflake/client/jdbc/SnowflakeDriverIT.java
index e7e8fa95f..f4f226fa9 100644
--- a/src/test/java/com/snowflake/client/jdbc/SnowflakeDriverIT.java
+++ b/src/test/java/com/snowflake/client/jdbc/SnowflakeDriverIT.java
@@ -5,8 +5,11 @@
import java.sql.Connection;
import java.sql.SQLException;
import net.snowflake.client.AbstractDriverIT;
+import net.snowflake.client.category.TestTags;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
+@Tag(TestTags.CONNECTION)
public class SnowflakeDriverIT extends AbstractDriverIT {
@Test
diff --git a/src/test/java/net/snowflake/client/jdbc/CompressedStreamFactoryTest.java b/src/test/java/net/snowflake/client/jdbc/CompressedStreamFactoryTest.java
index 86eb5764a..150075973 100644
--- a/src/test/java/net/snowflake/client/jdbc/CompressedStreamFactoryTest.java
+++ b/src/test/java/net/snowflake/client/jdbc/CompressedStreamFactoryTest.java
@@ -1,7 +1,7 @@
package net.snowflake.client.jdbc;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.github.luben.zstd.ZstdInputStream;
import com.github.luben.zstd.ZstdOutputStream;
diff --git a/src/test/java/net/snowflake/client/jdbc/DatabaseMetaDataResultSetLatestIT.java b/src/test/java/net/snowflake/client/jdbc/DatabaseMetaDataResultSetLatestIT.java
index b726dfac9..4e5881f36 100644
--- a/src/test/java/net/snowflake/client/jdbc/DatabaseMetaDataResultSetLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/DatabaseMetaDataResultSetLatestIT.java
@@ -16,8 +16,12 @@
import java.sql.Types;
import java.util.Arrays;
import java.util.List;
+import net.snowflake.client.category.TestCategoryResultSet;
+import net.snowflake.client.category.TestTags;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
+@Tag(TestTags.RESULT_SET)
public class DatabaseMetaDataResultSetLatestIT extends BaseJDBCTest {
@Test
diff --git a/src/test/java/net/snowflake/client/jdbc/FileUploaderExpandFileNamesTest.java b/src/test/java/net/snowflake/client/jdbc/FileUploaderExpandFileNamesTest.java
index d5233aef6..8545ca998 100644
--- a/src/test/java/net/snowflake/client/jdbc/FileUploaderExpandFileNamesTest.java
+++ b/src/test/java/net/snowflake/client/jdbc/FileUploaderExpandFileNamesTest.java
@@ -37,6 +37,8 @@ public void testProcessFileNames() throws Exception {
new File(folder, "TestFileB").createNewFile();
String folderName = folder.getCanonicalPath();
+ String originalUserDir = System.getProperty("user.dir");
+ String originalUserHome = System.getProperty("user.home");
System.setProperty("user.dir", folderName);
System.setProperty("user.home", folderName);
@@ -55,6 +57,17 @@ public void testProcessFileNames() throws Exception {
assertTrue(files.contains(folderName + File.separator + "TestFileC"));
assertTrue(files.contains(folderName + File.separator + "TestFileD"));
assertTrue(files.contains(folderName + File.separator + "TestFileE~"));
+
+ if (originalUserHome != null) {
+ System.setProperty("user.home", originalUserHome);
+ } else {
+ System.clearProperty("user.home");
+ }
+ if (originalUserDir != null) {
+ System.setProperty("user.dir", originalUserDir);
+ } else {
+ System.clearProperty("user.dir");
+ }
}
@Test
diff --git a/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java b/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java
index be2cdac0a..d2cfe896a 100644
--- a/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/FileUploaderLatestIT.java
@@ -52,7 +52,7 @@
/** Tests for SnowflakeFileTransferAgent that require an active connection */
// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
-public class FileUploaderLatestIT extends FileUploaderPrepIT {
+public class FileUploaderLatestIT extends FileUploaderPrep {
private static final String OBJ_META_STAGE = "testObjMeta";
private ObjectMapper mapper = new ObjectMapper();
private static final String PUT_COMMAND = "put file:///dummy/path/file2.gz @testStage";
diff --git a/src/test/java/net/snowflake/client/jdbc/FileUploaderPrepIT.java b/src/test/java/net/snowflake/client/jdbc/FileUploaderPrep.java
similarity index 99%
rename from src/test/java/net/snowflake/client/jdbc/FileUploaderPrepIT.java
rename to src/test/java/net/snowflake/client/jdbc/FileUploaderPrep.java
index 9a9f488e2..ab013c844 100644
--- a/src/test/java/net/snowflake/client/jdbc/FileUploaderPrepIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/FileUploaderPrep.java
@@ -11,7 +11,7 @@
import org.junit.jupiter.api.BeforeEach;
/** File uploader test prep reused by IT/connection tests and sessionless tests */
-abstract class FileUploaderPrepIT extends BaseJDBCTest {
+abstract class FileUploaderPrep extends BaseJDBCTest {
private ObjectMapper mapper = new ObjectMapper();
private final String exampleS3JsonStringWithStageEndpoint =
diff --git a/src/test/java/net/snowflake/client/jdbc/FileUploaderSessionlessTest.java b/src/test/java/net/snowflake/client/jdbc/FileUploaderSessionlessTest.java
index 91f85a34a..c21827dfc 100644
--- a/src/test/java/net/snowflake/client/jdbc/FileUploaderSessionlessTest.java
+++ b/src/test/java/net/snowflake/client/jdbc/FileUploaderSessionlessTest.java
@@ -20,7 +20,7 @@
import org.junit.jupiter.api.Test;
/** Tests for SnowflakeFileTransferAgent.expandFileNames. */
-public class FileUploaderSessionlessTest extends FileUploaderPrepIT {
+public class FileUploaderSessionlessTest extends FileUploaderPrep {
private ObjectMapper mapper = new ObjectMapper();
diff --git a/src/test/java/net/snowflake/client/jdbc/GitRepositoryDownloadLatestIT.java b/src/test/java/net/snowflake/client/jdbc/GitRepositoryDownloadLatestIT.java
index 2b2053d38..975f8ebb7 100644
--- a/src/test/java/net/snowflake/client/jdbc/GitRepositoryDownloadLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/GitRepositoryDownloadLatestIT.java
@@ -3,9 +3,9 @@
*/
package net.snowflake.client.jdbc;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.InputStream;
@@ -47,8 +47,8 @@ public void shouldDownloadFileAndStreamFromGitRepository() throws Exception {
List fetchedStreamContent =
getContentFromStream(connection, stageName, filePathInGitRepo);
- assertFalse("File content cannot be empty", fetchedFileContent.isEmpty());
- assertFalse("Stream content cannot be empty", fetchedStreamContent.isEmpty());
+ assertFalse(fetchedFileContent.isEmpty(), "File content cannot be empty");
+ assertFalse(fetchedStreamContent.isEmpty(), "Stream content cannot be empty");
assertEquals(fetchedFileContent, fetchedStreamContent);
}
}
@@ -79,7 +79,7 @@ private static List getContentFromFile(
try (Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(command); ) {
// then
- assertTrue("has result", rs.next());
+ assertTrue(rs.next(), "has result");
return Files.readAllLines(downloadedFile);
} finally {
Files.delete(downloadedFile);
diff --git a/src/test/java/net/snowflake/client/jdbc/MaxLobSizeLatestIT.java b/src/test/java/net/snowflake/client/jdbc/MaxLobSizeLatestIT.java
index 2bce69284..17afeeb53 100644
--- a/src/test/java/net/snowflake/client/jdbc/MaxLobSizeLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/MaxLobSizeLatestIT.java
@@ -11,9 +11,12 @@
import java.sql.SQLException;
import java.sql.Statement;
import net.snowflake.client.annotations.DontRunOnGithubActions;
+import net.snowflake.client.category.TestTags;
import org.hamcrest.CoreMatchers;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
+@Tag(TestTags.STATEMENT)
public class MaxLobSizeLatestIT extends BaseJDBCTest {
/**
diff --git a/src/test/java/net/snowflake/client/jdbc/SnowflakeChunkDownloaderLatestIT.java b/src/test/java/net/snowflake/client/jdbc/SnowflakeChunkDownloaderLatestIT.java
index de36cdbe7..0251f3984 100644
--- a/src/test/java/net/snowflake/client/jdbc/SnowflakeChunkDownloaderLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/SnowflakeChunkDownloaderLatestIT.java
@@ -11,11 +11,40 @@
import java.sql.Statement;
import java.util.List;
import java.util.Properties;
+import net.snowflake.client.category.TestTags;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
+@Tag(TestTags.CORE)
public class SnowflakeChunkDownloaderLatestIT extends BaseJDBCTest {
+ private static String originalProxyHost;
+ private static String originalProxyPort;
+ private static String originalNonProxyHosts;
+ @BeforeAll
+ public static void setUp() throws Exception {
+ originalProxyHost = System.getProperty("https.proxyHost");
+ originalProxyPort = System.getProperty("https.proxyPort");
+ originalNonProxyHosts = System.getProperty("https.nonProxyHosts");
+ }
+
+ private static void restoreProperty(String key, String value) {
+ if (value != null) {
+ System.setProperty(key, value);
+ } else {
+ System.clearProperty(key);
+ }
+ }
+
+ @AfterAll
+ public static void tearDown() throws Exception {
+ restoreProperty("https.proxyHost", originalProxyHost);
+ restoreProperty("https.proxyPort", originalProxyPort);
+ restoreProperty("https.nonProxyHosts", originalNonProxyHosts);
+ }
/**
* Tests that the chunk downloader uses the maxHttpRetries and doesn't enter and infinite loop of
* retries.
diff --git a/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClientLatestIT.java b/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClientLatestIT.java
index fe5400866..58e8097bf 100644
--- a/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClientLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClientLatestIT.java
@@ -2,13 +2,18 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.spy;
+import com.amazonaws.services.kms.model.UnsupportedOperationException;
import com.microsoft.azure.storage.blob.ListBlobItem;
import java.sql.Connection;
import java.sql.SQLException;
+import java.util.ArrayList;
import net.snowflake.client.annotations.DontRunOnGithubActions;
+import net.snowflake.client.category.TestCategoryOthers;
+import net.snowflake.client.category.TestTags;
import net.snowflake.client.core.SFSession;
import net.snowflake.client.core.SFStatement;
import net.snowflake.client.jdbc.BaseJDBCTest;
@@ -16,8 +21,10 @@
import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import net.snowflake.common.core.RemoteStoreFileEncryptionMaterial;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
+@Tag(TestTags.OTHERS)
public class SnowflakeAzureClientLatestIT extends BaseJDBCTest {
@Test
@DontRunOnGithubActions
@@ -41,11 +48,11 @@ public void testAzureClientSetupInvalidEncryptionKeySize() throws SQLException {
@Test
public void testCloudExceptionTest() {
- Iterable mockList = null;
+ Iterable mockList = new ArrayList<>();
AzureObjectSummariesIterator iterator = new AzureObjectSummariesIterator(mockList);
AzureObjectSummariesIterator spyIterator = spy(iterator);
UnsupportedOperationException ex =
assertThrows(UnsupportedOperationException.class, () -> spyIterator.remove());
- assertEquals(ex.getMessage(), "remove() method not supported");
+ assertTrue(ex.getMessage().startsWith("remove() method not supported"));
}
}
diff --git a/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3ClientLatestIT.java b/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3ClientLatestIT.java
index ee71ab97c..b46064778 100644
--- a/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3ClientLatestIT.java
+++ b/src/test/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3ClientLatestIT.java
@@ -15,6 +15,7 @@
import java.sql.Statement;
import java.util.Properties;
import net.snowflake.client.annotations.DontRunOnGithubActions;
+import net.snowflake.client.category.TestTags;
import net.snowflake.client.core.SFSession;
import net.snowflake.client.core.SFStatement;
import net.snowflake.client.jdbc.BaseJDBCTest;
@@ -22,9 +23,11 @@
import net.snowflake.client.jdbc.SnowflakeFileTransferAgent;
import net.snowflake.common.core.RemoteStoreFileEncryptionMaterial;
import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
+@Tag(TestTags.OTHERS)
public class SnowflakeS3ClientLatestIT extends BaseJDBCTest {
@Test
diff --git a/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java b/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java
index 53118af4e..bf3854f1d 100644
--- a/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java
+++ b/src/test/java/net/snowflake/client/log/JDK14LoggerWithClientLatestIT.java
@@ -18,18 +18,32 @@
import java.util.Properties;
import java.util.logging.Level;
import net.snowflake.client.AbstractDriverIT;
+import net.snowflake.client.annotations.DontRunOnWindows;
+import net.snowflake.client.category.TestTags;
import net.snowflake.client.jdbc.SnowflakeSQLLoggedException;
import org.apache.commons.io.FileUtils;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+@Tag(TestTags.OTHERS)
public class JDK14LoggerWithClientLatestIT extends AbstractDriverIT {
+ @TempDir public File tmpFolder;
String homePath = systemGetProperty("user.home");
@Test
- public void testJDK14LoggingWithClientConfig() {
- Path configFilePath = Paths.get("config.json");
- String configJson = "{\"common\":{\"log_level\":\"debug\",\"log_path\":\"logs\"}}";
+ @Disabled
+ public void testJDK14LoggingWithClientConfig() throws IOException {
+ File configFile = new File(tmpFolder, "config.json");
+ configFile.createNewFile();
+ Path configFilePath = configFile.toPath();
+ File logFolder = new File(tmpFolder, "logs");
+ logFolder.createNewFile();
+ Path logFolderPath = logFolder.toPath();
+ String configJson =
+ "{\"common\":{\"log_level\":\"debug\",\"log_path\":\"" + logFolderPath + "\"}}";
try {
Files.write(configFilePath, configJson.getBytes());
Properties properties = new Properties();
@@ -38,11 +52,8 @@ public void testJDK14LoggingWithClientConfig() {
Statement statement = connection.createStatement()) {
statement.executeQuery("select 1");
- File file = new File("logs/jdbc/");
+ File file = new File(Paths.get(logFolderPath.toString(), "jdbc").toString());
assertTrue(file.exists());
-
- Files.deleteIfExists(configFilePath);
- FileUtils.deleteDirectory(new File("logs"));
}
} catch (IOException e) {
fail("testJDK14LoggingWithClientConfig failed");
@@ -66,24 +77,27 @@ public void testJDK14LoggingWithClientConfigInvalidConfigFilePath() {
}
@Test
- public void testJDK14LoggingWithClientConfigPermissionError() throws IOException, SQLException {
- Path configFilePath = Paths.get("config.json");
- String configJson = "{\"common\":{\"log_level\":\"debug\",\"log_path\":\"logs\"}}";
- Path directoryPath = Files.createDirectory(Paths.get("logs"));
- File directory = directoryPath.toFile();
+ @Disabled
+ @DontRunOnWindows
+ public void testJDK14LoggingWithClientConfigPermissionError() throws IOException {
+ File configFile = new File(tmpFolder, "config.json");
+ configFile.createNewFile();
+ Path configFilePath = configFile.toPath();
+ File logFolder = new File(tmpFolder, "logs");
+ logFolder.createNewFile();
+ Path logFolderPath = logFolder.toPath();
+ String configJson =
+ "{\"common\":{\"log_level\":\"debug\",\"log_path\":\"" + logFolderPath + "\"}}";
HashSet perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ);
perms.add(PosixFilePermission.GROUP_READ);
perms.add(PosixFilePermission.OTHERS_READ);
- Files.setPosixFilePermissions(directoryPath, perms);
+ Files.setPosixFilePermissions(logFolderPath, perms);
Files.write(configFilePath, configJson.getBytes());
Properties properties = new Properties();
properties.put("client_config_file", configFilePath.toString());
assertThrows(SQLException.class, () -> getConnection(properties));
-
- Files.delete(configFilePath);
- directory.delete();
}
@Test
@@ -103,11 +117,16 @@ public void testJDK14LoggerWithQuotesInMessage() {
}
@Test
+ @Disabled
public void testJDK14LoggingWithMissingLogPathClientConfig() throws Exception {
- Path configFilePath = Paths.get("config.json");
+ File configFile = new File(tmpFolder, "config.json");
+ configFile.createNewFile();
+ Path configFilePath = configFile.toPath();
String configJson = "{\"common\":{\"log_level\":\"debug\"}}";
+ Path home = tmpFolder.toPath();
+ System.setProperty("user.home", home.toString());
- Path homeLogPath = Paths.get(homePath, "jdbc");
+ Path homeLogPath = Paths.get(home.toString(), "jdbc");
Files.write(configFilePath, configJson.getBytes());
Properties properties = new Properties();
properties.put("client_config_file", configFilePath.toString());
@@ -123,21 +142,23 @@ public void testJDK14LoggingWithMissingLogPathClientConfig() throws Exception {
Files.deleteIfExists(configFilePath);
FileUtils.deleteDirectory(new File(homeLogPath.toString()));
}
+ } finally {
+ System.setProperty("user.home", homePath);
}
}
@Test
+ @Disabled
public void testJDK14LoggingWithMissingLogPathNoHomeDirClientConfig() throws Exception {
System.clearProperty("user.home");
- Path configFilePath = Paths.get("config.json");
+ File configFile = new File(tmpFolder, "config.json");
+ Path configFilePath = configFile.toPath();
String configJson = "{\"common\":{\"log_level\":\"debug\"}}";
Files.write(configFilePath, configJson.getBytes());
Properties properties = new Properties();
properties.put("client_config_file", configFilePath.toString());
- try (Connection connection = getConnection(properties);
- Statement statement = connection.createStatement()) {
-
+ try (Connection connection = getConnection(properties)) {
fail("testJDK14LoggingWithMissingLogPathNoHomeDirClientConfig failed");
} catch (SnowflakeSQLLoggedException e) {
// Succeed
diff --git a/src/test/java/net/snowflake/client/util/StopwatchTest.java b/src/test/java/net/snowflake/client/util/StopwatchTest.java
index ea1d684bf..066b450fa 100644
--- a/src/test/java/net/snowflake/client/util/StopwatchTest.java
+++ b/src/test/java/net/snowflake/client/util/StopwatchTest.java
@@ -36,7 +36,7 @@ public void testGetMillisWhenStopped() throws InterruptedException {
@Test
public void testGetMillisWithoutStopping() throws InterruptedException {
stopwatch.start();
- TimeUnit.MILLISECONDS.sleep(20);
+ TimeUnit.MILLISECONDS.sleep(100);
assertThat(
stopwatch.elapsedMillis(), allOf(greaterThanOrEqualTo(10L), lessThanOrEqualTo(500L)));
}
diff --git a/thin_public_pom.xml b/thin_public_pom.xml
index 61118214c..460ceaec2 100644
--- a/thin_public_pom.xml
+++ b/thin_public_pom.xml
@@ -39,7 +39,7 @@
5.0.0
1.78.1
1.17.0
- 2.11.0
+ 2.17.0
1.2
2.21.0
2.22.6