[tests] Add JSON-RPC versioning unit tests for R4 dispatch and validation#2166
Draft
smanes0213 wants to merge 5 commits into
Draft
[tests] Add JSON-RPC versioning unit tests for R4 dispatch and validation#2166smanes0213 wants to merge 5 commits into
smanes0213 wants to merge 5 commits into
Conversation
…tion
Tests cover:
- CreateHandler/GetHandler versioned dispatch (explicit and unversioned)
- v1-cloned handler inherits methods registered before clone
- Methods registered after clone are absent on v1
- Unknown version returns Core::ERROR_INVALID_RANGE
- Unknown method returns Core::ERROR_UNKNOWN_METHOD
- exists built-in returns '0' (found) or '22' (not found)
- TokenCheckFunction: VALID / INVALID (ERROR_PRIVILIGED_REQUEST) /
DEFERRED (ERROR_PRIVILIGED_DEFERRED)
- Validation fires before handler dispatch (Validate then Invoke pattern)
- Scenario A: single {1} handler
- Scenario B: single {1,2} multi-version handler
- Virtual-base explicit init to avoid C++ default-ctor silent failure
Uses IDispatcher::Validate + IDispatcher::Invoke(nullptr,...) to preserve
the version prefix; not ILocalDispatcher::Invoke which strips it.
Refs: Source/plugins/JSONRPC.h, Source/core/Portability.h
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.
Tests cover:
Uses IDispatcher::Validate + IDispatcher::Invoke(nullptr,...) to preserve the version prefix; not ILocalDispatcher::Invoke which strips it.