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

Fix closeable resource leaks in Junit tests #797

Merged
merged 16 commits into from
Sep 21, 2018

Conversation

lilgreenbird
Copy link
Contributor

@lilgreenbird lilgreenbird commented Aug 30, 2018

1st part of Junit test cleanup:

  • use try-with-resources on closeables and fix leaks
  • get rid shared variables between tests
  • move testframework/util/Util.java to TestUtil (part of work get rid of testframework)

@codecov-io
Copy link

codecov-io commented Aug 30, 2018

Codecov Report

Merging #797 into dev will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #797      +/-   ##
============================================
+ Coverage     48.11%   48.19%   +0.07%     
+ Complexity     2783     2781       -2     
============================================
  Files           116      116              
  Lines         27862    27862              
  Branches       4641     4641              
============================================
+ Hits          13407    13428      +21     
+ Misses        12235    12217      -18     
+ Partials       2220     2217       -3
Flag Coverage Δ Complexity Δ
#JDBC42 47.76% <ø> (+0.13%) 2739 <ø> (-2) ⬇️
#JDBC43 48.09% <ø> (+0.06%) 2779 <ø> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
...m/microsoft/sqlserver/jdbc/SQLServerException.java 75.75% <0%> (-1.52%) 30% <0%> (-1%)
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 33.21% <0%> (-0.48%) 62% <0%> (-3%)
...n/java/com/microsoft/sqlserver/jdbc/DataTypes.java 79.28% <0%> (-0.2%) 4% <0%> (-1%)
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 59.51% <0%> (-0.2%) 135% <0%> (-1%)
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 52.1% <0%> (-0.13%) 216% <0%> (-1%)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.6% <0%> (-0.06%) 263% <0%> (ø)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 62.37% <0%> (-0.06%) 0% <0%> (ø)
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 54.09% <0%> (+0.62%) 0% <0%> (ø) ⬇️
...c/main/java/com/microsoft/sqlserver/jdbc/Util.java 60.9% <0%> (+0.64%) 88% <0%> (+1%) ⬆️
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 44.63% <0%> (+0.87%) 106% <0%> (ø) ⬇️
... and 3 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 0a1759f...6b43e4c. Read the comment docs.

@cheenamalhotra cheenamalhotra modified the milestone: 7.1.1 Sep 17, 2018
@codecov-io
Copy link

Codecov Report

Merging #797 into dev will increase coverage by 0.35%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #797      +/-   ##
============================================
+ Coverage     48.11%   48.47%   +0.35%     
- Complexity     2783     2804      +21     
============================================
  Files           116      116              
  Lines         27862    27862              
  Branches       4641     4641              
============================================
+ Hits          13407    13506      +99     
+ Misses        12235    12214      -21     
+ Partials       2220     2142      -78
Flag Coverage Δ Complexity Δ
#JDBC42 47.89% <ø> (+0.26%) 2764 <ø> (+23) ⬆️
#JDBC43 48.08% <ø> (+0.05%) 2774 <ø> (-1) ⬇️
Impacted Files Coverage Δ Complexity Δ
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 33.21% <0%> (-0.48%) 62% <0%> (-3%)
...ncurrentlinkedhashmap/ConcurrentLinkedHashMap.java 38.36% <0%> (-0.44%) 42% <0%> (-1%)
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 52.1% <0%> (-0.13%) 216% <0%> (-1%)
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.54% <0%> (-0.12%) 261% <0%> (-2%)
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 62.49% <0%> (+0.05%) 0% <0%> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 59.8% <0%> (+0.09%) 141% <0%> (+5%) ⬆️
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 48.45% <0%> (+0.53%) 348% <0%> (+14%) ⬆️
...c/main/java/com/microsoft/sqlserver/jdbc/Util.java 60.9% <0%> (+0.64%) 90% <0%> (+3%) ⬆️
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 44.42% <0%> (+0.65%) 106% <0%> (ø) ⬇️
...n/java/com/microsoft/sqlserver/jdbc/tdsparser.java 68.96% <0%> (+0.86%) 0% <0%> (ø) ⬇️
... and 4 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 0a1759f...b4060e6. Read the comment docs.

