Skip to content

Use JUnit5 conditions to disable some tests on CI server#3457

Merged
tobiasdiez merged 2 commits into
masterfrom
junitConditions
Nov 26, 2017
Merged

Use JUnit5 conditions to disable some tests on CI server#3457
tobiasdiez merged 2 commits into
masterfrom
junitConditions

Conversation

@tobiasdiez

Copy link
Copy Markdown
Member

Instead of assumptions, we can now disable tests on the CI server using a new @DisabledOnCIServer annotation. I converted the fetcher tests affected to junit 5.
Moreover, I extracted some common tests (null / empty) to a new parametrized fulltextfetcher class.


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?

@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 25, 2017

@lenhard lenhard 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.

Why do you reduce the visibility of some of the test methods? I mean a tight scope for visibility is nice, but JUnit 4 tests have more or less been public by convention. Is there something in JUnit 5 that changes this? In any case, it should be consistent within the tests and in this PR some are changed to default visibility, whereas others are kept.

@tobiasdiez

Copy link
Copy Markdown
Member Author

Good question! IntelliJ warned about it and this is why I changed it. If you look that the examples from the JUnit team, they also always use the default visibility (e.g. here).
With junit 4 all tests had to be public and this restriction was removed in the new version.

I have no strong opinion about this.

@lenhard

lenhard commented Nov 26, 2017

Copy link
Copy Markdown
Member

In that case, I'd say we go for default visibility in all JUnit5 tests, regardless of whether they're new or migrated from a JUnit4 tests.

@tobiasdiez

Copy link
Copy Markdown
Member Author

Ok, I now used the default visibility everywhere.

@tobiasdiez tobiasdiez merged commit 9e2c010 into master Nov 26, 2017
@tobiasdiez tobiasdiez deleted the junitConditions branch November 26, 2017 17:56
@Siedlerchr

Copy link
Copy Markdown
Member

Default Visibility is normally considered an anti pattern and is marked by coday:
DefaultPackage

Since: PMD 3.4

Use explicit scoping instead of the default package private level.

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

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants