Skip to content

Cleanup of BasicTests#361

Open
notthetup wants to merge 1 commit intomasterfrom
basic-test-clean-up
Open

Cleanup of BasicTests#361
notthetup wants to merge 1 commit intomasterfrom
basic-test-clean-up

Conversation

@notthetup
Copy link
Collaborator

@notthetup notthetup commented Jul 28, 2025

These minor issues were found by Intellij...

This pull request focuses on improving code readability, ensuring consistency, and addressing minor issues in the BasicTests.java file. The changes include refactoring for clarity, adopting best practices, and fixing minor bugs. Below is a summary of the most important changes grouped by theme:

Code Readability and Consistency Improvements:

  • Made all inner classes (ParamServerAgent, ParamClientAgent, ParamNtfClientAgent, AIDParamClientAgent, ServerAgent, ClientAgent2, MyMessageListener, ShellTestAgent) static for clarity and to avoid unnecessary references to the enclosing class. [1] [2] [3] [4] [5] [6] [7]
  • Replaced string concatenation in logging statements with cleaner formatting for better readability.

Assertion Improvements:

  • Reordered arguments in assertEquals and assertSame to follow the convention of expected before actual. [1] [2] [3] [4] [5] [6] [7]
  • Enhanced assertTrue statements by adding descriptive failure messages to make debugging easier.

Bug Fixes:

  • Corrected integer multiplication in file length checks by explicitly casting to long to prevent potential overflow issues.

Minor Refactoring:

  • Converted mutable fields (rnd, log) to final to indicate immutability.

These changes collectively improve the maintainability and reliability of the test code while adhering to modern Java coding standards.

@notthetup notthetup force-pushed the basic-test-clean-up branch from 40ee2af to 66ae635 Compare July 28, 2025 05:47
@notthetup notthetup force-pushed the basic-test-clean-up branch from 66ae635 to 39b1ae5 Compare July 28, 2025 05:50
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.

1 participant