Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum VersionPhase implements AbstractVersionPhase {
UNDEFINED,

/** A revision number (actually not a development phase like {@link #UNDEFINED}). */
REVISION(Boolean.TRUE, "revision", "rev"),
REVISION(Boolean.TRUE, "revision", "rev", "u"),

/** Unstable marker - see {@link VersionSegment#PATTERN_MATCH_ANY_VERSION}. */
UNSTABLE(Boolean.FALSE, "!"),
Expand Down Expand Up @@ -77,7 +77,7 @@ private VersionPhase(Boolean hasNumber, String... ids) {
@Override
public boolean isDevelopmentPhase() {

return (this != UNDEFINED) && (this != NONE) && (this != REVISION) && (this != BUILD);
return (this != UNDEFINED) && (this != NONE) && (this != REVISION) && (this != BUILD) && (this != BETA_OR_BUILD);
}

/**
Expand All @@ -97,7 +97,7 @@ public boolean isDevelopmentPhase() {
*/
public boolean isValid(int number) {

if ((this == UNDEFINED) || (this == BETA_OR_BUILD)) {
if (this == UNDEFINED) {
return false;
}
if (this.hasNumber != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void testOf() {
*/
@ParameterizedTest
// arrange
@ValueSource(strings = { "1.0", "0.1", "2023.08.001", "2023-06-M1", "11.0.4_11.4", "5.2.23.RELEASE" })
@ValueSource(strings = { "1.0", "0.1", "2023.08.001", "2023-06-M1", "11.0.4_11.4", "5.2.23.RELEASE", "8u412b08" })
void testValid(String version) {

// act
Expand All @@ -78,7 +78,7 @@ void testValid(String version) {
*/
@ParameterizedTest
// arrange
@ValueSource(strings = { "0", "0.0", "1.0.pineapple-pen", "1.0-rc", ".1.0", "1.-0", "RC1", "Beta1", "donut", "8u412b08", "0*.0", "*0", "*.", "17.*alpha",
@ValueSource(strings = { "0", "0.0", "1.0.pineapple-pen", "1.0-rc", ".1.0", "1.-0", "RC1", "Beta1", "donut", "0*.0", "*0", "*.", "17.*alpha",
"17*.1" })
void testInvalid(String version) {

Expand Down Expand Up @@ -193,6 +193,8 @@ void testMatchStable() {
assertThat(pattern.matches(VersionIdentifier.of("17.0.alpha7"))).isFalse();
assertThat(pattern.matches(VersionIdentifier.of("17.0-beta2"))).isFalse();
assertThat(pattern.matches(VersionIdentifier.of("17.0-SNAPSHOT"))).isFalse();
pattern = VersionIdentifier.of("8*");
assertThat(pattern.matches(VersionIdentifier.of("8u412b08"))).isTrue();
}

/**
Expand Down Expand Up @@ -346,6 +348,7 @@ private static void assertIncrementLastDigit(String version, boolean keepLetters
void testIsStable() {

assertThat(VersionIdentifier.of("2025.01.002").isStable()).isTrue();
assertThat(VersionIdentifier.of("8u412b08").isStable()).isTrue();
assertThat(VersionIdentifier.of("1.0-rc1").isStable()).isFalse();
assertThat(VersionIdentifier.of("1.0-alpha1.rc2").isStable()).isFalse();
assertThat(VersionIdentifier.LATEST.isStable()).isTrue();
Expand Down
Loading