Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.14.1 and misc #612

Merged
merged 2 commits into from Mar 10, 2022
Merged

2.14.1 and misc #612

merged 2 commits into from Mar 10, 2022

Conversation

scottf
Copy link
Contributor

@scottf scottf commented Mar 10, 2022

  • Changed version from 2.14.0 to 2.14.1, saves time for upcoming snapshot builds
  • ServerInfo.java changed to match fix to .NET library
  • ServerInfoTests.java
  • StorageType.java simplified get method which matches to string
  • StreamConfiguration.json test data to exercise StorageType change
    All other files are a version change

@@ -65,7 +65,7 @@ public static void main(String[] args) {
* The conscrypt flag is provided for testing with the conscrypt jar. Using it through reflection is
* deprecated but allows the library to ship without a dependency. Using conscrypt should only require the
* jar plus the flag. For example, to run after building locally and using the test cert files:
* java -cp ./build/libs/jnats-2.14.0-SNAPSHOT-examples.jar:./build/libs/jnats-2.14.0-SNAPSHOT-fat.jar:<path to conscrypt.jar> \
* java -cp ./build/libs/jnats-&lt;version&gt;-examples.jar:./build/libs/jnats-&lt;version&gt;-fat.jar:<path to conscrypt.jar> \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a placeholder here so we don't have to update this every version

@@ -142,7 +142,7 @@ private String getComparableVersion(String vString) {
String[] v = vString.replaceAll("v", "").replaceAll("-", ".").split("\\Q.\\E");
int at = vString.indexOf("-");
return "" + (Integer.parseInt(v[0]) * 10000) + (Integer.parseInt(v[1]) * 100) + Integer.parseInt(v[2])
+ (at == -1 ? "" : vString.substring(at));
+ (at == -1 ? "~" : vString.substring(at));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tilde is the last ascii character so it this helps v0.0.0 sort "newer" than v.0.0.0-beta

return strEnumHash.get(value);
if (File.policy.equalsIgnoreCase(value)) { return File; }
if (Memory.policy.equalsIgnoreCase(value)) { return Memory; }
return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half the code, one less object. I would still use the other strategy on enums with more entries

@@ -64,7 +64,7 @@ public void testServerVersionComparisonsWork() {
ServerInfo info235Beta2 = new ServerInfo(json.replace("1.2.3", "2.3.5-beta.2"));
assertTrue(info.isOlderThanVersion("2.3.4"));
assertTrue(info234.isOlderThanVersion("2.3.5"));
assertTrue(info235.isOlderThanVersion("2.3.5-beta.2"));
assertTrue(info235.isNewerVersionThan("2.3.5-beta.2"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just b/c the test passes, doesn't mean it's right :)

@@ -9,7 +9,7 @@
"max_bytes": 732,
"max_age": 43000000000,
"max_msg_size": 734,
"storage": "memory",
"storage": "MeMoRy", "storageComment": "funny case used to test getting StorageType enum",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json doesn't have comments, so just add a field that is ignored

Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@scottf scottf merged commit 5e56917 into main Mar 10, 2022
@scottf scottf deleted the 2-14-1-and-misc branch March 10, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants