Replace try-catch constructs in tests with assertThrows#215
Merged
garydgregory merged 3 commits intoapache:masterfrom Jan 11, 2025
strangelookingnerd:improve_assertions
Merged
Replace try-catch constructs in tests with assertThrows#215garydgregory merged 3 commits intoapache:masterfrom strangelookingnerd:improve_assertions
garydgregory merged 3 commits intoapache:masterfrom
strangelookingnerd:improve_assertions
Conversation
raboof
reviewed
Jan 9, 2025
Member
raboof
left a comment
There was a problem hiding this comment.
Overall these seem like very nice improvements, thanks!
I added some minor questions - I'm not too familiar with the codebase yet so these are not necessarily criticisms of the PR, but more for my understanding ;)
src/test/java/org/apache/commons/jxpath/issues/JXPath113Test.java
Outdated
Show resolved
Hide resolved
raboof
approved these changes
Jan 9, 2025
Member
raboof
left a comment
There was a problem hiding this comment.
Nice, LGTM! There's one failing GHA job, but that one's marked 'experimental', I think that means we don't expect it to pass.
garydgregory
requested changes
Jan 10, 2025
Member
garydgregory
left a comment
There was a problem hiding this comment.
Hello @strangelookingnerd
Thank you for updating the PR. I have the same comments as before though, see embedded comments.
src/test/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImplTestCase.java
Outdated
Show resolved
Hide resolved
src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/apache/commons/jxpath/ri/model/beans/BadlyImplementedFactoryTest.java
Show resolved
Hide resolved
garydgregory
approved these changes
Jan 11, 2025
garydgregory
added a commit
that referenced
this pull request
Jan 11, 2025
This file contains hidden or 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
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.
As requested in #214 (comment)
try-catchconstructs withassertThrowsandassertDoesNotThrowVerified with
mvn clean verifythat build passes before and after my changes.Overall number of tests and coverage did not change.