You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "royteeuwen (via GitHub)" <gi...@apache.org> on 2026/07/04 06:46:10 UTC
[PR] SLING-13252: Migrate repository tests from commons.testing/Jackrabbit to sling-mock (Oak) [sling-org-apache-sling-scripting-javascript]
royteeuwen opened a new pull request, #21:
URL: https://github.com/apache/sling-org-apache-sling-scripting-javascript/pull/21
## Summary
The repository-based tests (`RepositoryScriptingTestBase` and its subclasses `TestSetupTest`, `ScriptableMapTest`, `ScriptableNodeTest`, `ScriptableResourceTest`, `ScriptableVersionTest`) ran against the legacy `org.apache.sling.commons.testing` `RepositoryTestBase`, which starts a Jackrabbit 2 repository persisted via Apache Derby.
This had two problems:
- Derby rejects region-less JVM locales such as `en_001` (macOS "English — World") with `ERROR XBM0X`, failing every repository test on such machines (unfixed in Derby trunk).
- `RepositoryTestBase` is JUnit 3 (`TestCase`) based, conflicting with the JUnit 5 migration from SLING-12510.
## Changes
- Rebase `RepositoryScriptingTestBase` on sling-mock's `SlingContext` with `ResourceResolverType.JCR_OAK` (in-memory Oak), removing Derby from the test classpath.
- Drop the `commons.testing` and `jackrabbit-core` test dependencies; add `org.apache.sling.testing.sling-mock-oak` for a Java 17 compatible Oak and exclude the stale Oak 1.22 that `sling-mock.core` pulls transitively.
- Complete the JUnit 5 migration: remove all JUnit 3 `TestCase` inheritance and assertion usage.
- Deactivate the `RhinoJavaScriptEngineFactory` in `tearDown` so Rhino's set-once `ContextFactory` application class loader is reset between tests.
## Verification
`mvn clean verify` is green: 91 tests pass, no locale workaround required, RAT and bnd baseline checks pass.
JIRA: https://issues.apache.org/jira/browse/SLING-13252
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-13252: Migrate repository tests from commons.testing/Jackrabbit to sling-mock (Oak) [sling-org-apache-sling-scripting-javascript]
Posted by "royteeuwen (via GitHub)" <gi...@apache.org>.
royteeuwen merged PR #21:
URL: https://github.com/apache/sling-org-apache-sling-scripting-javascript/pull/21
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SLING-13252: Migrate repository tests from commons.testing/Jackrabbit to sling-mock (Oak) [sling-org-apache-sling-scripting-javascript]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #21:
URL: https://github.com/apache/sling-org-apache-sling-scripting-javascript/pull/21#issuecomment-4881040241
## [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-scripting-javascript&pullRequest=21)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org