Skip to content
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

Add convinient method to check for the currently used Java Version #120

Closed
wants to merge 3 commits into from

Conversation

britter
Copy link
Member

@britter britter commented Sep 10, 2016

No description provided.


public static void assumeJavaVersion(JavaVersion version)
{
assumeThat( "java.specification.version: ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice PR. Maybe SystemUtils.JAVA_SPECIFICATION_VERSION + ": instead. Do you like static imports?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey Tibor,

do you mean to use a constant instead of the string in the message part of assumeThat? There is no constant for the property name in Commons Lang. But I could introduce one in HelperAssertions or we could extend SystemUtils, but then we have to wait for the next release of Commons Lang.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added the static import.

@britter
Copy link
Member Author

britter commented Sep 17, 2016

Hello @Tibor17

I've addressed you're comment about comparing Strings. There already is an API for comparing JavaVersions in SystemUtils. Hope you like this.

assumeThat( "java.specification.version: ",
JAVA_SPECIFICATION_VERSION, is( greaterThanOrEqualTo( version.toString() ) ) );
assumeTrue( "java.specification.version: " + JAVA_SPECIFICATION_VERSION,
SystemUtils.isJavaVersionAtLeast( version ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes this is cool. Thx.
I will come back to your PRs soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am running the build mvn install -Prun-its, let's wait for the result.

@Tibor17
Copy link
Contributor

Tibor17 commented Sep 18, 2016

@britter
I have created Jira issue for this Task
https://issues.apache.org/jira/browse/SUREFIRE-1282

@Tibor17
Copy link
Contributor

Tibor17 commented Sep 18, 2016

@britter
Thank you for contributing.

@britter
Copy link
Member Author

britter commented Sep 19, 2016

@Tibor17 thank you for integrating this. Did you know, that it is possible to mark PRs as merged in GitHub? I've documented the workflow in the Apache Commons Wiki.

@britter britter closed this Sep 19, 2016
@britter britter deleted the assume-java-version branch September 19, 2016 06:20
@Tibor17
Copy link
Contributor

Tibor17 commented Sep 19, 2016

Did you know, that it is possible to mark PRs as merged in GitHub?

I don't see such option in GUI. Is not it because of we are not the owner of this repo apache?
Maybe they sould make be ASF member, however I am in ASF Maven group.

@britter
Copy link
Member Author

britter commented Sep 19, 2016

@Tibor17 you have to follow the workflow described here. It's not possible to merge using the UI.

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.

2 participants