Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
f8fc9805
Commit
f8fc9805
authored
7 years ago
by
Guus der Kinderen
Committed by
akrherz
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1351: Allow for numbered releases (#826)
parent
2f342fb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Version.java
src/java/org/jivesoftware/util/Version.java
+2
-2
VersionTest.java
src/test/java/org/jivesoftware/util/VersionTest.java
+14
-0
No files found.
src/java/org/jivesoftware/util/Version.java
View file @
f8fc9805
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/jivesoftware/util/VersionTest.java
View file @
f8fc9805
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment