mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-422: Correct toString() for GuacamoleProtocolVersion (must be manually implemented after migrating away from enum). Add unit test for verifying toString().
This commit is contained in:
@@ -202,5 +202,10 @@ public class GuacamoleProtocolVersion {
|
||||
&& this.patch == otherVersion.getPatch();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VERSION_" + getMajor() + "_" + getMinor() + "_" + getPatch();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -137,4 +137,15 @@ public class GuacamoleProtocolVersionTest {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that versions can be converted to their Guacamole protocol
|
||||
* representation through calling toString().
|
||||
*/
|
||||
@Test
|
||||
public void testToString() {
|
||||
Assert.assertEquals("VERSION_1_0_0", GuacamoleProtocolVersion.VERSION_1_0_0.toString());
|
||||
Assert.assertEquals("VERSION_1_1_0", GuacamoleProtocolVersion.VERSION_1_1_0.toString());
|
||||
Assert.assertEquals("VERSION_12_103_398", new GuacamoleProtocolVersion(12, 103, 398).toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user