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

Comparison API in assertj module #129

Merged
merged 13 commits into from Aug 2, 2018

Conversation

Projects
None yet
3 participants
@krystiankaluzny
Member

krystiankaluzny commented Jul 29, 2018

PR provide CompareAssert that is equivalent for CompareMatcher

From now xmlunit-assert module covers same features as xmlunit-matchers.
And for now I don't have a plan for further development.

@krystiankaluzny krystiankaluzny requested a review from bodewig Jul 29, 2018

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jul 29, 2018

Coverage Status

Coverage decreased (-0.6%) to 91.338% when pulling 318130c on assertj-support into f6a8ccd on master.

coveralls commented Jul 29, 2018

Coverage Status

Coverage decreased (-0.6%) to 91.338% when pulling 318130c on assertj-support into f6a8ccd on master.

@bodewig

Great work, many thanks!

I'm not really familiar with AssertJ's philosophy but I would have expected areNotSimilar in addition to areDifferent.

Some of the new test classes lack the license header and we may want to look into test coverage later (I'm not sure Coveralls caught your follow up commit).

@bodewig bodewig referenced this pull request Jul 30, 2018

Closed

Support AssertJ #117

@krystiankaluzny

This comment has been minimized.

Show comment
Hide comment
@krystiankaluzny

krystiankaluzny Jul 30, 2018

Member

In AssertJ there are examples of pair of methods that do same things, but have different names
So if yout think that areNotSimilar is more appropriate, I don't see any reason not to add that method.

I can also add areNotIdentical aka similar or completely different.

I notice that Coveralls have problem with try-catch blocks that look like below and it is main reason of decreasing coverage.

try {
	do()
} catch(Exception e) {
	throwMessage()
}

...
void throwMessage() {
	thorw new AssertError()
}

I have to admit that I didn't write tests for all CompareAssert's methods :)
Most of that methods delegate work to DiffBuilder, so I decide that it's pointless to write the same tests as in DiffBuilderTest. I can cover this gap if you wish.

Of course missing license headers will be added.

Member

krystiankaluzny commented Jul 30, 2018

In AssertJ there are examples of pair of methods that do same things, but have different names
So if yout think that areNotSimilar is more appropriate, I don't see any reason not to add that method.

I can also add areNotIdentical aka similar or completely different.

I notice that Coveralls have problem with try-catch blocks that look like below and it is main reason of decreasing coverage.

try {
	do()
} catch(Exception e) {
	throwMessage()
}

...
void throwMessage() {
	thorw new AssertError()
}

I have to admit that I didn't write tests for all CompareAssert's methods :)
Most of that methods delegate work to DiffBuilder, so I decide that it's pointless to write the same tests as in DiffBuilderTest. I can cover this gap if you wish.

Of course missing license headers will be added.

@bodewig

This comment has been minimized.

Show comment
Hide comment
@bodewig

bodewig Jul 31, 2018

Member

Sorry, of course areNotSimilar and areDifferent do the same, my fault. What I really wanted to ask is for having areNotIdentical as you suggest. I really was only asking whether it would be a good idea to have two negative assertions to go with the two positive assertions.

As for coverage I really haven't checked where coveralls currently thinks we lack tests, if it is a false positive, then we'll simply have to accept it.

Member

bodewig commented Jul 31, 2018

Sorry, of course areNotSimilar and areDifferent do the same, my fault. What I really wanted to ask is for having areNotIdentical as you suggest. I really was only asking whether it would be a good idea to have two negative assertions to go with the two positive assertions.

As for coverage I really haven't checked where coveralls currently thinks we lack tests, if it is a false positive, then we'll simply have to accept it.

krystiankaluzny added some commits Aug 2, 2018

Add new assert methods
- areNotIdentical
- areNotSimilar in place of areDifferent
@bodewig

This comment has been minimized.

Show comment
Hide comment
@bodewig

bodewig Aug 2, 2018

Member

still looks good to me :-)

Please merge the PR yourself when you consider it ready as I'm not as available as usual right now.

Member

bodewig commented Aug 2, 2018

still looks good to me :-)

Please merge the PR yourself when you consider it ready as I'm not as available as usual right now.

@krystiankaluzny krystiankaluzny merged commit 76226ec into master Aug 2, 2018

2 of 3 checks passed

coverage/coveralls Coverage decreased (-0.6%) to 91.338%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@bodewig

This comment has been minimized.

Show comment
Hide comment
@bodewig

bodewig Aug 7, 2018

Member

@krystiankaluzny do you think we can close #117 now or is there anything left you'd like to add?

Member

bodewig commented Aug 7, 2018

@krystiankaluzny do you think we can close #117 now or is there anything left you'd like to add?

@krystiankaluzny

This comment has been minimized.

Show comment
Hide comment
@krystiankaluzny

krystiankaluzny Aug 7, 2018

Member

The only thing I'm going to do is write user guide page. If you don't mind I would leave the issue open until then.

Member

krystiankaluzny commented Aug 7, 2018

The only thing I'm going to do is write user guide page. If you don't mind I would leave the issue open until then.

@bodewig

This comment has been minimized.

Show comment
Hide comment
@bodewig

bodewig Aug 8, 2018

Member

Sure, fine with me. I hope to carve out some time this week and write a few additional tests - because it is my way of understanding APIs and not (only) to improve some silly stats.

Member

bodewig commented Aug 8, 2018

Sure, fine with me. I hope to carve out some time this week and write a few additional tests - because it is my way of understanding APIs and not (only) to improve some silly stats.

@krystiankaluzny krystiankaluzny deleted the assertj-support branch Aug 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment