Skip to content

Commit 066aeeb

Browse files
authored
Update test for Synapse OnDemand servers (#2302)
1 parent 0f04ce6 commit 066aeeb

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java

+9
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,15 @@ public static boolean isAzureMI(Connection con) {
237237
return ((SQLServerConnection) con).isAzureMI();
238238
}
239239

240+
/**
241+
* Checks if connection is established to Azure Synapse OnDemand server
242+
*
243+
*/
244+
public static boolean isAzureSynapseOnDemand(Connection con) {
245+
isAzure(con);
246+
return ((SQLServerConnection) con).isAzureSynapseOnDemandEndpoint();
247+
}
248+
240249
/**
241250
* Checks if connection is established to server that supports AEv2.
242251
*

src/test/java/com/microsoft/sqlserver/jdbc/connection/TimeoutTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ public void testAzureEndpointRetry() {
266266
try (Connection con = PrepUtil.getConnection(connectionString)) {
267267
Field fields[] = con.getClass().getSuperclass().getDeclaredFields();
268268
for (Field f : fields) {
269-
if (f.getName() == "connectRetryCount") {
269+
if (f.getName().equals("connectRetryCount")) {
270270
f.setAccessible(true);
271271
int retryCount = f.getInt(con);
272272

273-
if (TestUtils.isAzureDW(con)) {
274-
assertTrue(retryCount == 5); // AZURE_SYNAPSE_ONDEMAND_ENDPOINT_RETRY_COUNT_DEFAFULT
273+
if (TestUtils.isAzureSynapseOnDemand(con)) {
274+
assertTrue(retryCount == 5); // AZURE_SYNAPSE_ONDEMAND_ENDPOINT_RETRY_COUNT_DEFAULT
275275
} else if (TestUtils.isAzure(con)) {
276276
assertTrue(retryCount == 2); // AZURE_SERVER_ENDPOINT_RETRY_COUNT_DEFAFULT
277277
} else {

0 commit comments

Comments
 (0)