-
Notifications
You must be signed in to change notification settings - Fork 427
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
Try with resources implementation in JUnit FW - Part 1 #520
Merged
cheenamalhotra
merged 8 commits into
microsoft:dev
from
cheenamalhotra:JavaImprovements
Oct 10, 2017
Merged
Try with resources implementation in JUnit FW - Part 1 #520
cheenamalhotra
merged 8 commits into
microsoft:dev
from
cheenamalhotra:JavaImprovements
Oct 10, 2017
Conversation
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
Updated docker image tag for mssql-server-linux
Updating docker run command as well.
cheenamalhotra
changed the title
Try with resources implementation - Part 1
Try with resources implementation in JUnit FW - Part 1
Oct 4, 2017
Codecov Report
@@ Coverage Diff @@
## dev #520 +/- ##
===========================================
+ Coverage 46.55% 46.65% +0.1%
- Complexity 2221 2226 +5
===========================================
Files 108 108
Lines 25316 25316
Branches 4182 4182
===========================================
+ Hits 11785 11811 +26
+ Misses 11501 11473 -28
- Partials 2030 2032 +2
Continue to review full report at Codecov.
|
AfsanehR-zz
approved these changes
Oct 10, 2017
peterbae
approved these changes
Oct 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Improvements in JUnit Tests:
try-with-resources
is available since Java 7 and must be used for defining closeable class objects eg, Connection, Statement, PreparedStatement, ResultSet, Streams, etc. It not only reduces code length, but ensures closure of objects preventing object leaks and also improves code readability. It doesn't make much impact on performance, but prevents memory leaks.try-with-resources
is avoided in places where connection and statement objects need not be re-initialized and can be reused in a single class. (A few existing classes may need to be modified to reuse connection to improve test running speed, but will be implemented as part of separate PR)Since lot of files are impacted by this change, it will be pushed in parts.