Summary
Three unit tests in projects/sitemanage fail when the module's full surefire run executes. They pass in isolation but fail when the test JVM has prior state from earlier test classes.
Failing tests
PSItemServiceTest.setUp:102 — IllegalArgumentException: Cannot set rxDir system property rxdeploydir value /home/nate/.../tmp/junit<id> does not exist
PSDispatchingPathServicePathParsingTest.shouldFailOnNormalizeNullPath — expected<IllegalArgumentException> but was<NullPointerException>
PSDispatchingPathServicePathParsingTest.shouldFailToReturnProperFullPathIfGivenRelativePathIsNull — expected<IllegalArgumentException> but was<NullPointerException>
Root cause
Fix
PSDispatchingPathService: replace notNull(...) guards in PathNormalizer.normalizePath and PathMatch.toFullPath with explicit if (... == null) throw new IllegalArgumentException(...) checks so the contract matches the IPSPathNormalizer interface and the test expectations.
PSItemServiceTest: add a @Rule TemporaryFolder and, in setUp / tearDown, use PathUtils.setThreadOnlyRxDir / unsetThreadOnlyRxDir plus PathUtils.clearRxDir() (the same pattern already used by PSEnsureMyFacesSecretTest in the same module) to isolate the test from rxdeploydir state left by other test classes.
Verification
[INFO] Tests run: 314, Failures: 0, Errors: 0, Skipped: 17
[INFO] BUILD SUCCESS
The 17 skipped tests are the pre-existing @Ignored tests, unchanged.
Summary
Three unit tests in
projects/sitemanagefail when the module's full surefire run executes. They pass in isolation but fail when the test JVM has prior state from earlier test classes.Failing tests
PSItemServiceTest.setUp:102—IllegalArgumentException: Cannot set rxDir system property rxdeploydir value /home/nate/.../tmp/junit<id> does not existPSDispatchingPathServicePathParsingTest.shouldFailOnNormalizeNullPath—expected<IllegalArgumentException> but was<NullPointerException>PSDispatchingPathServicePathParsingTest.shouldFailToReturnProperFullPathIfGivenRelativePathIsNull—expected<IllegalArgumentException> but was<NullPointerException>Root cause
PSDispatchingPathService$PathNormalizer.normalizePathandPSDispatchingPathService$PathMatch.toFullPathvalidate their input withorg.apache.commons.lang3.Validate.notNull(...), which throwsNullPointerException. TheIPSPathNormalizerinterface explicitly declaresthrows IllegalArgumentException, and the tests expect that exception.PSItemService's constructor callsPathUtils.getRxDir(null), which reads therxdeploydirsystem property. Earlier test classes in the surefire JVM set this property to a JUnitTemporaryFolderroot; once that test class finishes, the temp folder is deleted but the property remains, so the next class to loadPathUtils.getRxDirblows up.PSItemServiceTestitself never established a validrxdeploydir.Fix
PSDispatchingPathService: replacenotNull(...)guards inPathNormalizer.normalizePathandPathMatch.toFullPathwith explicitif (... == null) throw new IllegalArgumentException(...)checks so the contract matches theIPSPathNormalizerinterface and the test expectations.PSItemServiceTest: add a@Rule TemporaryFolderand, insetUp/tearDown, usePathUtils.setThreadOnlyRxDir/unsetThreadOnlyRxDirplusPathUtils.clearRxDir()(the same pattern already used byPSEnsureMyFacesSecretTestin the same module) to isolate the test fromrxdeploydirstate left by other test classes.Verification
The 17 skipped tests are the pre-existing
@Ignored tests, unchanged.