Skip to content

Issue #15589 - Improve InetAddressPattern testing - #15609

Open
DragonFSKY wants to merge 1 commit into
jetty:jetty-12.1.xfrom
DragonFSKY:test-15589-inet-address-pattern
Open

Issue #15589 - Improve InetAddressPattern testing#15609
DragonFSKY wants to merge 1 commit into
jetty:jetty-12.1.xfrom
DragonFSKY:test-15589-inet-address-pattern

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Adds direct parameterized tests for InetAddressPattern, covering singleton, CIDR, min/max, and legacy patterns across IPv4 and IPv6, along with invalid patterns and null handling.

The tests exposed two edge cases: an all-zero address could accept a negative CIDR, and legacy patterns threw for a null address. This rejects negative CIDR values before calculating the mask and makes legacy patterns consistent with the other implementations.

Fixes #15589.

Tests:

  • JDK 21 and 25: mvn -pl jetty-core/jetty-util -Dtest=InetAddressPatternTest test (48 tests)
  • JDK 21: mvn -pl jetty-core/jetty-util test (3011 tests, 0 failures, 0 errors)

AI disclosure

I used OpenAI GPT-5.6 and Kimi K3 to assist with issue analysis and drafting the implementation and tests. I reviewed and verified the final changes.

@DragonFSKY
DragonFSKY force-pushed the test-15589-inet-address-pattern branch from 58c1875 to c2d2149 Compare August 25, 2026 11:12
Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
@DragonFSKY
DragonFSKY force-pushed the test-15589-inet-address-pattern branch from c2d2149 to 9a02849 Compare August 25, 2026 16:03
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.

Improve testing of InetAddressPattern used in ConditionalHandler

1 participant