Skip to content

Commit

Permalink
Update test for Synapse OnDemand servers (#2302)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird committed Jan 15, 2024
1 parent 0f04ce6 commit 066aeeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ public static boolean isAzureMI(Connection con) {
return ((SQLServerConnection) con).isAzureMI();
}

/**
* Checks if connection is established to Azure Synapse OnDemand server
*
*/
public static boolean isAzureSynapseOnDemand(Connection con) {
isAzure(con);
return ((SQLServerConnection) con).isAzureSynapseOnDemandEndpoint();
}

/**
* Checks if connection is established to server that supports AEv2.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ public void testAzureEndpointRetry() {
try (Connection con = PrepUtil.getConnection(connectionString)) {
Field fields[] = con.getClass().getSuperclass().getDeclaredFields();
for (Field f : fields) {
if (f.getName() == "connectRetryCount") {
if (f.getName().equals("connectRetryCount")) {
f.setAccessible(true);
int retryCount = f.getInt(con);

if (TestUtils.isAzureDW(con)) {
assertTrue(retryCount == 5); // AZURE_SYNAPSE_ONDEMAND_ENDPOINT_RETRY_COUNT_DEFAFULT
if (TestUtils.isAzureSynapseOnDemand(con)) {
assertTrue(retryCount == 5); // AZURE_SYNAPSE_ONDEMAND_ENDPOINT_RETRY_COUNT_DEFAULT
} else if (TestUtils.isAzure(con)) {
assertTrue(retryCount == 2); // AZURE_SERVER_ENDPOINT_RETRY_COUNT_DEFAFULT
} else {
Expand Down

0 comments on commit 066aeeb

Please sign in to comment.