Commit f8fc9805 authored by Guus der Kinderen's avatar Guus der Kinderen Committed by akrherz

OF-1351: Allow for numbered releases (#826)

parent 2f342fb0
......@@ -136,7 +136,7 @@ public final class Version implements Comparable<Version> {
if (versionString == null) {
StringBuilder sb = new StringBuilder();
sb.append(major).append('.').append(minor).append('.').append(micro);
if (status != ReleaseStatus.Release) {
if (status != ReleaseStatus.Release || statusVersion != -1) {
sb.append(' ').append(status);
if (statusVersion >= 0) {
sb.append(' ').append(statusVersion);
......@@ -199,7 +199,7 @@ public final class Version implements Comparable<Version> {
* are indicated by type safe enum constants.
*/
public enum ReleaseStatus {
Release(""), Release_Candidate("RC"), Beta("Beta"), Alpha("Alpha");
Release("Release"), Release_Candidate("RC"), Beta("Beta"), Alpha("Alpha");
private String status;
......
......@@ -37,6 +37,20 @@ public class VersionTest {
assertEquals("1.2.3 Beta 3", test.getVersionString());
}
@Test
public void testVersionWithRegularStringConstructorB() {
Version test = new Version("1.2.3 Release 3");
assertEquals(1, test.getMajor());
assertEquals(2, test.getMinor());
assertEquals(3, test.getMicro());
assertEquals(ReleaseStatus.Release, test.getStatus());
assertEquals(3, test.getStatusVersion());
assertEquals("1.2.3 Release 3", test.getVersionString());
}
@Test
public void testVersionWithNullStringConstructor() {
Version test = new Version(null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment