Roy Teeuwen created SLING-13252:
-----------------------------------

             Summary: Migrate Sling Scripting JavaScript repository tests from 
commons.testing/Jackrabbit to sling-mock (Oak)
                 Key: SLING-13252
                 URL: https://issues.apache.org/jira/browse/SLING-13252
             Project: Sling
          Issue Type: Improvement
          Components: Scripting
            Reporter: Roy Teeuwen
             Fix For: Scripting JavaScript 3.1.6


The repository-based tests (RepositoryScriptingTestBase and its subclasses 
TestSetupTest, ScriptableMapTest, ScriptableNodeTest, ScriptableResourceTest, 
ScriptableVersionTest) ran against the legacy org.apache.sling.commons.testing 
2.1.2 RepositoryTestBase, which spins up a Jackrabbit 2 repository persisted 
via Apache Derby 10.14.

This caused concrete problems:
* Derby validates the JVM default locale strictly as ln[_CO] and rejects 
region-less locales such as en_001 (macOS "English - World"), failing all 
repository tests on such machines (ERROR XBM0X; unfixed in Derby trunk).
* RepositoryTestBase is JUnit 3 (TestCase) based, conflicting with the JUnit 5 
migration from SLING-12510 - the test classes mixed JUnit 5 annotations with 
inherited JUnit 3 assertions.

Changes:
* Migrate RepositoryScriptingTestBase to sling-mock's SlingContext with 
ResourceResolverType.JCR_OAK (in-memory Oak, supports the JCR versioning 
ScriptableVersionTest needs).
* Drop the commons.testing and jackrabbit-core test dependencies, removing 
Derby from the test classpath.
* Add org.apache.sling.testing.sling-mock-oak for a Java 17 compatible Oak; 
exclude the stale Oak 1.22 that sling-mock.core pulls transitively.
* Complete the JUnit 5 migration by removing all JUnit 3 assertion/TestCase 
usage.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to