-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Cleanup some test warnings and deprecated code #369
Conversation
Signed-off-by: Raihaan Shouhell <raihaan.shouhell@autodesk.com>
src/test/java/org/jenkinsci/remoting/protocol/ProtocolStackImplTest.java
Outdated
Show resolved
Hide resolved
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.
Thanks for the submission! It's nice to get things like this cleaned up.
I left a couple of comments for possible clarification or improvement.
src/test/java/org/jenkinsci/remoting/engine/JnlpProtocolHandlerTest.java
Show resolved
Hide resolved
src/test/java/org/jenkinsci/remoting/protocol/ProtocolStackImplTest.java
Outdated
Show resolved
Hide resolved
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.
I believe there are at least two places where a try with resources should be used on an input channel in addition to the output channels.
src/test/java/hudson/remoting/DiagnosedStreamCorruptionExceptionTest.java
Outdated
Show resolved
Hide resolved
@@ -155,7 +155,7 @@ public void tearDown() { | |||
} | |||
|
|||
@Theory | |||
public void happyPath(Factory factory, boolean useNioHubServer, boolean useNioHubClient) throws Exception { | |||
public void happyPath(Factory factory, boolean useNioHubServer, boolean useNioHubClient) throws Throwable { |
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.
I don't understand the motivation for this change. Can you explain further why the throw was broadened from Exception to Throwable? The stackoverflow article indicates that Throwable is broader than Exception, but I don't understand why a caller would need to know that this Theory may throw expections which are Throwable but are not Exceptions.
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.
My IDE was complaining about it, I don't mind reverting it
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.
Reverting that would be better. I don't see that it needs to widened to Throwable.
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.
Looks like you missed changing this one back.
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.
Now I see why you needed to change this from an Exception to a Throwable. This change here changes the signature of this line here so that it now throws Throwable rather than Exception. Since it's test code, it should be okay changing the signature.
We've given you some bad advice about changing it back to Exception because we didn't understand how that other change ripples through.
This is why the build is failing.
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.
Oh well, It's all good.
The inheritance change is probably for the best so the class will advertise its exception and return type correctly
src/test/java/org/jenkinsci/remoting/protocol/ProtocolStackImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jenkinsci/remoting/protocol/impl/SSLEngineFilterLayerTest.java
Show resolved
Hide resolved
@res0nance, here are three things I think would be worth doing in this changeset.
|
Co-Authored-By: Mark Waite <mark.earl.waite@gmail.com>
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.
Looks good. Thanks again for the submission.
Signed-off-by: Raihaan Shouhell raihaan.shouhell@autodesk.com
Cleanup some of the warnings