You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/03/27 21:25:35 UTC
[GitHub] [commons-collections] pradeesh-kumar opened a new pull request #295: COLLECTIONS-807 - Upgraded org.junit.Test to org.junit.jupiter.api.Test
pradeesh-kumar opened a new pull request #295:
URL: https://github.com/apache/commons-collections/pull/295
**Jira:** https://issues.apache.org/jira/browse/COLLECTIONS-807
**Description:** COLLECTIONS-807 is a subtask of the main task [COLLECTIONS-777-Fully migrate to JUnit 5](https://issues.apache.org/jira/browse/COLLECTIONS-777)
**Subtask COLLECTIONS-807 description:** Upgrade org.junit.Test to org.junit.jupiter.api.Test
**Major Changes**
1. pom.xml
Added the dependency _junit-jupiter-params_ in order to fix the parameterized test case issues after upgrading the Test annotation in the classes AbstractPropertiesFactoryTest.java, SortedPropertiesFactoryTest.java, PropertiesFactoryTest.java
```
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${commons.junit.version}</version>
<scope>test</scope>
</dependency>
```
2. Annotated setup() methods with @BeforeEach annotation
Example:
```
@Override
public void setUp() {
testList = new ArrayList<>();
testList.addAll(Arrays.asList(testArray));
}
```
Rewritten to
```
@BeforeEach
public void setUp() {
testList = new ArrayList<>();
testList.addAll(Arrays.asList(testArray));
}
```
3. Removed the String parameter testName from all the Junit test classes.
Reason: Junit below 5 was supporting the constructor to have a String parameter, which will be injected with the current Display name of the test case being run. This is no more supported in JUnit 5. Since JUnit 5, a constructor with arguments is considered to as a Parameterized test case. To remove the test execution issue after upgrading the annotation, removed the parameter from constructor, instead pass the current class name (which is equal to the test case name) to the super classes.
```
public BooleanComparatorTest(String testName) {
super(testName);
}
```
Rewritten as
```
public BooleanComparatorTest() {
super(BooleanComparatorTest.class.getSimpleName());
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-collections] pradeesh-kumar commented on pull request #295: COLLECTIONS-807 - Upgraded org.junit.Test to org.junit.jupiter.api.Test
Posted by GitBox <gi...@apache.org>.
pradeesh-kumar commented on pull request #295:
URL: https://github.com/apache/commons-collections/pull/295#issuecomment-1082698011
How to run workflows?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-collections] codecov-commenter commented on pull request #295: COLLECTIONS-807 - Upgraded org.junit.Test to org.junit.jupiter.api.Test
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #295:
URL: https://github.com/apache/commons-collections/pull/295#issuecomment-1080026056
# [Codecov](https://codecov.io/gh/apache/commons-collections/pull/295?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#295](https://codecov.io/gh/apache/commons-collections/pull/295?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5724f8f) into [master](https://codecov.io/gh/apache/commons-collections/commit/4a473e6120c6242a6c9448d289bf212431cf3b93?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4a473e6) will **not change** coverage.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #295 +/- ##
=========================================
Coverage 85.82% 85.82%
Complexity 4674 4674
=========================================
Files 292 292
Lines 13472 13472
Branches 1955 1955
=========================================
Hits 11562 11562
Misses 1330 1330
Partials 580 580
```
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/commons-collections/pull/295?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/commons-collections/pull/295?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4a473e6...5724f8f](https://codecov.io/gh/apache/commons-collections/pull/295?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [commons-collections] kinow commented on pull request #295: COLLECTIONS-807: Upgraded org.junit.Test to org.junit.jupiter.api.Test
Posted by GitBox <gi...@apache.org>.
kinow commented on pull request #295:
URL: https://github.com/apache/commons-collections/pull/295#issuecomment-1082701205
> How to run workflows?
For security reasons, GH Actions workflows are only executed if the PR is from a member of the organization or repository, or if it was created by an existing contributor. If you haven't contributed yet, the workflow is disabled until a member of the org/repo presses the Approve Workflow button (which I just did).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org