-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for JDK 10 in both Maven and Gradle #691
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
129459b
Feature | Added support for JDK 10 in both Maven and Gradle - builds …
cheenamalhotra 5a2313d
Merge branch 'ms-dev' into jdk10
cheenamalhotra 9cead24
JDK 10 | Merge 42 classes to base classes to reduce class redundancy.
cheenamalhotra bfc3c89
JDK 10 | Attempt to run JDK 10 with Appveyor
cheenamalhotra 3fc6e68
Remove unwanted space
cheenamalhotra 9a6f947
Updating Travis script to use JDK 10
cheenamalhotra 14e7359
Merge branch 'dev' into jdk10
cheenamalhotra 72382a0
Testing without addons
cheenamalhotra 5bf71bd
Update script for Jacoco report to build 43 profile
cheenamalhotra 524a105
Revert driver changes for 42 compliance - to be added in a separate PR
cheenamalhotra 6cdde48
Revert Test class changes for 42 compliance - to be done in a separat…
cheenamalhotra cab5fc5
Reformatted code
cheenamalhotra 00459dc
Add ID to jacoco plugin execution task
cheenamalhotra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionWrapper43Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Microsoft JDBC Driver for SQL Server | ||
* | ||
* Copyright(c) Microsoft Corporation All rights reserved. | ||
* | ||
* This program is made available under the terms of the MIT License. See the LICENSE file in the project root for more information. | ||
*/ | ||
package com.microsoft.sqlserver.jdbc.connection; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DatabaseMetaData; | ||
import java.sql.DriverManager; | ||
import java.sql.SQLException; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.platform.runner.JUnitPlatform; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.microsoft.sqlserver.jdbc.SQLServerConnection; | ||
import com.microsoft.sqlserver.jdbc.SQLServerConnection43; | ||
import com.microsoft.sqlserver.testframework.AbstractTest; | ||
|
||
/** | ||
* Test ConnectionWrapper43Test class | ||
* | ||
*/ | ||
@RunWith(JUnitPlatform.class) | ||
public class ConnectionWrapper43Test extends AbstractTest { | ||
static Connection connection = null; | ||
double javaVersion = Double.parseDouble(System.getProperty("java.specification.version")); | ||
static int major; | ||
static int minor; | ||
|
||
/** | ||
* Tests creation of SQLServerConnection43Test object | ||
* | ||
* @throws SQLException | ||
*/ | ||
@Test | ||
public void SQLServerConnection43Test() throws SQLException { | ||
try { | ||
if (1.8d <= javaVersion && 4 == major && 2 == minor) { | ||
assertTrue(connection instanceof SQLServerConnection); | ||
} | ||
else { | ||
assertTrue(connection instanceof SQLServerConnection43); | ||
} | ||
} | ||
finally { | ||
if (null != connection) { | ||
connection.close(); | ||
} | ||
} | ||
} | ||
|
||
@BeforeAll | ||
private static void setupConnection() throws SQLException { | ||
connection = DriverManager.getConnection(connectionString); | ||
|
||
DatabaseMetaData metadata = connection.getMetaData(); | ||
major = metadata.getJDBCMajorVersion(); | ||
minor = metadata.getJDBCMinorVersion(); | ||
} | ||
|
||
@AfterAll | ||
private static void terminateVariation() throws SQLException { | ||
if (null != connection) { | ||
connection.close(); | ||
} | ||
} | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change commenting on line 5 to java 10