- Notifications
You must be signed in to change notification settings - Fork5
TestRunnerStatement with dynamic Parameter-list#96
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
de3311c7f52a33156f2d9a10b8b7166720b2ce1e796100f3c4f591ef4aba265b3d5779f2e1e015ff0ee2a7b8266e1b7dd3c0ca8cd4afca5f32b7d561b9e0b22a3d9df19a90371751d6802114ae6a0723a37998676ffa57697be74dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -24,18 +24,19 @@ public class Version implements Comparable<Version> { | ||
| public final static Version V3_0_2 = new Version("3.0.2", 3, 0, 2, null, true); | ||
| public final static Version V3_0_3 = new Version("3.0.3", 3, 0, 3, null, true); | ||
| public final static Version V3_0_4 = new Version("3.0.4", 3, 0, 4, null, true); | ||
| public final static Version V3_1_0 = new Version("3.1.0", 3, 1, 0, 1847, true); | ||
| public final static Version V3_1_1 = new Version("3.1.1", 3, 1, 1, 1865, true); | ||
| public final static Version V3_1_2 = new Version("3.1.2", 3, 1, 2, 2130, true); | ||
| public final static Version V3_1_3 = new Version("3.1.3", 3, 1, 3, 2398, true); | ||
| public final static Version V3_1_4 = new Version("3.1.4", 3, 1, 4, 2223, true); | ||
| public final static Version V3_1_5 = new Version("3.1.5", 3, 1, 5, 2707, true); | ||
| public final static Version V3_1_6 = new Version("3.1.6", 3, 1, 6, 2729, true); | ||
| public final static Version V3_1_7 = new Version("3.1.7", 3, 1, 7, 3085, true); | ||
| public final static Version V3_1_8 = new Version("3.1.8", 3, 1, 8, 3188, true); | ||
| private final static Map<String, Version> knownVersions = | ||
| Stream.of(V3_0_0, V3_0_1, V3_0_2, V3_0_3, V3_0_4, V3_1_0, V3_1_1, V3_1_2, V3_1_3, V3_1_4, V3_1_5, V3_1_6, V3_1_7, V3_1_8) | ||
| .collect(toMap(Version::toString, Function.identity())); | ||
| public final static Version LATEST =V3_1_8; | ||
| private final String origString; | ||
| private final Integer major; | ||
| @@ -167,10 +168,14 @@ public String getNormalizedString() { | ||
| } | ||
| private int compareToWithNulls(@Nullable Integer i1, @Nullable Integer i2) { | ||
| return compareToWithNulls(i1, i2, false); | ||
| } | ||
| private int compareToWithNulls(@Nullable Integer i1, @Nullable Integer i2, boolean nullMeansEqual) { | ||
| if (i1 == null && i2 == null) { | ||
| return 0; | ||
| } else if (i1 == null) { | ||
| returnnullMeansEqual ? 0 :-1; | ||
| } else if (i2 == null) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Don't we need to check MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Sorry, I don't get it... Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Shouldn't i2 be treated same way as i1 so that if i2 is null you check nullMeansEqual MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ah. Example: Maybe I should not use parameters here and instead write the | ||
| return 1; | ||
| } else { | ||
| @@ -180,26 +185,30 @@ private int compareToWithNulls(@Nullable Integer i1, @Nullable Integer i2) { | ||
| @Override | ||
| public int compareTo(Version o) { | ||
| return compareTo(o, false); | ||
| } | ||
| public int compareTo(Version o, boolean nullMeansEqual) { | ||
| int curResult; | ||
| if (isValid() && o.isValid()) { | ||
| curResult = compareToWithNulls(getMajor(), o.getMajor(), nullMeansEqual); | ||
| if (curResult != 0) { | ||
| return curResult; | ||
| } | ||
| curResult = compareToWithNulls(getMinor(), o.getMinor(), nullMeansEqual); | ||
| if (curResult != 0) { | ||
| return curResult; | ||
| } | ||
| curResult = compareToWithNulls(getBugfix(), o.getBugfix(), nullMeansEqual); | ||
| if (curResult != 0) { | ||
| return curResult; | ||
| } | ||
| curResult = compareToWithNulls(getBuild(), o.getBuild(), nullMeansEqual); | ||
| if (curResult != 0) { | ||
| return curResult; | ||
| } | ||
| @@ -220,6 +229,7 @@ private void versionsAreValid(Version v) throws InvalidVersionException { | ||
| /** | ||
| * Compares this version to a given version and returns true if this version is greater or equal than the given one | ||
| * If one of the version parts of the base version is null, this level is assumed equal no matter the comparing level's version part | ||
| * Throws an InvalidVersionException if either this or the given version are invalid | ||
| * | ||
| * @param v Version to compare with | ||
| @@ -230,7 +240,7 @@ public boolean isGreaterOrEqualThan(Version v) throws InvalidVersionException { | ||
| versionsAreValid(v); | ||
| return compareTo(v, true) >= 0; | ||
| } | ||
| @@ -240,11 +250,20 @@ public boolean isGreaterThan(Version v) throws InvalidVersionException { | ||
| return compareTo(v) > 0; | ||
| } | ||
| /** | ||
| * Compares this version to a given version and returns true if this version is less or equal than the given one | ||
| * If one of the version parts of the base version is null, this level is assumed equal no matter the comparing level's version part | ||
| * Throws an InvalidVersionException if either this or the given version are invalid | ||
| * | ||
| * @param v Version to compare with | ||
| * @return | ||
| * @throws InvalidVersionException | ||
| */ | ||
| public boolean isLessOrEqualThan(Version v) throws InvalidVersionException { | ||
| versionsAreValid(v); | ||
| return compareTo(v, true) <= 0; | ||
| } | ||
| public boolean isLessThan(Version v) throws InvalidVersionException { | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.