Skip to content

Align dependencies and tighten documentation & tests #41

Open
peter-lawrey wants to merge 15 commits intodevelopfrom
adv/develop
Open

Align dependencies and tighten documentation & tests #41
peter-lawrey wants to merge 15 commits intodevelopfrom
adv/develop

Conversation

@peter-lawrey
Copy link
Copy Markdown
Member

@peter-lawrey peter-lawrey commented Nov 20, 2025

This PR updates the dependency BOM, polishes documentation, and hardens the test suite around the Chronicle-Analytics library. Runtime behaviour of the core library is effectively unchanged, apart from potential transitive updates brought in via the refreshed BOM, and slightly richer behaviour in the example main class.


Functional changes

  • Dependency alignment

    • Bump net.openhft:third-party-bom from 3.27ea5 to 3.27ea7 in pom.xml.
    • This may pull in newer versions of transitive dependencies (including logging and test libraries), but there are no direct code changes in production classes.
  • Example application behaviour

    • AnalyticsExampleMain.main now also calls:

      • showBuilder()
      • shortExample()
    • This makes the example program exercise more of the builder API and demonstrates additional usage patterns when the example is run.

  • Test robustness and correctness

    • ClientIdUtilTest.cleanupFile() now uses Files.deleteIfExists(...) and logs a warning via SLF4J on failure, instead of silently ignoring File.delete() failures. This improves cleanup reliability and observability in tests.

    • GoogleAnalyticsTest.attemptToSendReset() now uses JUnit 5’s Assumptions.assumeFalse static import, keeping the assumption consistent with JUnit 5 style.

    • GoogleAnalyticsTest.waitForNewSecond() replaces a pure spin-wait loop with Thread.yield() to reduce unnecessary CPU burn while waiting for a new second.

    • HttpUtilTest.hungHttpServer() now:

      • Removes an unused local counter.
      • Restores the interrupted flag and breaks out of the wait loop when an InterruptedException occurs, improving thread-interruption handling in tests.
    • VanillaAnalyticsBuilderTest:

      • Replaces assertTrue(... instanceof ...) with assertInstanceOf(...) for clearer, type-safe assertions.
      • Fixes the second test to assert against the analytics instance actually under test instead of a fresh builder call, closing a small correctness gap in the test.

Non-functional changes

  • Documentation and AsciiDoc improvements

    • README.adoc:

      • Add :lang: en-GB and :source-highlighter: rouge attributes for consistent language and syntax highlighting.

      • Mark the Java code block with [source,java,opts=novalidate] to avoid AsciiDoc validation of the snippet.

      • Fix wording and spacing in the introductory paragraph (“usage statistics”, spacing around sentences).

      • Correct the inline code formatting for the event parameter name from app_version\`` to `` app_version` ``.

      • Clarify the description of the noop module:

        • Refer to the empty artefact as a JAR.
        • Explain that including it ensures the library is effectively disabled, making the behaviour clearer for users.
    • src/main/adoc/project-requirements.adoc and src/main/adoc/security-review.adoc:

      • Add :source-highlighter: rouge for consistent code highlighting across project documents.
      • Escape ${clientIdFileName} as $\{clientIdFileName} to prevent unintended variable substitution while keeping the literal value visible in the rendered docs.
  • Code clean-ups

    • GoogleAnalytics3:

      • Remove obsolete, commented-out eventType.sessionControl() block. This has no runtime effect but reduces noise around the payload assembly logic.
    • VanillaAnalyticsBuilder:

      • Reformat messages() into a multi-line method for readability without changing behaviour.

Compatibility / risk

  • No intentional behavioural changes to the core analytics runtime code.
  • The main source of behavioural risk is the BOM update to 3.27ea7, which may update transitive dependencies; however, there are no direct API changes in this module to rely on new features.
  • Test and documentation changes are backwards compatible and internal to the build/documentation pipeline.

@peter-lawrey peter-lawrey changed the title Update documentation and code formatting for clarity and consistency Align dependencies and tighten documentation & tests Nov 20, 2025
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants