Skip to content

[#1200] Record JAX-RPC RI golden responses for the RPC/encoded endpoints - #1229

Merged
maximthomas merged 3 commits into
masterfrom
features/1200-jaxrpc-golden-recording
Nov 12, 2026
Merged

maximthomas merged 3 commits into
masterfrom
features/1200-jaxrpc-golden-recording

Conversation

@maximthomas

@maximthomas maximthomas commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1200

Problem

Issue #1200 replaces the JAX-RPC RI on the seven RPC/encoded endpoints (SMSObjectIF, DirectoryManagerIF, EntityObjectIF, AssertionManagerIF, FSAssertionManagerIF, SecurityTokenManagerIF, LibertyManagerIF). The replacement must answer what the RI answers, byte for byte, so the RI's responses are recorded first, while the RI is still here.

Changes

  • GoldenRecorderTest (openam-jaxrpc-schema) drives the generated *_Tie classes with a proxy target. Per case it produces the SOAPClient request, the RI response, the arguments the target received and the HTTP status.
    • Without -Djaxrpc.golden.root, committedRecordingsAreReproduced compares the committed files with that drive byte for byte, so CI fails when the case catalogue, the client encoder, the RI or the JDK moves a recording.
    • With -Djaxrpc.golden.root=<repo root>, recordsTheRIResponses rewrites them. CI never sets the property.
    • Both fail when a declared-fault case does not come back as that declared fault, or another case (other than the client-observable-only ones) does not come back with 200.
  • Case catalogue in the openam-shared test-jar (GoldenCase, GoldenCases, GoldenValues): an __ok case per operation and a fault case per declared exception. CoreGoldenCases adds edge cases: result runtime classes, nulls, special characters, omitted primitives, undeclared failures.
  • The .args files name the runtime class of every argument, collection element, map key and map value, so nested types and nulls are recorded too.
  • 307 core and 47 federation recordings.
  • .gitattributes marks the golden files -text, so Windows CI does not convert their line endings.
  • The RI ends the XML declaration with System.lineSeparator(): its XmlWriter calls BufferedWriter.newLine() after it, so on Windows it writes CRLF there. The drive writes LF there in both modes, so Windows CI reproduces the committed files and a recording made on Windows equals one made elsewhere. XML parsers do not report whitespace in the prolog, so a client cannot tell the difference.
  • openam-shared builds a test-jar; openam-core and openam-jaxrpc-schema use it in test scope.

No runtime change: test code, test resources and test-scoped pom entries only.

Tests

  • GoldenValuesTest, CoreGoldenCasesTest.
  • GoldenRecorderTest without the property: Tests run: 2, Failures: 0, Errors: 0, Skipped: 1; the compare test passes and the recorder skips.
  • Re-recording on the committed tree leaves git status clean on both golden directories.
  • Changing a catalogue value ("arg" + position to "val" + position in GoldenValues) fails the compare test; marking getAttributesByteValues1__resultByteArrayValues as byte-exact fails the status check.
  • Driven with -Dline.separator=<CR><LF>, the compare test passes (JDK 26, and JDK 11 with Cp1252 as the default encoding), and re-recording on JDK 26 writes files identical to the committed ones. Without the LF rule the compare test fails on all 354 responses at byte 38, as both windows-latest jobs did.
  • The openam-shared and openam-core test suites pass.

To re-record (the command is also in the GoldenRecorderTest Javadoc):

mvn -pl openam-schema/openam-jaxrpc-schema -am package -Dtest=GoldenRecorderTest \
  -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true -Djaxrpc.golden.root=$PWD

-am builds the case catalogue from the working tree; without it the openam-shared and openam-core test-jars come from the local repository and a stale catalogue is recorded. package, not test, because the reactor then includes bcpkix-shaded, whose relocated classes exist only after package.

@maximthomas
maximthomas marked this pull request as draft November 10, 2026 11:21
- GoldenRecorderTest compares the committed golden files with a fresh
  drive of the RI when -Djaxrpc.golden.root is unset, and its Javadoc
  gives the -am package re-record command.
- GoldenValues.describe names the runtime class of nested collection
  elements, map keys and values; 114 .args files re-recorded.
- The recorder fails an __ok or edge case that came back as a fault.
- idsAreUniquePerInterface covers all three core interfaces.
@maximthomas maximthomas added build saml SAML / SAML2 federation refactoring Code cleanup, refactor, dead-code or dependency removal java Pull requests that update java code tests Test suite: coverage, fixtures, or test infrastructure labels Nov 10, 2026
The RI ends the XML declaration with System.lineSeparator(): its XmlWriter
calls BufferedWriter.newLine() after it. On Windows every recorded response
therefore differed from the committed one at byte 38, and the windows-latest
jobs failed committedRecordingsAreReproduced.

The drive now writes LF there in both modes, so the comparison passes on
Windows and a recording made there equals one made elsewhere. XML parsers do
not report whitespace in the prolog, so clients cannot tell the difference.
@maximthomas
maximthomas requested a review from vharseko November 11, 2026 08:00
@maximthomas
maximthomas marked this pull request as ready for review November 11, 2026 08:01

@vharseko vharseko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the golden-case catalogue, RI recorder, response comparisons, and Maven configuration. I found no blocking issues. The build checks pass across Linux, macOS, and Windows.

@maximthomas
maximthomas merged commit a4d519b into master Nov 12, 2026
26 checks passed
@maximthomas
maximthomas deleted the features/1200-jaxrpc-golden-recording branch November 12, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build java Pull requests that update java code refactoring Code cleanup, refactor, dead-code or dependency removal saml SAML / SAML2 federation tests Test suite: coverage, fixtures, or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants