Skip to content

Migrate ShardQueryLogicTest from Arquillian to AbstractQueryTest#3676

Draft
apmoriarty wants to merge 1 commit into
integrationfrom
task/migrate-shard-query-logic-test
Draft

Migrate ShardQueryLogicTest from Arquillian to AbstractQueryTest#3676
apmoriarty wants to merge 1 commit into
integrationfrom
task/migrate-shard-query-logic-test

Conversation

@apmoriarty

Copy link
Copy Markdown
Collaborator

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant