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
bbb6b1fa
Commit
bbb6b1fa
authored
Jun 25, 2017
by
Guus der Kinderen
Committed by
daryl herzmann
Jun 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1351: Allow for numbered releases (#826)
parent
51100ccb
Changes
2
Show 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 @
bbb6b1fa
...
@@ -133,7 +133,7 @@ public final class Version implements Comparable<Version> {
...
@@ -133,7 +133,7 @@ public final class Version implements Comparable<Version> {
if
(
versionString
==
null
)
{
if
(
versionString
==
null
)
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
major
).
append
(
'.'
).
append
(
minor
).
append
(
'.'
).
append
(
micro
);
sb
.
append
(
major
).
append
(
'.'
).
append
(
minor
).
append
(
'.'
).
append
(
micro
);
if
(
status
!=
ReleaseStatus
.
Release
)
{
if
(
status
!=
ReleaseStatus
.
Release
||
statusVersion
!=
-
1
)
{
sb
.
append
(
' '
).
append
(
status
);
sb
.
append
(
' '
).
append
(
status
);
if
(
statusVersion
>=
0
)
{
if
(
statusVersion
>=
0
)
{
sb
.
append
(
' '
).
append
(
statusVersion
);
sb
.
append
(
' '
).
append
(
statusVersion
);
...
@@ -196,7 +196,7 @@ public final class Version implements Comparable<Version> {
...
@@ -196,7 +196,7 @@ public final class Version implements Comparable<Version> {
* are indicated by type safe enum constants.
* are indicated by type safe enum constants.
*/
*/
public
enum
ReleaseStatus
{
public
enum
ReleaseStatus
{
Release
(
""
),
Release_Candidate
(
"RC"
),
Beta
(
"Beta"
),
Alpha
(
"Alpha"
);
Release
(
"
Release
"
),
Release_Candidate
(
"RC"
),
Beta
(
"Beta"
),
Alpha
(
"Alpha"
);
private
String
status
;
private
String
status
;
...
...
src/test/java/org/jivesoftware/util/VersionTest.java
View file @
bbb6b1fa
...
@@ -37,6 +37,20 @@ public class VersionTest {
...
@@ -37,6 +37,20 @@ public class VersionTest {
assertEquals
(
"1.2.3 Beta 3"
,
test
.
getVersionString
());
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
@Test
public
void
testVersionWithNullStringConstructor
()
{
public
void
testVersionWithNullStringConstructor
()
{
Version
test
=
new
Version
(
null
);
Version
test
=
new
Version
(
null
);
...
...
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