Migrate ShardQueryLogicTest from Arquillian to AbstractQueryTest#3676
Draft
apmoriarty wants to merge 1 commit into
Draft
Migrate ShardQueryLogicTest from Arquillian to AbstractQueryTest#3676apmoriarty wants to merge 1 commit into
apmoriarty wants to merge 1 commit into
Conversation
This is the last of the 14 remaining WiseGuys-based query-core tests to move off Arquillian/CDI. It doesn't fit AbstractQueryTest's default Document/UUID assertion model (results are matched as event/field groups via a custom Set<Set<String>> UID+field-value scheme, with extra annotation-table and raw-event-data setup), so it follows the same pattern established for UniqueTest: override executeQuery() to build DefaultEventQueryResponse events via DocumentTransformer, and replicate the original set-matching logic in extraAssertions() against a deep local copy (planAndExecuteQuery() invokes extraAssertions() once per index table variant, so the original code's destructive Set.remove() calls need a fresh copy each time). The abstract class + ShardRange/DocumentRange nested-subclass split was replaced with @ParameterizedTest @EnumSource(WhatKindaRange.class), with both ranges ingested once in @BeforeAll into cached AccumuloClients, matching prior migrations. The two @test(expected = IllegalStateException.class) cases became assertThrows(...) wrapping planAndExecuteQuery() directly. Also fixes two other still-unmigrated files that referenced ShardQueryLogicTest.ShardRange purely as an arbitrary QueryTestTableHelper label with no functional dependency (ShardQueryLogicQueryValidationTest, TermFrequencyQueryTableTest) - swapped each to its own class name now that the nested classes are gone. All 90 tests (45 methods x 2 ranges) pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the last of the 14 remaining WiseGuys-based query-core tests to move off Arquillian/CDI. It doesn't fit AbstractQueryTest's default Document/UUID assertion model (results are matched as event/field groups via a custom Set<Set> UID+field-value scheme, with extra annotation-table and raw-event-data setup), so it follows the same pattern established for UniqueTest: override executeQuery() to build DefaultEventQueryResponse events via DocumentTransformer, and replicate the original set-matching logic in extraAssertions() against a deep local copy (planAndExecuteQuery() invokes extraAssertions() once per index table variant, so the original code's destructive Set.remove() calls need a fresh copy each time).
The abstract class + ShardRange/DocumentRange nested-subclass split was replaced with @ParameterizedTest @EnumSource(WhatKindaRange.class), with both ranges ingested once in @BeforeAll into cached AccumuloClients, matching prior migrations. The two @test(expected = IllegalStateException.class) cases became assertThrows(...) wrapping planAndExecuteQuery() directly.
Also fixes two other still-unmigrated files that referenced ShardQueryLogicTest.ShardRange purely as an arbitrary QueryTestTableHelper label with no functional dependency (ShardQueryLogicQueryValidationTest, TermFrequencyQueryTableTest) - swapped each to its own class name now that the nested classes are gone.
All 90 tests (45 methods x 2 ranges) pass.