Skip to content

CODEC-285-JUnit5#113

Merged
garydgregory merged 1 commit into
apache:masterfrom
itamarc:CODEC-285-JUnit5
Feb 22, 2022
Merged

CODEC-285-JUnit5#113
garydgregory merged 1 commit into
apache:masterfrom
itamarc:CODEC-285-JUnit5

Conversation

@itamarc

@itamarc itamarc commented Feb 20, 2022

Copy link
Copy Markdown
Contributor

I migrated all tests in commons-coded to use JUnit5.
I also dropped junit-vintage-engine from pom.xml, since it's not needed anymore.

@kinow kinow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @itamarc (olá! 👋 )

You'll have to rebase your branch, looks like there are some conflicts now 👍 After that we will likely squash the commits down to a single commit or maybe a couple meaningful commits (it'd be better if you could do it).

Thanks!
Bruno

@itamarc

itamarc commented Feb 20, 2022

Copy link
Copy Markdown
Contributor Author

Hi, @kinow (olá)

I can work on solving the conflicts and also squash the commits to one, but...

  1. I don't know how to see the conflicts, I can only see the list of files with conflicts. Maybe it's because I don't have write permission on commons-codec repository:

This branch has conflicts that must be resolved
Only those with write access to this repository can merge pull requests.
Conflicting files
(...)

(there are a "Resolve conflicts" button, but it's disabled for me)

How can I see the conflicts so I can solve them?

  1. After solving the conflicts, can I squash the commits on my own branch and it will show up on the PR?

Sorry, it's my first PR of this size. And thank you in advance for your help.

Itamar

@aherbert

Copy link
Copy Markdown
Contributor

You can fetch the master and then rebase on that. On the command line:

git fetch origin/master
git rebase origin/master

The rebase attempts to collect all your commits and apply them sequentially to the master. If this is not possible the rebase will warn about the conflicts. You then fix those locally and continue with the rebase, IIRC git rebase --continue.

Eventually you should end up with a set of changes that can be applied directly onto the master branch. You then force push the changes to this PR branch to update it: git push -f.

} catch (final EncoderException ee) {
// An exception should be thrown
}
assertThrows(EncoderException.class, () -> { encoder.encode(null); });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@itamarc
Thank you for your PR.
You do not need the curly brackets here, less clutter is better.

}
Assert.assertTrue("An exception was not thrown when we tried to encode " + "a Float object", exceptionThrown);
final StringEncoder encoder = this.getStringEncoder();
assertThrows(EncoderException.class, () -> { encoder.encode(Float.valueOf(3.4f)); },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No curlies needed; I'll assume you'll go over the other files. I'll review again after you push.

@itamarc itamarc Feb 21, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried to not change or remove any of the messages (except for typos), even if I think the message was not necessary. All I did was to change the position of the message as a parameter, since this changed from JUnit 4 to 5. My intention was to minimize the changes, and afterall, some of the messages give information about the failure of the test that the message from JUnit will not give.

I'll try to keep only meaningful messages and remove the redundant ones, that only states the test (like saying "xyz is not true" for a assertTrue test).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My comment was not about assertion messages, but about the extra {} that are superfluous.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, sorry not letting this clear. I understood and will remove them. I only commented about the messages because when I started the rebase process (as instructed by @aherbert), I noticed that some messages were removed.

} catch (final IndexOutOfBoundsException e) {
// Expected
}
assertThrows(IndexOutOfBoundsException.class, () -> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@itamarc
Same comment as for the other extra {} in other files...
TY!

unit-vintage-engine dropped from pom.xml
@itamarc

itamarc commented Feb 22, 2022

Copy link
Copy Markdown
Contributor Author

I made the rebase with the origin/master and looks like I solved all conflicts and I just squashed the commits into 1.

I also removed the extra curly braces like pointed by @garydgregory

If there are something else I need to do, please point out.

@garydgregory garydgregory merged commit 2b32ca0 into apache:master Feb 22, 2022
@itamarc itamarc deleted the CODEC-285-JUnit5 branch February 22, 2022 19:04

@daniel-tavares-osf daniel-tavares-osf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very nice work. Congratulations.

omosteven pushed a commit to omosteven/commons-codec-lab-work that referenced this pull request Jan 8, 2025
unit-vintage-engine dropped from pom.xml
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.

5 participants