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

Adding a new test for beginRequest()/endRequest() #746

Merged
merged 3 commits into from
Jul 12, 2018

Conversation

ulvii
Copy link
Contributor

@ulvii ulvii commented Jul 12, 2018

The goal is to make the build fail if there are new public non-static methods in SQLServerConnection and notify the developer to decide whether it needs to be handled by beginRequest()/endRequest().

@codecov-io
Copy link

codecov-io commented Jul 12, 2018

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #746      +/-   ##
============================================
+ Coverage     48.35%   48.39%   +0.03%     
- Complexity     2775     2776       +1     
============================================
  Files           116      116              
  Lines         27871    27871              
  Branches       4631     4631              
============================================
+ Hits          13478    13488      +10     
+ Misses        12210    12199      -11     
- Partials       2183     2184       +1
Flag Coverage Δ Complexity Δ
#JDBC42 47.86% <ø> (ø) 2735 <ø> (+3) ⬆️
#JDBC43 48.27% <ø> (+0.06%) 2768 <ø> (+2) ⬆️
Impacted Files Coverage Δ Complexity Δ
...om/microsoft/sqlserver/jdbc/SQLServerBulkCopy.java 52.6% <0%> (ø) 262% <0%> (ø) ⬇️
...in/java/com/microsoft/sqlserver/jdbc/IOBuffer.java 53.83% <0%> (+0.09%) 0% <0%> (ø) ⬇️
...m/microsoft/sqlserver/jdbc/SQLServerResultSet.java 32.34% <0%> (+0.11%) 249% <0%> (+1%) ⬆️
...ncurrentlinkedhashmap/ConcurrentLinkedHashMap.java 39% <0%> (+0.21%) 43% <0%> (ø) ⬇️
...rc/main/java/com/microsoft/sqlserver/jdbc/DDC.java 45.95% <0%> (+0.65%) 107% <0%> (ø) ⬇️

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 594e413...fe9b9f8. Read the comment docs.


private boolean isVerified(Method method) {
return (!Modifier.isPublic(method.getModifiers()) || Modifier.isStatic(method.getModifiers())
|| method.getName().startsWith("get") || getVerifiedMethodNames().contains(method.getName()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we allow any method that starts with "get" to be verified? if I added a new connection property and added a public getter for it, isn't it something that the boundary request method needs to handle? (it would likely get caught by the setter that comes with it, though)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of beginRequest() is to "memorize" the connection state and its properties. Getting a connection property doesn't affect the properties so it shouldn't matter. On the other hand, it is kind of hacky and I wouldn't be opposed to triggering this error on all newly added public methods, just to be safe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, a getter won't change the connection local state. And I didn't want to hard-code all of them in the test.

@ulvii ulvii merged commit 521e6b3 into microsoft:dev Jul 12, 2018
@ulvii ulvii deleted the reqBoundary branch July 12, 2018 18:51
@cheenamalhotra cheenamalhotra added this to the 7.0.0 milestone Jul 13, 2018
cheenamalhotra added a commit that referenced this pull request Jul 31, 2018
* Update Snapshot for upcoming RTW release v7.0.0

* Change order of logic for checking the condition for using Bulk Copy API (#736)

Fix | Change order of logic for checking the condition for using Bulk Copy API (#736)

* Update CHANGELOG.md

* Merge pull request #732 from cheenamalhotra/module (Export driver in automatic module)

Introduce Automatic Module Name in POM.

* Update CHANGELOG.md

* Change Sha1HashKey to CityHash128Key for generating PreparedStatement handle and metadata cache keys (#717)

* Change Sha1HashKey to CityHash128Key

* Formatted code

* Prepared statement performance fixes

1) Further speedups to prepared statement hashing

2) Caching of '?' chararacter positiobs in prepared statements to speed parameter substitution

* String compare for hash keys
added missing line for bulkcopy tests.

* comment change

* Move CityHash class to a separate file

* spacings fixes
cleaner code & logic

* Add | Adding useBulkCopyForBatchInsert property to Request Boundary methods (#739)

* Apply the collation name change to UTF8SupportTest

* Package changes for CityHash with license information (#740)

* Reformatted Code + Updated formatter (#742)

* Reformatted Code + Updated formatter

* Fix policheck issue with 'Country' keyword (#745)

* Adding a new test for beginRequest()/endRequest() (#746)

* Add | Adding a new test to notify the developers to consider beginRequest()/endRequest() when adding a new Connection API

* Fix | Fixes for issues reported by static analysis tools (SonarQube + Fortify) (#747)

* handle buffer reading

for invalid buffer input by user

* Revert "handle buffer reading"

This reverts commit 11e2bf4.

* updated javadocs (#754)

* fixed some typos in javadocs (#760)

* API and JavaDoc changes for Spatial Datatypes (#752)

Add | API and JavaDoc changes for Spatial Datatypes (#752)

* Disallow non-parameterized queries for Bulk Copy API for batch insert (#756)

fix | Disallow non-parameterized queries for Bulk Copy API for batch insert (#756)

* Formatting | Change scope of unwanted Public APIs + Code Format (#757)

* Fix unwanted Public APIs.
* Updated formatter to add new line to EOF + formatted project

* Release | Release 7.0 changelog and version update (#748)

* Updated Changelog + release version changes

* Changelog entry updated as per review.

* Updated changelog for new changes

* Terminology update: request boundary declaration APIs

* Trigger Appveyor

* Update Samples and add new samples for new features (#761)

* Update Samples and add new Samples for new features

* Update samples from Peter

* Updated JavaDocs

* Switch to block comment

* Update License copyright (#767)
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