Skip to content
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

Tests | Junit improvements + Organize constants #982

Merged
merged 15 commits into from
Mar 18, 2019

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotra cheenamalhotra commented Mar 11, 2019

This PR includes changes as under:

  • Manage Constants in one common class and use static reference to access them across all tests.
  • Removed magic strings and numerics in tests to use static constants instead.
  • Created getConnection() method in AbstractTest class that returns Connection using available connectionString and updated tests to use this instead of creating connection from DriverManager.
  • Updated other custom connection requests to get connection from PrepUtil class.
  • Updated e.toString() to e.getMessage()
  • Closed open statement(s) in some files.
  • Removed unused methods (we are using alternative methods to do the same stuff)
  • Organize imports + fixed warnings + cleanups.

# Conflicts:
#	src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyColumnMappingTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyConnectionTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyISQLServerBulkRecordTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/bulkCopy/BulkCopyTimeoutTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/preparedStatement/BatchExecutionWithBulkCopyTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsStreamingTest.java
#	src/test/java/com/microsoft/sqlserver/jdbc/unit/lobs/LobsTest.java
#	src/test/java/com/microsoft/sqlserver/testframework/AbstractTest.java
#	src/test/java/com/microsoft/sqlserver/testframework/DBConnection.java
# Conflicts:
#	src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java
@codecov-io
Copy link

codecov-io commented Mar 11, 2019

Codecov Report

Merging #982 into dev will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #982      +/-   ##
============================================
- Coverage     50.14%   50.08%   -0.06%     
+ Complexity     2877     2872       -5     
============================================
  Files           120      120              
  Lines         27981    27981              
  Branches       4677     4677              
============================================
- Hits          14030    14015      -15     
- Misses        11690    11712      +22     
+ Partials       2261     2254       -7
Flag Coverage Δ Complexity Δ
#JDBC42 49.69% <100%> (+0.07%) 2835 <1> (+2) ⬆️
#JDBC43 50.02% <100%> (-0.03%) 2869 <1> (-2)
Impacted Files Coverage Δ Complexity Δ
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 60.9% <ø> (ø) 137 <0> (ø) ⬇️
...om/microsoft/sqlserver/jdbc/SQLServerMetaData.java 21.81% <ø> (ø) 0 <0> (ø) ⬇️
...oft/sqlserver/jdbc/SQLServerResultSetMetaData.java 45.52% <ø> (ø) 27 <0> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerSavepoint.java 90% <ø> (ø) 10 <0> (ø) ⬇️
...n/java/com/microsoft/sqlserver/jdbc/tdsparser.java 68.1% <100%> (ø) 0 <0> (ø) ⬇️
...ava/com/microsoft/sqlserver/jdbc/SQLServerLob.java 100% <100%> (ø) 1 <1> (ø) ⬇️
...java/com/microsoft/sqlserver/jdbc/StringUtils.java 0% <0%> (-33.34%) 2% <0%> (-1%)
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 46.22% <0%> (-1.73%) 110% <0%> (-2%)
...m/microsoft/sqlserver/jdbc/SQLServerException.java 76.64% <0%> (-1.46%) 32% <0%> (-1%)
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 43.86% <0%> (-0.2%) 318% <0%> (-2%)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e4d6bc...6cb5baa. Read the comment docs.

@cheenamalhotra cheenamalhotra added this to the 7.3.0 milestone Mar 11, 2019
ulvii
ulvii previously approved these changes Mar 13, 2019
peterbae
peterbae previously approved these changes Mar 13, 2019
lilgreenbird
lilgreenbird previously approved these changes Mar 13, 2019
# Conflicts:
#	src/test/java/com/microsoft/sqlserver/jdbc/JDBC43Test.java
#	src/test/java/com/microsoft/sqlserver/jdbc/TestUtils.java
#	src/test/java/com/microsoft/sqlserver/jdbc/connection/ConnectionDriverTest.java
@cheenamalhotra cheenamalhotra dismissed stale reviews from lilgreenbird, peterbae, and ulvii via 6cb5baa March 13, 2019 22:16
@cheenamalhotra cheenamalhotra merged commit 07e01f8 into microsoft:dev Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants