Skip to content

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

Closed
britter wants to merge 3 commits into
apache:masterfrom
britter:assume-java-version
Closed

Add convinient method to check for the currently used Java Version#120
britter wants to merge 3 commits into
apache:masterfrom
britter:assume-java-version

Conversation

@britter

@britter britter commented Sep 10, 2016

Copy link
Copy Markdown
Member

No description provided.

@britter
britter force-pushed the assume-java-version branch from ff951f9 to 70ffbd4 Compare September 10, 2016 13:17

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
britter force-pushed the assume-java-version branch from 8a854ef to 498942b Compare September 17, 2016 14:11
@britter

britter commented Sep 17, 2016

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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

Tibor17 commented Sep 18, 2016

Copy link
Copy Markdown
Contributor

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

@Tibor17

Tibor17 commented Sep 18, 2016

Copy link
Copy Markdown
Contributor

@britter
Thank you for contributing.

@britter

britter commented Sep 19, 2016

Copy link
Copy Markdown
Member Author

@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

Tibor17 commented Sep 19, 2016

Copy link
Copy Markdown
Contributor

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

britter commented Sep 19, 2016

Copy link
Copy Markdown
Member Author

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

@jira-importer

Copy link
Copy Markdown

Resolve #2402

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.

3 participants