Skip to content

Commit 74d1072

Browse files
authored
SQL Server 2025: Enable Vector & JSON Tests and Address Compatibility Gaps (#2846)
* Add xSQL17 tags to test incompatible with SQL Server 2025 * Added proper tag for running vector and json test on sql server 2025 * Added fix * Refactor MSITest * added comment * Remove Mockito inline dependency for JRE 8 Removed inline Mockito dependency for JRE 8 profile. * Remove Mockito inline dependency Removed Mockito dependency from pom.xml. * Add Mockito and Byte Buddy dependencies for JRE 8 * Update pom.xml
1 parent 652d4b9 commit 74d1072

File tree

18 files changed

+92
-50
lines changed

18 files changed

+92
-50
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
xSQLv14 - - - - - - For tests not compatible with SQL Server 2016 - 2017
4040
xSQLv15 - - - - - - For tests not compatible with SQL Server 2019 - - - -
4141
xSQLv16 - - - - - - For tests not compatible with SQL Server 2022 - - - -
42+
xSQLv17 - - - - - - For tests not compatible with SQL Server 2025 - - - -
4243
xAzureSQLDB - - - - For tests not compatible with Azure SQL Database - -
4344
xAzureSQLDW - - - - For tests not compatible with Azure Data Warehouse -
4445
xAzureSQLMI - - - - For tests not compatible with Azure SQL Managed Instance

src/test/java/com/microsoft/sqlserver/jdbc/AlwaysEncrypted/MSITest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class MSITest extends AESetup {
5454
@Tag(Constants.xSQLv14)
5555
@Tag(Constants.xSQLv15)
5656
@Tag(Constants.xSQLv16)
57+
@Tag(Constants.xSQLv17)
5758
@Test
5859
public void testManagedIdentityAuth() throws SQLException {
5960
String connStr = connectionString;
@@ -82,6 +83,7 @@ private void testSimpleConnect(String connStr) {
8283
@Tag(Constants.xSQLv14)
8384
@Tag(Constants.xSQLv15)
8485
@Tag(Constants.xSQLv16)
86+
@Tag(Constants.xSQLv17)
8587
@Test
8688
public void testManagedIdentityAuthWithManagedIdentityClientId() throws SQLException {
8789
String connStr = connectionString;
@@ -121,6 +123,7 @@ public void testManagedIdentityAuthWithManagedIdentityClientId() throws SQLExcep
121123
@Tag(Constants.xSQLv14)
122124
@Tag(Constants.xSQLv15)
123125
@Tag(Constants.xSQLv16)
126+
@Tag(Constants.xSQLv17)
124127
@Test
125128
public void testDSManagedIdentityAuth() throws SQLException {
126129
String connStr = connectionString;
@@ -147,6 +150,7 @@ public void testDSManagedIdentityAuth() throws SQLException {
147150
@Tag(Constants.xSQLv14)
148151
@Tag(Constants.xSQLv15)
149152
@Tag(Constants.xSQLv16)
153+
@Tag(Constants.xSQLv17)
150154
@Test
151155
public void testDSManagedIdentityAuthWithManagedIdentityClientId() throws SQLException {
152156
String connStr = connectionString;
@@ -176,6 +180,7 @@ public void testDSManagedIdentityAuthWithManagedIdentityClientId() throws SQLExc
176180
@Tag(Constants.xSQLv14)
177181
@Tag(Constants.xSQLv15)
178182
@Tag(Constants.xSQLv16)
183+
@Tag(Constants.xSQLv17)
179184
@Test
180185
public void testActiveDirectoryDefaultAuth() throws SQLException {
181186
String connStr = connectionString;
@@ -196,6 +201,7 @@ public void testActiveDirectoryDefaultAuth() throws SQLException {
196201
@Tag(Constants.xSQLv14)
197202
@Tag(Constants.xSQLv15)
198203
@Tag(Constants.xSQLv16)
204+
@Tag(Constants.xSQLv17)
199205
@Test
200206
public void testActiveDirectoryDefaultAuthDS() throws SQLException {
201207
String connStr = connectionString;
@@ -500,3 +506,4 @@ public void registerAKVProvider() throws Exception {
500506
}
501507
}
502508
}
509+

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ public void testEncryptedConnection() throws SQLException {
392392
@Tag(Constants.xSQLv12)
393393
@Tag(Constants.xSQLv14)
394394
@Tag(Constants.xSQLv15)
395+
@Tag(Constants.xSQLv17)
395396
@Tag(Constants.xAzureSQLDW)
396397
@Tag(Constants.xAzureSQLDB)
397398
@Test
@@ -1537,6 +1538,7 @@ public void testGetSqlFedAuthTokenFailureNagativeWaiting() throws SQLException {
15371538
@Tag(Constants.xSQLv14)
15381539
@Tag(Constants.xSQLv15)
15391540
@Tag(Constants.xSQLv16)
1541+
@Tag(Constants.xSQLv17)
15401542
public void testManagedIdentityWithEncryptStrict() {
15411543
SQLServerDataSource ds = new SQLServerDataSource();
15421544

src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyCSVTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
import com.microsoft.sqlserver.jdbc.TestUtils;
4545
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
4646
import com.microsoft.sqlserver.testframework.AbstractTest;
47-
import com.microsoft.sqlserver.testframework.AzureDB;
4847
import com.microsoft.sqlserver.testframework.Constants;
4948
import com.microsoft.sqlserver.testframework.DBConnection;
5049
import com.microsoft.sqlserver.testframework.DBResultSet;
5150
import com.microsoft.sqlserver.testframework.DBStatement;
5251
import com.microsoft.sqlserver.testframework.DBTable;
52+
import com.microsoft.sqlserver.testframework.vectorJsonTest;
5353
import com.microsoft.sqlserver.testframework.sqlType.SqlType;
5454

5555
import microsoft.sql.Vector;
@@ -525,7 +525,7 @@ public void testBulkCopyTabDelimitedWithQuotes() throws Exception {
525525
* It verifies that the data is copied correctly by comparing the values in the table with the expected values.
526526
*/
527527
@Test
528-
@AzureDB
528+
@vectorJsonTest
529529
@DisplayName("Test Bulk Copy with JSON Data")
530530
@Tag(Constants.JSONTest)
531531
public void testBulkCopyWithJson() throws Exception {
@@ -685,7 +685,7 @@ public void testBulkCopyWithComputedColumnNotAsLastColumn() throws SQLException
685685
* BulkCopyCSVTestInputWithVector.csv file
686686
*/
687687
@Test
688-
@AzureDB
688+
@vectorJsonTest
689689
@Tag(Constants.vectorTest)
690690
public void testBulkCopyVectorFromCSV() throws SQLException {
691691
String dstTable = AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("dstTableBulkCopyVectorCsv"));
@@ -763,7 +763,7 @@ public void testBulkCopyVectorFromCSV() throws SQLException {
763763
* BulkCopyCSVTestInputWithMultipleVectorColumn.csv file
764764
*/
765765
@Test
766-
@AzureDB
766+
@vectorJsonTest
767767
@Tag(Constants.vectorTest)
768768
public void testBulkCopyVectorFromCSVWithMultipleColumns() throws SQLException {
769769
String dstTable = AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("dstTableVectorCsvMulti"));
@@ -831,7 +831,7 @@ public void testBulkCopyVectorFromCSVWithMultipleColumns() throws SQLException {
831831
* BulkCopyCSVTestWithMultipleVectorColumnWithPipeDelimiter.csv file
832832
*/
833833
@Test
834-
@AzureDB
834+
@vectorJsonTest
835835
@Tag(Constants.vectorTest)
836836
public void testBulkCopyVectorFromCSVWithMultipleColumnsWithPipeDelimiter() throws SQLException {
837837
String dstTable = AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("dstTableBulkCopyVectorCsvMultiPipe"));
@@ -899,7 +899,7 @@ public void testBulkCopyVectorFromCSVWithMultipleColumnsWithPipeDelimiter() thro
899899
* metadata.
900900
*/
901901
@Test
902-
@AzureDB
902+
@vectorJsonTest
903903
@Tag(Constants.vectorTest)
904904
public void testBulkCopyVectorFromCSVWithIncorrectDimension() throws SQLException {
905905
String dstTable = AbstractSQLGenerator.escapeIdentifier(RandomUtil.getIdentifier("dstTableBulkCopyVectorCsvBadDim"));

src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
import com.microsoft.sqlserver.jdbc.TestUtils;
4343
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
4444
import com.microsoft.sqlserver.testframework.AbstractTest;
45-
import com.microsoft.sqlserver.testframework.AzureDB;
4645
import com.microsoft.sqlserver.testframework.Constants;
4746
import com.microsoft.sqlserver.testframework.DBConnection;
4847
import com.microsoft.sqlserver.testframework.DBStatement;
4948
import com.microsoft.sqlserver.testframework.DBTable;
49+
import com.microsoft.sqlserver.testframework.vectorJsonTest;
5050
import com.microsoft.sqlserver.testframework.sqlType.SqlType;
5151

5252
import microsoft.sql.Vector;
@@ -162,7 +162,7 @@ public void testBulkCopyDateTimePrecision() throws SQLException {
162162
* Test bulk copy with a single Vector row.
163163
*/
164164
@Test
165-
@AzureDB
165+
@vectorJsonTest
166166
@Tag(Constants.vectorTest)
167167
public void testBulkCopyVector() throws SQLException {
168168
String dstTable = TestUtils
@@ -201,7 +201,7 @@ public void testBulkCopyVector() throws SQLException {
201201
* Test bulk copy with a single JSON row.
202202
*/
203203
@Test
204-
@AzureDB
204+
@vectorJsonTest
205205
@Tag(Constants.JSONTest)
206206
public void testBulkCopyJSON() throws SQLException {
207207
String dstTable = TestUtils
@@ -236,7 +236,7 @@ public void testBulkCopyJSON() throws SQLException {
236236
* Test bulk copy with empty JSON document
237237
*/
238238
@Test
239-
@AzureDB
239+
@vectorJsonTest
240240
@Tag(Constants.JSONTest)
241241
public void testBulkCopyWithEmptyJsonDocument() throws SQLException {
242242
String dstTable = TestUtils
@@ -276,7 +276,7 @@ public void testBulkCopyWithEmptyJsonDocument() throws SQLException {
276276
* and compared using getString(columnIndex)
277277
*/
278278
@Test
279-
@AzureDB
279+
@vectorJsonTest
280280
@Tag(Constants.JSONTest)
281281
public void testBulkCopyMultipleJsonRowsWithDifferentStructures() throws SQLException {
282282
String dstTable = TestUtils
@@ -319,7 +319,7 @@ public void testBulkCopyMultipleJsonRowsWithDifferentStructures() throws SQLExce
319319
* Test bulk copy with multiple JSON rows.
320320
*/
321321
@Test
322-
@AzureDB
322+
@vectorJsonTest
323323
@Tag(Constants.JSONTest)
324324
public void testBulkCopyMultipleJsonRows() throws SQLException {
325325
String dstTable = TestUtils
@@ -362,7 +362,7 @@ public void testBulkCopyMultipleJsonRows() throws SQLException {
362362
* Test bulk copy with multiple JSON rows and columns.
363363
*/
364364
@Test
365-
@AzureDB
365+
@vectorJsonTest
366366
@Tag(Constants.JSONTest)
367367
public void testBulkCopyMultipleJsonRowsAndColumns() throws SQLException {
368368
String dstTable = TestUtils
@@ -405,7 +405,7 @@ public void testBulkCopyMultipleJsonRowsAndColumns() throws SQLException {
405405
* Test bulk copy with sendStringParametersAsUnicode set to true and false for JSON column.
406406
*/
407407
@Test
408-
@AzureDB
408+
@vectorJsonTest
409409
@Tag(Constants.JSONTest)
410410
public void testBulkCopyWithSendStringParametersAsUnicode() throws SQLException {
411411
// Unicode scenario
@@ -465,7 +465,7 @@ public void testBulkCopyWithSendStringParametersAsUnicode() throws SQLException
465465
* Test bulk copy with nested JSON documents.
466466
*/
467467
@Test
468-
@AzureDB
468+
@vectorJsonTest
469469
@Tag(Constants.JSONTest)
470470
public void testBulkCopyNestedJsonRows() throws SQLException {
471471
String dstTable = TestUtils
@@ -508,7 +508,7 @@ public void testBulkCopyNestedJsonRows() throws SQLException {
508508
* Test bulk copy with various data types in JSON.
509509
*/
510510
@Test
511-
@AzureDB
511+
@vectorJsonTest
512512
@Tag(Constants.JSONTest)
513513
public void testBulkCopyWithVariousDataTypes() throws SQLException {
514514
String dstTable = TestUtils
@@ -547,7 +547,7 @@ public void testBulkCopyWithVariousDataTypes() throws SQLException {
547547
* Test bulk copy with count verification.
548548
*/
549549
@Test
550-
@AzureDB
550+
@vectorJsonTest
551551
@Tag(Constants.JSONTest)
552552
public void testBulkCopyWithCountVerification() throws SQLException {
553553
String dstTable = TestUtils
@@ -597,7 +597,7 @@ public void testBulkCopyWithCountVerification() throws SQLException {
597597
* to destination table with VECTOR column.
598598
*/
599599
@Test
600-
@AzureDB
600+
@vectorJsonTest
601601
@Tag(Constants.vectorTest)
602602
public void testBulkCopyTableToTableJsonToVector() throws Exception {
603603
String srcTable = TestUtils.escapeSingleQuotes(
@@ -669,7 +669,7 @@ private static Object[] parseJsonArrayToFloatArray(String json) {
669669
* Test bulk copy with null Vector data.
670670
*/
671671
@Test
672-
@AzureDB
672+
@vectorJsonTest
673673
@Tag(Constants.vectorTest)
674674
public void testBulkCopyVectorNull() throws SQLException {
675675
String dstTable = TestUtils
@@ -715,7 +715,7 @@ public void testBulkCopyVectorNull() throws SQLException {
715715
* incompatible with vector".
716716
*/
717717
@Test
718-
@AzureDB
718+
@vectorJsonTest
719719
@Tag(Constants.vectorTest)
720720
public void testBulkCopyVectorUsingBulkCopySourceAsVarBinary() {
721721
String varbinaryTable = TestUtils
@@ -777,7 +777,7 @@ public void testBulkCopyVectorUsingBulkCopySourceAsVarBinary() {
777777
* incompatible with varbinary(max)".
778778
*/
779779
@Test
780-
@AzureDB
780+
@vectorJsonTest
781781
@Tag(Constants.vectorTest)
782782
public void testBulkCopyVectorUsingBulkCopyDestinationAsVarBinary() {
783783
String vectorTable = TestUtils.escapeSingleQuotes(AbstractSQLGenerator.escapeIdentifier("testVectorTable"));
@@ -845,7 +845,7 @@ public void testBulkCopyVectorUsingBulkCopyDestinationAsVarBinary() {
845845
* The operation should succeed, and the data should be validated.
846846
*/
847847
@Test
848-
@AzureDB
848+
@vectorJsonTest
849849
@Tag(Constants.vectorTest)
850850
public void testBulkCopyVectorUsingBulkCopySourceAsVarchar() {
851851
String varcharTable = TestUtils.escapeSingleQuotes(AbstractSQLGenerator.escapeIdentifier("testVarcharTable"));
@@ -913,7 +913,7 @@ public void testBulkCopyVectorUsingBulkCopySourceAsVarchar() {
913913
* The operation should succeed, and the data should be validated.
914914
*/
915915
@Test
916-
@AzureDB
916+
@vectorJsonTest
917917
@Tag(Constants.vectorTest)
918918
public void testBulkCopyVectorUsingBulkCopyDestinationAsVarchar() {
919919
String vectorTable = TestUtils.escapeSingleQuotes(AbstractSQLGenerator.escapeIdentifier("testVectorTable"));
@@ -984,7 +984,7 @@ public void testBulkCopyVectorUsingBulkCopyDestinationAsVarchar() {
984984
* The operation should fail with an error: "The vector dimensions 3 and 4 do not match."
985985
*/
986986
@Test
987-
@AzureDB
987+
@vectorJsonTest
988988
@Tag(Constants.vectorTest)
989989
public void testBulkCopyVectorWithMismatchedDimensions() {
990990
String srcTable = TestUtils.escapeSingleQuotes(AbstractSQLGenerator.escapeIdentifier("testSrcTable"));
@@ -1043,7 +1043,7 @@ public void testBulkCopyVectorWithMismatchedDimensions() {
10431043
* Test bulk copy with a large number of records to check performance.
10441044
*/
10451045
@Test
1046-
@AzureDB
1046+
@vectorJsonTest
10471047
@Tag(Constants.vectorTest)
10481048
public void testBulkCopyPerformance() throws SQLException {
10491049
String tableName = AbstractSQLGenerator.escapeIdentifier("srcTable");

src/test/java/com/microsoft/sqlserver/jdbc/callablestatement/CallableStatementTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
import com.microsoft.sqlserver.jdbc.TestUtils;
5555
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
5656
import com.microsoft.sqlserver.testframework.AbstractTest;
57-
import com.microsoft.sqlserver.testframework.AzureDB;
5857
import com.microsoft.sqlserver.testframework.Constants;
5958
import com.microsoft.sqlserver.testframework.PrepUtil;
59+
import com.microsoft.sqlserver.testframework.vectorJsonTest;
6060

6161

6262
/**
@@ -670,7 +670,7 @@ public void testTimestampStringConversion() throws SQLException {
670670
* @throws SQLException
671671
*/
672672
@Test
673-
@AzureDB
673+
@vectorJsonTest
674674
@Tag(Constants.JSONTest)
675675
public void testJSONColumnInTableWithSetObject() throws SQLException {
676676

src/test/java/com/microsoft/sqlserver/jdbc/databasemetadata/DatabaseMetaDataTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
import com.microsoft.sqlserver.jdbc.TestUtils;
5757
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
5858
import com.microsoft.sqlserver.testframework.AbstractTest;
59-
import com.microsoft.sqlserver.testframework.AzureDB;
6059
import com.microsoft.sqlserver.testframework.Constants;
60+
import com.microsoft.sqlserver.testframework.vectorJsonTest;
6161

6262

6363
/**
@@ -1092,7 +1092,7 @@ public void testGetSchemasWithAndWithoutCatalog() throws SQLException {
10921092
* @throws SQLException
10931093
*/
10941094
@Test
1095-
@AzureDB
1095+
@vectorJsonTest
10961096
@Tag(Constants.vectorTest)
10971097
public void testVectorMetaData() throws SQLException {
10981098
String vectorTableName = RandomUtil.getIdentifier("vectorTable");
@@ -1160,7 +1160,7 @@ public void testVectorMetaData() throws SQLException {
11601160
* @throws SQLException
11611161
*/
11621162
@Test
1163-
@AzureDB
1163+
@vectorJsonTest
11641164
@Tag(Constants.JSONTest)
11651165
public void testJSONMetaData() throws SQLException {
11661166
String jsonTableName = RandomUtil.getIdentifier("try_SQLJSON_Table");

src/test/java/com/microsoft/sqlserver/jdbc/datatypes/JSONFunctionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
import com.microsoft.sqlserver.jdbc.TestUtils;
4343
import com.microsoft.sqlserver.testframework.AbstractSQLGenerator;
4444
import com.microsoft.sqlserver.testframework.AbstractTest;
45-
import com.microsoft.sqlserver.testframework.AzureDB;
4645
import com.microsoft.sqlserver.testframework.Constants;
46+
import com.microsoft.sqlserver.testframework.vectorJsonTest;
4747

4848
@RunWith(JUnitPlatform.class)
4949
@DisplayName("Test Json Functions")
50-
@AzureDB
50+
@vectorJsonTest
5151
@Tag(Constants.JSONTest)
5252
public class JSONFunctionTest extends AbstractTest {
5353

0 commit comments

Comments
 (0)