@codecov-io
Copy link

Codecov Report

Merging #797 into dev will increase coverage by 0.39%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #797      +/-   ##
============================================
+ Coverage     48.11%   48.51%   +0.39%     
- Complexity     2783     2805      +22     
============================================
  Files           116      116              
  Lines         27862    27862              
  Branches       4641     4641              
============================================
+ Hits          13407    13516     +109     
+ Misses        12235    12203      -32     
+ Partials       2220     2143      -77
Flag Coverage Δ Complexity Δ
#JDBC42 47.91% <ø> (+0.29%) 2758 <ø> (+17) ⬆️
#JDBC43 48.12% <ø> (+0.1%) 2776 <ø> (+1) ⬆️
Impacted Files Coverage Δ Complexity Δ
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 33.21% <0%> (-0.48%) 62% <0%> (-3%)
...ncurrentlinkedhashmap/ConcurrentLinkedHashMap.java 38.36% <0%> (-0.44%) 42% <0%> (-1%)
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 52.1% <0%> (-0.13%) 216% <0%> (-1%)
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 32.73% <0%> (+0.03%) 255% <0%> (-1%) ⬇️
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.72% <0%> (+0.05%) 263% <0%> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 59.8% <0%> (+0.09%) 141% <0%> (+5%) ⬆️
...rc/main/java/com/microsoft/sqlserver/jdbc/dtv.java 62.6% <0%> (+0.17%) 0% <0%> (ø) ⬇️
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 48.45% <0%> (+0.53%) 348% <0%> (+14%) ⬆️
...c/main/java/com/microsoft/sqlserver/jdbc/Util.java 60.9% <0%> (+0.64%) 90% <0%> (+3%) ⬆️
...n/java/com/microsoft/sqlserver/jdbc/tdsparser.java 68.96% <0%> (+0.86%) 0% <0%> (ø) ⬇️
... and 7 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 0a1759f...b4060e6. Read the comment docs.

@cheenamalhotra cheenamalhotra changed the title tests cleanup Fix closeable resource leaks in Junit tests Sep 21, 2018
@cheenamalhotra cheenamalhotra added this to the 7.1.1 milestone Sep 21, 2018
@lilgreenbird lilgreenbird changed the title Fix closeable resource leaks in Junit tests Junit test cleanup: Sep 21, 2018
@lilgreenbird lilgreenbird changed the title Junit test cleanup: 1st part of Junit test cleanup: use try-with-resources on closeables, get rid shared variables, move testframework/util/Util.java to TestUtil (part of work get rid of testframework) Sep 21, 2018
@lilgreenbird lilgreenbird changed the title 1st part of Junit test cleanup: use try-with-resources on closeables, get rid shared variables, move testframework/util/Util.java to TestUtil (part of work get rid of testframework) 1st part of Junit test cleanup: - use try-with-resources on closeables - get rid shared variables between tests - move testframework/util/Util.java to TestUtil (part of work get rid of testframework) Sep 21, 2018
@lilgreenbird lilgreenbird changed the title 1st part of Junit test cleanup: - use try-with-resources on closeables - get rid shared variables between tests - move testframework/util/Util.java to TestUtil (part of work get rid of testframework) 1st part of Junit test cleanup: 1. use try-with-resources on closeables 2. get rid shared variables between tests 3. move testframework/util/Util.java to TestUtil (part of work get rid of testframework) Sep 21, 2018
@lilgreenbird lilgreenbird changed the title 1st part of Junit test cleanup: 1. use try-with-resources on closeables 2. get rid shared variables between tests 3. move testframework/util/Util.java to TestUtil (part of work get rid of testframework) 1st part of Junit test cleanup Sep 21, 2018
@lilgreenbird lilgreenbird changed the title 1st part of Junit test cleanup Fix closeable resource leaks in Junit tests Sep 21, 2018
@lilgreenbird lilgreenbird merged commit 550d441 into microsoft:dev Sep 21, 2018
@lilgreenbird lilgreenbird deleted the dev branch October 29, 2018 20:19
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.

4 participants