Skip to content

Add unit test case for GarbageCollectionAlgorithm.makeRelative() - #6643

Merged
DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:addGCalgoTest
Nov 12, 2026
Merged

DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:addGCalgoTest

Conversation

@DomGarguilo

Copy link
Copy Markdown
Member

Adds testMakeRelative to GarbageCollectionTest with direct unit tests for makeRelative(String, int). To make it testable, the method is now package-private and marked @VisibleForTesting.

Covers:

  • Full and relative file/dir paths normalize to tableId/tabletDir[/file], including a leading ../ or /, trailing slashes, empty components, and b-/B- bulk dirs
  • Rejects the wrong expectedLen (file asked for as a dir, and the reverse)
  • Rejects malformed paths: too few or too many components, tables missing or out of place, and colons in short paths

Co-Authored-By: Claude Opus 5.5

@ddanielr ddanielr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems fine to me.
This code gets removed on merge to main anyway.

@dlmarion dlmarion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, but you are going to have an issue on the merge to main because #6616 was merged. See https://github.com/apache/accumulo/pull/6616/changes#diff-5044a3b0f3aa93923a34df7c41e2ca67b6271dbb3c26f4cd7d5020f1150af491

@DomGarguilo
DomGarguilo merged commit 9d6d54d into apache:2.1 Nov 12, 2026
9 checks passed
@DomGarguilo
DomGarguilo deleted the addGCalgoTest branch November 12, 2026 15:14
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.

3 participants