You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:26:21 UTC

[sling-org-apache-sling-testing-sling-mock] annotated tag org.apache.sling.testing.sling-mock-2.2.10 created (now a031da4)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git.


      at a031da4  (tag)
 tagging 60497df4bcc540461fba25af628f04f97077417e (commit)
      by Stefan Seifert
      on Thu May 11 12:17:03 2017 +0000

- Log -----------------------------------------------------------------
org.apache.sling.testing.sling-mock-2.2.10
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 2aa4712  SLING-4042 Donate sling-mock, jcr-mock, osgi-mock implementation
     new d63d89c  svn:ignore
     new a6e7c1a  SLING-4042 move all mock projects to mocks/ subdirectory
     new d1f839a  SLING-4042 add missing package-info files
     new e9e968a  SLING-4042 per default no charencoding should be set in mock response
     new 43eb350  SLING-4042 do not forget to register ResourceResolverFactory in OSGi context as well
     new 3d36daf  SLING-4042 make sure JCR mock supports accessing data using multiple sessions
     new 4fc4baf  SLING-4042 add README files
     new 4aa90b9  add/update SCM urls
     new 22c8024  update to released versions
     new 1ba5459  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.0.0
     new 5dcb3d7  [maven-release-plugin] prepare for next development iteration
     new 5b0b3fe  update dependencies in release process to next snapshot version
     new 1f52235  SLING-4085 NPE when using SlingContext rule without constructor argument
     new 9442dd8  SLING-4086 SlingHttpServlerRequest should support getResourceBundle() methods
     new 2f5faf4  set to released version now available on maven central
     new 6964d49  SLING-4090 Define package versions for Sling Mock, JCR Mock, OSGi Mock
     new 448fe45  SLING-4108 JCR/Sling/ResourceResolver Mock: Support providing authentication info
     new 5b4c01c  fix some javadoc errors and warnings
     new cb5f237  SLING-4162 Introduce "OsgiContext" junit rule for OSGi and OsgiContextImpl
     new e72ad4b  SLING-4229 add test cases for deep path access support in sling-mock as well
     new a07abf8  SLING-4108 default to getAdministrativeResourceResolver in sling-mock to support jackrabbit resource resolver adapter as well
     new 3cbedc6  fix some javadoc errors/warnings
     new 47cc45e  update to released versions
     new fccd947  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.1.0
     new 4b72ed2  [maven-release-plugin] prepare for next development iteration
     new 85cdaa4  update to next snapshot version until releases available in maven central
     new 2de8a96  SLING-4266 - SlingContext always uses the default resourceResolverType
     new 0a167f6  SLING-4268 - ContentLoader should not try to import ACLs
     new 9ee66c6  SLING-4269 - SlingContextImpl's resource resolver should be an administrative one
     new 6f6321b  switch back to released versions for dependencies
     new a969262  SLING-4267 add some more property names to be ignored on import because they are managed by JCR internally
     new 62e7e2a  SLING-4267 support importing nt:resource noded in jackrabbit with empty binary data enable content loader unit tests in sling-mock-jackrabbit
     new 6569ce2  assertions can be activated now after updating to latest mock dependencies
     new b816e47  SLING-4267 support importing nt:resource nodes in jackrabbit with empty binary data
     new 32c3978  update dependencies to released versions
     new c05aeae  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.1.2
     new e57b7e1  [maven-release-plugin] prepare for next development iteration
     new d9fcb59  update to next development snapshot unit released artifacts are in maven central
     new c0e8f71  switch back to released versions now available in maven central
     new e8d2807  SLING-4362 make sure JCR namespaces are correctly registered in JCR mock on initialization through sling mock
     new 90ddb94  SLING-4376 ResourceResolver.resolve(null) should resolve to root resource
     new c49b0e1  SLING-4394 Sling Mock with JCR-based Resource Resolver: Support default search paths
     new 5e1c2d6  SLING-848 Support getting versioned resources by using uri path parameters
     new 4e72c06  Use the recent resourceresolver SNAPSHOT in sling-mock
     new eb9da99  SLING-848 revert updating sling api/resource resolver/jcr resource dependenciens - using sling mock in a project should not enforce using the latest version of those keep adding of getThreadResourceResolver() method, but throw UnsupportedOperationException
     new 2259bfe  SLING-4431 Sling Mocks: Remove Dependency on ResourceResolverInjector
     new 74de88f  cosmetic code formatting changes
     new 9e35c02  SLING-4434 refactor integration with sling models: remove MockModelAdapterFactory and directly integrate the original ModelAdapterFactory using the new osgi mock dynamic service reference feature
     new 71bbb5c  SLING-4437 MockJcrResourceResolverFactory should allow to register services dynamically
     new fc5346f  SLING-4433 use real AdapterManagerImpl implementation with support for ADAPTER_CLASSES/ADAPTABLE_CLASSES
     new a4d3ac9  SLING-4433 remove dependency to org.apache.sling.adapter and inline helper classes instead
     new 58f81ee  update to release versions
     new ac35a62  update package version
     new 29e7fda  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.2.0
     new f96f34a  [maven-release-plugin] prepare for next development iteration
     new 93110e5  remove service description and vendor for this mock service - makes problems with baseline check
     new f187b33  remove service description and vendor for this mock service - makes problems with baseline check
     new 1b68139  update to next development snapshot unit released artifacts are in maven central
     new 53be964  switch to released versions
     new 34954fa  SLING-4522 Sling Mocks: ContentLoader fails for UTF8 encoded json files on Windows Systems
     new 75d379a  Fix scr xml parsing when updating to new scr plugin by using fix for SLING-4670
     new b0f4a0a  SLING-4698 - Set parent.relativePath to empty for all modules
     new 28f1b00  SLING-4654 Support ResourceResolver.findResources with JCR_MOCK
     new 6728203  SLING-4721 sling-mock: Fully support ResourceResolverFactoryActivator for jcr-mock
     new 8a9b3c4  SLING-4729 Sling Mock: Add "NONE" resource resolver type
     new 5d2ffa2  SLING-4470 introduce separate "logging-mock" project for default log configuration in mock tests, remove compile-dependency on slf4j-simple
     new 192936d  update dependencies for release
     new ab204bb  update dependencies for release
     new 5482f51  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.3.0
     new 7baf341  [maven-release-plugin] prepare for next development iteration
     new 9a0fa2b  update to next development snapshot unit released artifacts are in maven central
     new bb58061  SLING-4605 - Add support for an Oak resource resolver type mock
     new 3601bfd  Mocks: use latest snapshots
     new b6207fb  SLING-4605 - Add support for an Oak resource resolver type mock
     new bac4c7f  update to released mock versions
     new 37c868a  SLING-4756 add support for filtering via felix.framework FilterImpl implementation
     new 546986a  SLING-4605 javadoc updates and add initializing for ContextResourceResolverFactory
     new 6e3e339  Minor wording fixes when the ResourceResolverTypeAdapter can't be found.
     new f4c6d5d  SLING-4775 - MockSlingSettingService shoud support getSlingId()
     new 7a57b01  SLING-4775 move the now supported method out of the "unsupported operations" block
     new e0cc675  SLING-4773 ensure sling namespace is always registered when using JCR_MOCK resource resolver adapter
     new d39a8a6  update to released versions
     new 54d3fe0  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.4.0
     new 8913f6c  [maven-release-plugin] prepare for next development iteration
     new 37fa126  update to latest development snapshots
     new df31839  Update to Sling Parent 23
     new e497760  Testing: remove superflous sling.java.version=6 as it's the default now
     new d8691fa  switch to released versions
     new a3f2ae9  set parent version to 24 and add empty relativePath where missing
     new 05758ef  SLING-4932, make compatible with o.a.s.jcr.resource 2.5 (requires also an upgrade to Sling API 2.9)
     new 169f6e0  SLING-4932 switch back to old api/jcr.resource versions and ensure compatibility by initiating PathMapper service by reflection if it exists
     new 9ab5f09  SLING-4938 exclude optional transitive dependencies of reflections
     new 347ce2a  SLING-4990 Support HttpSession invalidate, new, lastAccessedTime, maxInteractiveInterval
     new 602f4a9  SLING-4993 Support RequestParameter in MockSlingHttpServlerRequest
     new ec0efee  SLING-4994 Support InputStream, ContentLenght, ContentType and CharacterEncoding in Request
     new 489ae34  SLING-4998 ResponseBodySupport - use default charset if no response charset is set
     new 9832809  cosmetic: beautify error messages when setup/teardown fails
     new da53509  SLING-5002 - [sling-mock] Update dependency version of org.reflections
     new 3fafd8e  SLING-5003 Support request dispatcher in MockSlingHttpServletRequest
     new b4037bf  SLING-5002 switch back to 0.9.9 due to threading issues in 0.9.10 when running junit tests in parallel
     new e52575e  update other mocks to latest releases
     new 2a934a4  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.5.0
     new 8f19c45  [maven-release-plugin] prepare for next development iteration
     new d58abbe  switch to latest snapshot version until release is available in maven central
     new 07c6650  SLING-5007 add unit test to explicitly test root path child listing in sling-mock as well
     new d5ebb42  SLING-5007 realx unit test to test root path child listing in sling-mock-jackrabbit and sling-mock-jackrabbit and sling-mock-oak because in real repositories multiple root test nodes may be created in parallel, or nodes already exist
     new 8580a55  update release versions
     new 5846795  update to next snapshot version until releases are available in maven central
     new f960880  SLING-5007 use same unit tests for root node tests for all resource resolver types without counting the number of children.
     new 0ac864b  switch back to released version
     new add520f  SLING-5042 ResourceResolver.commit() does not call session.save() on the backing JCR Session
     new 8123868  SLING-5043 sling-mocks: Execute commit() after ContentLoader operations
     new c1ce2e6  SLING-5057 - Support HttpServletRequest#getRemoteUser
     new b10d3bb  SLING-5057 - Support HttpServletRequest#getRemoteUser
     new 53bfbe5  SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
     new 853e02b  SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
     new c7551b3  cosmetic: fix log message
     new 317bf58  SLING-5066 sling-mock: Close ResourceResolver on JUnit test tearDown
     new f008644  SLING-5064 sling-mock: Register JCR node types for OSGi bundles in class path
     new 8c79b81  SLING-5067 sling-mock: "uniqueRoot()" to simplify creation and cleanup of unique root paths in repository
     new b24a116  SLING-5067 rewrite unit tests to use new "uniqueRoot" feature
     new 3c296a7  SLING-5064 manual registration of node types no longer required; register namespaces and node types centrally depending on NodeTypeMode
     new d795bcc  SLING-5067 fix cleanup issue with "uniqueRoot" feature
     new d74181d  SLING-5086 sling-mock: Add SlingContext.registerAdapter convenience method
     new fd0b260  SLING-5086 sling-mock: Add SlingContext.registerAdapter convenience method
     new cf03565  cosmetic: eliminate some javadoc warnings
     new 5c7c77d  SLING-5088 update to latest osgi-mock to make sure all services are deactivated properly
     new 856784c  SLING-5088 refactor unit test to make sure resource resolver and bundle contexts are properly shutdown
     new b90bd44  SLING-5088 refactor resource resolver initialization
     new 81f87d0  SLING-5088 rewrite setup code for resource resolver factory
     new 1b9e8db  SLING-5088 deprecate all methods that may lead to thread leaks
     new 8801d99  SLING-5088 control SlingRepository resources via activate/deactivate methods; make sure all oak ExecutorServices are shutdown properly
     new c1525db  cosmetic: fix javadoc errors
     new 47f0035  SLING-5088 avoid registering ResourceResolverFactory twice
     new 21a5c64  SLING-5088 register default service user mapping for mock bundle
     new 2b7ac22  Update the main reactor to parent 25
     new 1089980  update dependency
     new 8949c00  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.6.0
     new 90239a1  [maven-release-plugin] prepare for next development iteration
     new 9f9253b  set dependencies to next snapshot version until released versions are available in maven central
     new 7ac242f  switch back to released versions of dependency
     new 1f318cf  SLING-5197 sling-mock: Do not override ResourceResolverFactoryActivator's default values
     new f7609c8  SLING-5197 sling-mock: Do not override ResourceResolverFactoryActivator's default values
     new d444456  update to latest osgi-mock version
     new dd7948a  SLING-5339 sling-mock: Support remote add, remote host and remote port in MockSlingHttpSevletRequest
     new a52790b  SLING-5392 sling-mock: Use javax.servlet-api dependency instead of mortbay version
     new 3234a24  Switch to parent pom 26
     new dfd873c  SLING-5428 Move MockSlingHttpServletRequest+Response to org.apache.sling.servlet-helpers
     new e7cd297  update mock dependencies to latest versions
     new 0186990  fix javadoc errors
     new 64a8b38  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-1.6.2
     new a56450f  [maven-release-plugin] prepare for next development iteration
     new 37d2b26  update to next snapshot dependency until released artifacts are available in maven central
     new e39da4c  update to released versions
     new 6759ae4  SLING-5546 Update to Sling API 2.11 and dependencies
     new 41b471d  SLING-5546 remove deprecated methods
     new 22cce0c  SLING-5547 Update sling-mock-oak to Sling API 2.11 and Oak 1.3.15
     new 05a8c47  SLING-5548 Remove JCR_JACKRABBIT resource resolver type
     new e2054b1  SLING-5547 Update sling-mock-oak to Sling API 2.11 and Oak 1.3.15
     new 8476a66  add unit test to test adapter factory overlays
     new 57b714b  SLING-5667 adapt to changes service ranking order in osgi-mock
     new 08b7fd5  SLING-5769 expose resource resolver factory from SlingContext
     new ec77950  SLING-5769 reverted r1747508 since it is already exposed through getService(...)
     new 3239d98  SLING-5770 add support for custom resource resolver factory activator configuration via SlingContextBuilder add support for additional callbacks before setup and after teardown
     new 7d5c794  SLING-5770 update javadoc
     new 0b0cd7e  update dependencies to released versions
     new 17d3932  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.0.0
     new edd14e1  [maven-release-plugin] prepare for next development iteration
     new a3952b6  SLING-5968 sling-mock: Update to latest servlet-helpers
     new b296e07  SLING-5970 mocks: Update to Parent Pom 28
     new 143930c  SLING-5970 switch to osgi annotations
     new dcea6ec  Update to 3.0.2 to avoid heap space problem
     new 2891337  SLING-6040 add ResourceBuilder support to SlingContext This closes #167
     new 256b173  SLING-6049 sling-mock ContentBuilder: Support creating resources with object vararg parameter
     new f412e8d  SLING-6049 use MapUtil from osgi-mock
     new 0e3ccde  update dependencies
     new 70d871d  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.1.0
     new 2b820fa  [maven-release-plugin] prepare for next development iteration
     new ab2cc19  update dependencies to latest snapshots until released versions are available in maven central
     new e5cf893  switch back to released versions
     new 0bf6410  fix indentation
     new df1f8db  SLING-6077 sling-mock: ResourceResolverFactory is registered twice
     new 4341eb9  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.1.2
     new be969f7  [maven-release-plugin] prepare for next development iteration
     new fa2b952  update to latest resourcebuilder snapshot
     new 843e0c8  update to released version
     new 3d5d93e  update to parent 29
     new df62a8e  SLING-6356 osgi-mock: Fallback to default when reference field collection type is missing in SCR metadata
     new 02a5370  SLING-6359 osgi-mock, sling-mock: Make ContextCallback and ContextBuilder more flexible
     new c539b44  fix javadoc errors
     new 99270aa  SLING-6359 context plugin support
     new 80d0e0d  SLING-6363 Automatically register Sling Models from Classpath also: - add SlingContext.addModelsForClasses method - fix bug in addModelsForPackages that registered "sibling" packages with same prefix as well - make sure classpath scanning takes place only once for alle unit tests, not for each unit test which requests the same package - witch NodeTypeDefinitionScanner to osgi-mock ManifestScanner as well
     new a7e2fa4  fix javadoc errors
     new 28317f0  update osgi-mock dependency
     new 80bc845  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.0
     new fc132d0  [maven-release-plugin] prepare for next development iteration
     new 767a64b  update to next snapshot version until releases are available on maven central
     new f9f5ac5  cosmetic: fix javadoc typos
     new d9f6ebc  update to osgi-mock,sling-mock release versions
     new 605e327  update to latest jcr-mock snapshot
     new a67e189  SLING-6387 Allow to control autocommit mode for ContentLoader (patch provided by Dirk Rudolph, with modifications)
     new 23535c2  update to release version
     new 9e983a2  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.2
     new 1c60fbb  [maven-release-plugin] prepare for next development iteration
     new edcb1a4  update to next snapshot version until releases are available on maven central
     new 436ba66  switch to released versions
     new d044ce3  SLING-6410 sling-mock: Add support für scripting BindingsValuesProvidersByContext
     new 9339002  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.4
     new f7eb8c3  [maven-release-plugin] prepare for next development iteration
     new 1070444  update unit tests to test BigDecimal conversion (related to SLING-6416)
     new 9913dd3  activate unit tests related to SLING-3846 - this is solved in the dependencies used by sling mocks 2.x
     new 3bb72d8  update to latest resourceresolver-mock version
     new 6648673  set to released version
     new 6a5747c  update to latest osgi-mock version
     new 9e5310b  SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files
     new 9fb839d  SLING-6595 update to latest API
     new 268c499  use Sling Parent 30
     new 1f0ff4c  fix compile errors after switchting to parent 30: - add scr annotation dependency where appropiate or remove maven-scr-plugin - switch to osgi versioning annotations
     new 38d4dc6  SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files
     new d5be652  switch to MockOsgi.setConfigForPid
     new 7e3d73c  SLING-6595 switch to latest contentparser API
     new f0f5b08  SLING-6673 sling-mock: Switch to OSGi annotations
     new 8c9a1fc  update dependencies
     new 863898e  SLING-6728 sling-mock: Resource Resolver Type "NONE" does not work
     new 26d77aa  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.6
     new 91d5a39  [maven-release-plugin] prepare for next development iteration
     new 6f180fb  update dependency
     new 558e0a0  add profile latest-resource-bundles for testing update osgi-mock dependency
     new 2c484d7  SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory
     new 960d105  SLING-6813 sling-mock: Make compatible with org.apache.sling.jcr.resource 3.0.0
     new f9cd76c  SLING-6814 jcr-mock: Implement JackrabbitObservationManager
     new 8f1c0f7  SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory
     new 3037a73  update dependencies
     new 37052e3  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.8
     new debf3cf  [maven-release-plugin] prepare for next development iteration
     new a5415e1  update to next development version until release version is available on maven central
     new 1c96014  update dependencies
     new 9abcefe  switch to release versions
     new c6c2ff2  SLING-6841 Sling Mocks should inject ResourceResolverFactory by default
     new c6a0d84  SLING-6845 sling-mock: Support Sling Models Impl 1.4.0
     new 21afa1f  update dependency
     new ac8af48  [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.10
     new 60497df  [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-2.2.10

The 244 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-testing-sling-mock] 25/48: switch to MockOsgi.setConfigForPid

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit d5be6529f2fab6e07d951b4d27919b7be9c28a63
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Mar 14 22:12:05 2017 +0000

    switch to MockOsgi.setConfigForPid
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1786960 13f79535-47bb-0310-9956-ffa450edef68
---
 .../mock/sling/context/SlingContextImpl.java       | 28 ++--------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index a9501e1..dc5e986 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -18,9 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.context;
 
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Hashtable;
 import java.util.Map;
 import java.util.Set;
 
@@ -52,6 +49,7 @@ import org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService;
 import org.apache.sling.scripting.core.impl.BindingsValuesProvidersByContextImpl;
 import org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory;
 import org.apache.sling.settings.SlingSettingsService;
+import org.apache.sling.testing.mock.osgi.MockOsgi;
 import org.apache.sling.testing.mock.osgi.context.OsgiContextImpl;
 import org.apache.sling.testing.mock.sling.MockSling;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
@@ -65,10 +63,6 @@ import org.apache.sling.testing.mock.sling.servlet.MockSlingHttpServletResponse;
 import org.osgi.annotation.versioning.ConsumerType;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Function;
 import com.google.common.collect.ImmutableMap;
@@ -87,8 +81,6 @@ public class SlingContextImpl extends OsgiContextImpl {
 
     private static final String RESOURCERESOLVERFACTORYACTIVATOR_PID = "org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl";
     
-    private static final Logger log = LoggerFactory.getLogger(SlingContextImpl.class);
-    
     protected ResourceResolverFactory resourceResolverFactory;
     protected ResourceResolverType resourceResolverType;
     protected ResourceResolver resourceResolver;
@@ -123,23 +115,7 @@ public class SlingContextImpl extends OsgiContextImpl {
         
         if (this.resourceResolverFactoryActivatorProps != null) {
             // use OSGi ConfigurationAdmin to pass over customized configuration to Resource Resolver Factory Activator service
-            ConfigurationAdmin configAdmin = getService(ConfigurationAdmin.class);
-            if (configAdmin == null) {
-              log.warn("ConfigAdmin not found in osgi-mock context - please make sure osgi-mock 1.7.0 or higher is used.");
-            }
-            else {
-              try {
-                Configuration resourceResolverFactoryActivatorConfig = configAdmin.getConfiguration(RESOURCERESOLVERFACTORYACTIVATOR_PID);
-                Dictionary<String, Object> props = new Hashtable<String, Object>();
-                for (Map.Entry<String, Object> item : this.resourceResolverFactoryActivatorProps.entrySet()) {
-                    props.put(item.getKey(), item.getValue());
-                }
-                resourceResolverFactoryActivatorConfig.update(props);
-              }
-              catch (IOException ex) {
-                throw new RuntimeException(ex);
-              }
-            }
+            MockOsgi.setConfigForPid(bundleContext(), RESOURCERESOLVERFACTORYACTIVATOR_PID, this.resourceResolverFactoryActivatorProps);
         }
         
         this.resourceResolverFactory = newResourceResolverFactory();

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 33/48: add profile latest-resource-bundles for testing update osgi-mock dependency

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 558e0a09cfddba53dc57d8cb68e7804d20fb78ba
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Apr 28 15:42:10 2017 +0000

    add profile latest-resource-bundles for testing
    update osgi-mock dependency
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793113 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3d3881c..39cb36f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.4</version>
+            <version>2.2.5-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
@@ -261,4 +261,42 @@
         </plugins>
     </build>
   
+    <profiles>
+        <profile>
+            <id>latest-resource-bundles</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.sling</groupId>
+                    <artifactId>org.apache.sling.api</artifactId>
+                    <version>2.16.2</version>
+                    <scope>compile</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.sling</groupId>
+                    <artifactId>org.apache.sling.resourceresolver</artifactId>
+                    <version>1.5.22</version>
+                    <scope>compile</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.sling</groupId>
+                    <artifactId>org.apache.sling.jcr.resource</artifactId>
+                    <version>2.9.2</version>
+                    <scope>compile</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.jackrabbit</groupId>
+                    <artifactId>jackrabbit-api</artifactId>
+                    <version>2.13.4</version>
+                    <scope>provided</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.jackrabbit</groupId>
+                    <artifactId>oak-jcr</artifactId>
+                    <version>1.5.15</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+  
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 34/48: SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 2c484d7b21be3983bd61ed83953aa1e9b1f35eab
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Apr 29 07:25:35 2017 +0000

    SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793172 13f79535-47bb-0310-9956-ffa450edef68
---
 .../mock/sling/ResourceResolverFactoryInitializer.java      |  1 +
 .../sling/testing/mock/sling/context/SlingContextImpl.java  | 12 +++++++++---
 .../mock/sling/context/NoResourceResolverTypeTest.java      | 13 +++++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
index 65d8dc1..0b42c49 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
@@ -124,6 +124,7 @@ class ResourceResolverFactoryInitializer {
         Dictionary<String, Object> config = new Hashtable<String, Object>();
         // do not required a specific resource provider (otherwise "NONE" will not work)
         config.put("resource.resolver.required.providers", "");
+        config.put("resource.resolver.required.providernames", "");
         ResourceResolverFactoryActivator activator = new ResourceResolverFactoryActivator();
         MockOsgi.injectServices(activator, bundleContext);
         MockOsgi.activate(activator, bundleContext, config);
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index dc5e986..20557eb 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -118,7 +118,6 @@ public class SlingContextImpl extends OsgiContextImpl {
             MockOsgi.setConfigForPid(bundleContext(), RESOURCERESOLVERFACTORYACTIVATOR_PID, this.resourceResolverFactoryActivatorProps);
         }
         
-        this.resourceResolverFactory = newResourceResolverFactory();
         registerDefaultServices();
     }
     
@@ -129,6 +128,13 @@ public class SlingContextImpl extends OsgiContextImpl {
     protected ResourceResolverFactory newResourceResolverFactory() {
         return ContextResourceResolverFactory.get(this.resourceResolverType, bundleContext());
     }
+    
+    private ResourceResolverFactory resourceResolverFactory() {
+        if (this.resourceResolverFactory == null) {
+            this.resourceResolverFactory = newResourceResolverFactory();
+        }
+        return this.resourceResolverFactory;
+    }
 
     /**
      * Default services that should be available for every unit test
@@ -212,7 +218,7 @@ public class SlingContextImpl extends OsgiContextImpl {
     public final ResourceResolverType resourceResolverType() {
         return this.resourceResolverType;
     }
-
+    
     /**
      * Returns the singleton resource resolver bound to this context.
      * It is automatically closed after the test.
@@ -221,7 +227,7 @@ public class SlingContextImpl extends OsgiContextImpl {
     public final ResourceResolver resourceResolver() {
         if (this.resourceResolver == null) {
             try {
-                this.resourceResolver = this.resourceResolverFactory.getAdministrativeResourceResolver(null);
+                this.resourceResolver = this.resourceResolverFactory().getAdministrativeResourceResolver(null);
             } catch (LoginException ex) {
                 throw new RuntimeException("Creating resource resolver failed.", ex);
             }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
index bf861f3..5af4d3e 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
@@ -22,18 +22,31 @@ import static org.junit.Assert.assertTrue;
 
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.SyntheticResource;
+import org.apache.sling.spi.resource.provider.ResourceProvider;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
 
+@RunWith(MockitoJUnitRunner.class)
 public class NoResourceResolverTypeTest {
 
     @Rule
     public SlingContext context = new SlingContext(ResourceResolverType.NONE);
     
+    @Mock
+    private ResourceProvider<?> resourceProvider;
+    
     @Test
     public void testRoot() {
+        // resgister dummy resource provider because otherwise ResourceResolverFactory get's not activated
+        // with lates sling resource resolver implementation
+        context.registerService(ResourceProvider.class, resourceProvider,
+                ResourceProvider.PROPERTY_ROOT, "/");
+        
         Resource root = context.resourceResolver().getResource("/");
         assertTrue(root instanceof SyntheticResource);
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 02/48: update to next snapshot version until releases are available on maven central

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 767a64baf8e7d6ffd2e36878eb89a770ce8f2cb9
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 5 17:49:35 2016 +0000

    update to next snapshot version until releases are available on maven central
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1772738 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b223636..cf2a5c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.0</version>
+            <version>2.2.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 17/48: update to latest resourceresolver-mock version

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3bb72d8ffe46cc93d120fe646b3e9dbee3a2ee32
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Dec 21 14:21:01 2016 +0000

    update to latest resourceresolver-mock version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1775431 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                            | 2 +-
 .../mock/sling/resource/AbstractSlingCrudResourceResolverTest.java | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8f7647d..3d2c0c2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.resourceresolver-mock</artifactId>
-            <version>1.1.14</version>
+            <version>1.1.15-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
index d42d199..7b0d5e7 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
@@ -144,11 +144,8 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
         ValueMap props = ResourceUtil.getValueMap(resource1);
 
-        // TODO: enable this test when resourceresolver-mock implementation supports BigDecimal conversion (SLING-6416)
-        if (getResourceResolverType() != ResourceResolverType.RESOURCERESOLVER_MOCK) {
-            assertEquals(new BigDecimal(DOUBLE_VALUE).doubleValue(), props.get("doubleProp", BigDecimal.class).doubleValue(), 0.0001d);
-            assertEquals(BIGDECIMAL_VALUE.doubleValue() , props.get("bigDecimalProp", Double.class), 0.0001d);
-        }
+        assertEquals(new BigDecimal(DOUBLE_VALUE).doubleValue(), props.get("doubleProp", BigDecimal.class).doubleValue(), 0.0001d);
+        assertEquals(BIGDECIMAL_VALUE.doubleValue() , props.get("bigDecimalProp", Double.class), 0.0001d);
     }
 
     @Test

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 36/48: SLING-6814 jcr-mock: Implement JackrabbitObservationManager

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit f9cd76c4df5353dbbef7ba4a2c00ce946a5ebba3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Apr 29 07:53:37 2017 +0000

    SLING-6814 jcr-mock: Implement JackrabbitObservationManager
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793174 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index ab30579..2160eef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.2.0</version>
+            <version>1.2.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 47/48: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.10

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit ac8af48907821fc679833816e414139ef6e6a25c
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu May 11 12:16:50 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.10
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794822 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 33d41e1..32292fb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.9-SNAPSHOT</version>
+    <version>2.2.10</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.10</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.10</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.10</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 28/48: update dependencies

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 8c9a1fc44b61887be1be7273c900adfc37569c7a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Mar 23 15:13:09 2017 +0000

    update dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1788266 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index e970ced..b911791 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.3-SNAPSHOT</version>
+            <version>2.2.4</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
@@ -132,7 +132,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.contentparser</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>1.0.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 32/48: update dependency

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 6f180fbc286c4e2c75ace5b2f36faaf6b690588a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Apr 4 08:59:22 2017 +0000

    update dependency
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1790081 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 264b1e0..3d3881c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.resourceresolver-mock</artifactId>
-            <version>1.1.16</version>
+            <version>1.1.18</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 39/48: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.8

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 37052e31130e929b227fe457193062190b0d7a3a
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 2 16:05:08 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.8
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793553 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2d5675b..a6e9128 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.7-SNAPSHOT</version>
+    <version>2.2.8</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 46/48: update dependency

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 21afa1f08a63ad03eaa02160ec04e1e7d33ef7a1
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu May 11 12:16:17 2017 +0000

    update dependency
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794821 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 07f9a9b..33d41e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.3.1-SNAPSHOT</version>
+            <version>2.3.2</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 42/48: update dependencies

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 1c9601422e9289a3647bcabb9dc356834baa79f3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri May 5 20:16:20 2017 +0000

    update dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794101 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f0b3a20..e91a776 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.3.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 15/48: update unit tests to test BigDecimal conversion (related to SLING-6416)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 10704445932ada10a026a210f816dd0afe250921
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 11:49:26 2016 +0000

    update unit tests to test BigDecimal conversion (related to SLING-6416)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1775063 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractSlingCrudResourceResolverTest.java     | 40 ++++++++++++++++++----
 1 file changed, 34 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
index 12d54b2..f13f792 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
@@ -27,6 +27,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -63,7 +64,9 @@ public abstract class AbstractSlingCrudResourceResolverTest {
     private static final String STRING_VALUE = "value1";
     private static final String[] STRING_ARRAY_VALUE = new String[] { "value1", "value2" };
     private static final int INTEGER_VALUE = 25;
+    private static final long LONG_VALUE = 250L;
     private static final double DOUBLE_VALUE = 3.555d;
+    private static final BigDecimal BIGDECIMAL_VALUE = new BigDecimal("12345.678");
     private static final boolean BOOLEAN_VALUE = true;
     private static final Date DATE_VALUE = new Date(10000);
     private static final Calendar CALENDAR_VALUE = Calendar.getInstance();
@@ -83,7 +86,9 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         props.put("stringProp", STRING_VALUE);
         props.put("stringArrayProp", STRING_ARRAY_VALUE);
         props.put("integerProp", INTEGER_VALUE);
+        props.put("longProp", LONG_VALUE);
         props.put("doubleProp", DOUBLE_VALUE);
+        props.put("bigDecimalProp", BIGDECIMAL_VALUE);
         props.put("booleanProp", BOOLEAN_VALUE);
         props.put("dateProp", DATE_VALUE);
         props.put("calendarProp", CALENDAR_VALUE);
@@ -118,12 +123,35 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         ValueMap props = ResourceUtil.getValueMap(resource1);
         assertEquals(STRING_VALUE, props.get("stringProp", String.class));
         assertArrayEquals(STRING_ARRAY_VALUE, props.get("stringArrayProp", String[].class));
-        assertEquals((Integer) INTEGER_VALUE, props.get("integerProp", Integer.class));
+        assertEquals((Integer)INTEGER_VALUE, props.get("integerProp", Integer.class));
+        assertEquals((Long)LONG_VALUE, props.get("longProp", Long.class));
         assertEquals(DOUBLE_VALUE, props.get("doubleProp", Double.class), 0.0001);
+        assertEquals(BIGDECIMAL_VALUE, props.get("bigDecimalProp", BigDecimal.class));
         assertEquals(BOOLEAN_VALUE, props.get("booleanProp", Boolean.class));
     }
 
     @Test
+    public void testSimpleProperties_IntegerLongConversion() throws IOException {
+        Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
+        ValueMap props = ResourceUtil.getValueMap(resource1);
+
+        assertEquals((Integer)(int)LONG_VALUE, props.get("longProp", Integer.class));
+        assertEquals((Long)(long)INTEGER_VALUE, props.get("integerProp", Long.class));
+    }
+
+    @Test
+    public void testSimpleProperties_DecimalConversion() throws IOException {
+        Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
+        ValueMap props = ResourceUtil.getValueMap(resource1);
+
+        // TODO: enable this test when resourceresolver-mock implementation supports BigDecimal conversion (SLING-6416)
+        if (getResourceResolverType() != ResourceResolverType.RESOURCERESOLVER_MOCK) {
+            assertEquals(new BigDecimal(DOUBLE_VALUE).doubleValue(), props.get("doubleProp", BigDecimal.class).doubleValue(), 0.0001d);
+            assertEquals(BIGDECIMAL_VALUE.doubleValue() , props.get("bigDecimalProp", Double.class), 0.0001d);
+        }
+    }
+
+    @Test
     public void testSimpleProperties_DeepPathAccess() throws IOException {
         Resource resource1 = context.resourceResolver().getResource(testRoot.getPath());
         assertNotNull(resource1);
@@ -132,8 +160,10 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         ValueMap props = ResourceUtil.getValueMap(resource1);
         assertEquals(STRING_VALUE, props.get("node1/stringProp", String.class));
         assertArrayEquals(STRING_ARRAY_VALUE, props.get("node1/stringArrayProp", String[].class));
-        assertEquals((Integer) INTEGER_VALUE, props.get("node1/integerProp", Integer.class));
+        assertEquals((Integer)INTEGER_VALUE, props.get("node1/integerProp", Integer.class));
+        assertEquals((Long)LONG_VALUE, props.get("node1/longProp", Long.class));
         assertEquals(DOUBLE_VALUE, props.get("node1/doubleProp", Double.class), 0.0001);
+        assertEquals(BIGDECIMAL_VALUE, props.get("node1/bigDecimalProp", BigDecimal.class));
         assertEquals(BOOLEAN_VALUE, props.get("node1/booleanProp", Boolean.class));
         assertEquals(STRING_VALUE, props.get("node1/node11/stringProp11", String.class));
     }
@@ -142,8 +172,7 @@ public abstract class AbstractSlingCrudResourceResolverTest {
     public void testDateProperty() throws IOException {
         Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
         ValueMap props = ResourceUtil.getValueMap(resource1);
-        // TODO: enable this test when JCR resource implementation supports
-        // writing Date objects (SLING-3846)
+        // TODO: enable this test when JCR resource implementation supports writing Date objects (SLING-3846)
         if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
                 && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
             assertEquals(DATE_VALUE, props.get("dateProp", Date.class));
@@ -154,8 +183,7 @@ public abstract class AbstractSlingCrudResourceResolverTest {
     public void testDatePropertyToCalendar() throws IOException {
         Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
         ValueMap props = ResourceUtil.getValueMap(resource1);
-        // TODO: enable this test when JCR resource implementation supports
-        // writing Date objects (SLING-3846)
+        // TODO: enable this test when JCR resource implementation supports writing Date objects (SLING-3846)
         if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
                 && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
             Calendar calendarValue = props.get("dateProp", Calendar.class);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 18/48: set to released version

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 6648673f83e1ca3cbdc2a10ce13a291d2f35c6d3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 27 13:17:54 2016 +0000

    set to released version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1776124 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3d2c0c2..7de79d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.resourceresolver-mock</artifactId>
-            <version>1.1.15-SNAPSHOT</version>
+            <version>1.1.16</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 24/48: SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 38d4dc6890233a967e4628c306566cc1c116397c
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Mar 14 10:42:37 2017 +0000

    SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1786870 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                      |  2 +-
 .../sling/testing/mock/sling/loader/ContentLoader.java       | 12 ++++++------
 .../testing/mock/sling/NodeTypeDefinitionScannerTest.java    |  1 -
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/pom.xml b/pom.xml
index afa5eb8..6c89a0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -137,7 +137,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.fscontentparser</artifactId>
+            <artifactId>org.apache.sling.jcr.contentparser</artifactId>
             <version>1.0.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
index 68740ce..73120f9 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
@@ -33,11 +33,11 @@ import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.commons.mime.MimeTypeService;
-import org.apache.sling.fscontentparser.ContentFileParser;
-import org.apache.sling.fscontentparser.ContentFileParserFactory;
-import org.apache.sling.fscontentparser.ContentFileType;
-import org.apache.sling.fscontentparser.ParseException;
-import org.apache.sling.fscontentparser.ParserOptions;
+import org.apache.sling.jcr.contentparser.ContentParser;
+import org.apache.sling.jcr.contentparser.ContentParserFactory;
+import org.apache.sling.jcr.contentparser.ContentType;
+import org.apache.sling.jcr.contentparser.ParseException;
+import org.apache.sling.jcr.contentparser.ParserOptions;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
@@ -65,7 +65,7 @@ public final class ContentLoader {
             "jcr:isCheckedOut",
             "rep:policy");
     
-    private static ContentFileParser JSON_PARSER = ContentFileParserFactory.create(ContentFileType.JSON, new ParserOptions()
+    private static ContentParser JSON_PARSER = ContentParserFactory.create(ContentType.JSON, new ParserOptions()
             .detectCalendarValues(true)
             .ignorePropertyNames(IGNORED_NAMES)
             .ignoreResourceNames(IGNORED_NAMES));
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/NodeTypeDefinitionScannerTest.java b/src/test/java/org/apache/sling/testing/mock/sling/NodeTypeDefinitionScannerTest.java
index 1b1f888..032129b 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/NodeTypeDefinitionScannerTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/NodeTypeDefinitionScannerTest.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.util.List;
 
-import org.apache.sling.testing.mock.sling.NodeTypeDefinitionScanner;
 import org.junit.Test;
 
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 04/48: update to osgi-mock, sling-mock release versions

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit d9f6ebc269c571b537d2f406634e44135a764796
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Dec 8 21:29:19 2016 +0000

    update to osgi-mock,sling-mock release versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773299 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index cf2a5c9..b223636 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.1-SNAPSHOT</version>
+            <version>2.2.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 09/48: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 1c60fbb6dd323841d15c6ea8a486956878673ff3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 13 12:19:25 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773983 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5101dfb..3221193 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.2</version>
+    <version>2.2.3-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 27/48: SLING-6673 sling-mock: Switch to OSGi annotations

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit f0f5b083af87a0546e343261660146b0a9612c94
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sun Mar 19 16:33:33 2017 +0000

    SLING-6673 sling-mock: Switch to OSGi annotations
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1787643 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 11 --------
 .../testing/mock/sling/MockAdapterManagerImpl.java | 29 +++++++++-------------
 .../testing/mock/sling/MockJcrSlingRepository.java |  8 +++---
 .../sling/testing/mock/sling/package-info.java     |  2 +-
 .../mock/sling/services/MockMimeTypeService.java   |  6 ++---
 .../testing/mock/sling/services/package-info.java  |  2 +-
 6 files changed, 19 insertions(+), 39 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6c89a0c..e970ced 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,12 +43,6 @@
     <dependencies>
   
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
             <version>2.2.3-SNAPSHOT</version>
@@ -264,11 +258,6 @@
               <extensions>true</extensions>
           </plugin>
     
-          <plugin>
-              <groupId>org.apache.felix</groupId>
-              <artifactId>maven-scr-plugin</artifactId>
-          </plugin>
-    
         </plugins>
     </build>
   
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/MockAdapterManagerImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/MockAdapterManagerImpl.java
index 4120292..b3f3825 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/MockAdapterManagerImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/MockAdapterManagerImpl.java
@@ -32,13 +32,6 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.adapter.Adaption;
 import org.apache.sling.adapter.internal.AdapterFactoryDescriptor;
 import org.apache.sling.adapter.internal.AdapterFactoryDescriptorMap;
@@ -51,6 +44,10 @@ import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
 import org.slf4j.Logger;
@@ -62,15 +59,13 @@ import org.slf4j.LoggerFactory;
  * break the {@link ThreadsafeMockAdapterManagerWrapper} concept.
  * Additionally the reference to PackageAdmin is disabled.
  */
-@Component(immediate=true)
-@Service
-@Properties({
-    @Property(name=Constants.SERVICE_DESCRIPTION, value="Sling Adapter Manager"),
-    @Property(name=Constants.SERVICE_VENDOR, value="The Apache Software Foundation")
-
-})
-@Reference(name="AdapterFactory", referenceInterface=AdapterFactory.class,
-cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE, policy=ReferencePolicy.DYNAMIC)
+@Component(immediate=true, service=AdapterManager.class,
+        property={Constants.SERVICE_DESCRIPTION + "=Sling Adapter Manager",
+                Constants.SERVICE_VENDOR + "=The Apache Software Foundation"},
+        reference = @Reference(name="AdapterFactory", service=AdapterFactory.class,
+                cardinality=ReferenceCardinality.MULTIPLE, policy=ReferencePolicy.DYNAMIC,
+                bind="bindAdapterFactory", unbind="unbindAdapterFactory")
+)
 public class MockAdapterManagerImpl implements AdapterManager {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -113,7 +108,7 @@ public class MockAdapterManagerImpl implements AdapterManager {
     /**
      * The service tracker for the event admin
      */
-    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY, policy=ReferencePolicy.DYNAMIC)
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL, policy=ReferencePolicy.DYNAMIC)
     private volatile EventAdmin eventAdmin;
 
     // DISABLED IN THIS COPY OF CLASS
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/MockJcrSlingRepository.java b/src/main/java/org/apache/sling/testing/mock/sling/MockJcrSlingRepository.java
index ffd5f9c..e3073cd 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/MockJcrSlingRepository.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/MockJcrSlingRepository.java
@@ -26,18 +26,16 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
 
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.testing.mock.jcr.MockJcr;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
 
 /**
  * Mock {@link SlingRepository} implementation.
  */
-@Component
-@Service(SlingRepository.class)
+@Component(service = SlingRepository.class)
 public final class MockJcrSlingRepository implements SlingRepository {
 
     private Repository repository;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
index 6456e2a..c0dc58f 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Mock implementation of selected Sling APIs.
  */
-@org.osgi.annotation.versioning.Version("2.0")
+@org.osgi.annotation.versioning.Version("3.0")
 package org.apache.sling.testing.mock.sling;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/services/MockMimeTypeService.java b/src/main/java/org/apache/sling/testing/mock/sling/services/MockMimeTypeService.java
index fbc6fb7..a13ffa3 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/services/MockMimeTypeService.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/services/MockMimeTypeService.java
@@ -21,18 +21,16 @@ package org.apache.sling.testing.mock.sling.services;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.commons.mime.MimeTypeService;
 import org.apache.sling.commons.mime.internal.MimeTypeServiceImpl;
 import org.apache.sling.testing.mock.osgi.MockOsgi;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Component;
 
 /**
  * Mock {@link MimeTypeService} implementation.
  */
-@Component(inherit = false)
-@Service(MimeTypeService.class)
+@Component(service = MimeTypeService.class)
 public final class MockMimeTypeService extends MimeTypeServiceImpl {
 
     private boolean initialized;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/services/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/services/package-info.java
index 30212d1..37315a7 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/services/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/services/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Mocks for selected Sling services.
  */
-@org.osgi.annotation.versioning.Version("2.0")
+@org.osgi.annotation.versioning.Version("2.0.1")
 package org.apache.sling.testing.mock.sling.services;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 38/48: update dependencies

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 3037a730d153856e756549c6c672dc697fd605d3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 2 16:04:38 2017 +0000

    update dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793552 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2160eef..2d5675b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,13 +45,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.5-SNAPSHOT</version>
+            <version>2.3.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.2.1-SNAPSHOT</version>
+            <version>1.3.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
@@ -280,7 +280,7 @@
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.jcr.resource</artifactId>
-                    <version>3.0.1-SNAPSHOT</version>
+                    <version>3.0.0</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 41/48: update to next development version until release version is available on maven central

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit a5415e196037a1215598f1353494dc4e97edef0d
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 2 16:08:38 2017 +0000

    update to next development version until release version is available on maven central
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793556 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index d0779b9..f0b3a20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,13 +45,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.3.0</version>
+            <version>2.3.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.3.0</version>
+            <version>1.3.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 22/48: use Sling Parent 30

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 268c49928049e380f833014532bc669897dd529e
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Mar 6 10:22:30 2017 +0000

    use Sling Parent 30
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1785621 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 1bed73e..a78fc75 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>29</version>
+        <version>30</version>
         <relativePath />
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 16/48: activate unit tests related to SLING-3846 - this is solved in the dependencies used by sling mocks 2.x

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9913dd317a3ec886bd225cb70b488307d7f95874
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 11:56:28 2016 +0000

    activate unit tests related to SLING-3846 - this is solved in the dependencies used by sling mocks 2.x
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1775070 13f79535-47bb-0310-9956-ffa450edef68
---
 .../resource/AbstractSlingCrudResourceResolverTest.java  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
index f13f792..d42d199 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
@@ -172,24 +172,16 @@ public abstract class AbstractSlingCrudResourceResolverTest {
     public void testDateProperty() throws IOException {
         Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
         ValueMap props = ResourceUtil.getValueMap(resource1);
-        // TODO: enable this test when JCR resource implementation supports writing Date objects (SLING-3846)
-        if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
-                && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
-            assertEquals(DATE_VALUE, props.get("dateProp", Date.class));
-        }
+        assertEquals(DATE_VALUE, props.get("dateProp", Date.class));
     }
 
     @Test
     public void testDatePropertyToCalendar() throws IOException {
         Resource resource1 = context.resourceResolver().getResource(getTestRootResource().getPath() + "/node1");
         ValueMap props = ResourceUtil.getValueMap(resource1);
-        // TODO: enable this test when JCR resource implementation supports writing Date objects (SLING-3846)
-        if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
-                && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
-            Calendar calendarValue = props.get("dateProp", Calendar.class);
-            assertNotNull(calendarValue);
-            assertEquals(DATE_VALUE, calendarValue.getTime());
-        }
+        Calendar calendarValue = props.get("dateProp", Calendar.class);
+        assertNotNull(calendarValue);
+        assertEquals(DATE_VALUE, calendarValue.getTime());
     }
 
     @Test

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 20/48: SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9e5310bf7d18be766814af2ab03827323d00dff4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Mar 2 17:29:31 2017 +0000

    SLING-6595 sling-mock: Use File System Content Parser for parsing JSON files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1785167 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   4 +-
 .../testing/mock/sling/loader/ContentLoader.java   | 176 +++------------------
 2 files changed, 26 insertions(+), 154 deletions(-)

diff --git a/pom.xml b/pom.xml
index adf1e27..25c32c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,8 +131,8 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.json</artifactId>
-            <version>2.0.16</version>
+            <artifactId>org.apache.sling.fscontentparser</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
index 87df4b6..7ab801e 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
@@ -21,17 +21,10 @@ package org.apache.sling.testing.mock.sling.loader;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.CharEncoding;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.sling.api.resource.ModifiableValueMap;
@@ -39,11 +32,12 @@ import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
-import org.apache.sling.commons.json.JSONArray;
-import org.apache.sling.commons.json.JSONException;
-import org.apache.sling.commons.json.JSONObject;
-import org.apache.sling.commons.json.jcr.JsonItemWriter;
 import org.apache.sling.commons.mime.MimeTypeService;
+import org.apache.sling.fscontentparser.ContentFileExtension;
+import org.apache.sling.fscontentparser.ContentFileParser;
+import org.apache.sling.fscontentparser.ContentFileParserFactory;
+import org.apache.sling.fscontentparser.ParseException;
+import org.apache.sling.fscontentparser.ParserOptions;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 
@@ -56,13 +50,10 @@ import com.google.common.collect.ImmutableSet;
  */
 public final class ContentLoader {
 
-    private static final String REFERENCE = "jcr:reference:";
-    private static final String PATH = "jcr:path:";
     private static final String CONTENTTYPE_OCTET_STREAM = "application/octet-stream";
     private static final String JCR_DATA_PLACEHOLDER = ":jcr:data";
 
     private static final Set<String> IGNORED_NAMES = ImmutableSet.of(
-            JcrConstants.JCR_PRIMARYTYPE,
             JcrConstants.JCR_MIXINTYPES,
             JcrConstants.JCR_UUID,
             JcrConstants.JCR_BASEVERSION,
@@ -73,10 +64,14 @@ public final class ContentLoader {
             "jcr:checkedOut",
             "jcr:isCheckedOut",
             "rep:policy");
+    
+    private static ContentFileParser JSON_PARSER = ContentFileParserFactory.create(ContentFileExtension.JSON, new ParserOptions()
+            .detectCalendarValues(true)
+            .ignorePropertyNames(IGNORED_NAMES)
+            .ignoreResourceNames(IGNORED_NAMES));
 
     private final ResourceResolver resourceResolver;
     private final BundleContext bundleContext;
-    private final DateFormat calendarFormat;
     private final boolean autoCommit;
 
     /**
@@ -102,7 +97,6 @@ public final class ContentLoader {
     public ContentLoader(ResourceResolver resourceResolver, BundleContext bundleContext, boolean autoCommit) {
         this.resourceResolver = resourceResolver;
         this.bundleContext = bundleContext;
-        this.calendarFormat = new SimpleDateFormat(JsonItemWriter.ECMA_DATE_FORMAT, JsonItemWriter.DATE_FORMAT_LOCALE);
         this.autoCommit = autoCommit;
     }
 
@@ -183,14 +177,13 @@ public final class ContentLoader {
                 throw new IllegalArgumentException("Resource does already exist: " + destPath);
             }
 
-            String jsonString = convertToJsonString(inputStream).trim();
-            JSONObject json = new JSONObject(jsonString);
-            Resource resource = this.createResource(parentResource, childName, json);
+            Map<String,Object> content = JSON_PARSER.parse(inputStream);
+            Resource resource = this.createResource(parentResource, childName, content);
             if (autoCommit) {
                 resourceResolver.commit();
             }
             return resource;
-        } catch (JSONException ex) {
+        } catch (ParseException ex) {
             throw new RuntimeException(ex);
         } catch (IOException ex) {
             throw new RuntimeException(ex);
@@ -215,37 +208,22 @@ public final class ContentLoader {
         }
     }
 
-    private Resource createResource(Resource parentResource, String childName, JSONObject jsonObject)
-            throws IOException, JSONException {
-
+    @SuppressWarnings("unchecked")
+    private Resource createResource(Resource parentResource, String childName, Map<String,Object> content) throws IOException {
+        
         // collect all properties first
         boolean hasJcrData = false;
         Map<String, Object> props = new HashMap<String, Object>();
-        JSONArray names = jsonObject.names();
-        for (int i = 0; names != null && i < names.length(); i++) {
-            final String name = names.getString(i);
+        for (Map.Entry<String,Object> entry : content.entrySet()) {
+            final String name = entry.getKey();
             if (StringUtils.equals(name, JCR_DATA_PLACEHOLDER)) {
                 hasJcrData = true;
             }
-            else if (!IGNORED_NAMES.contains(name)) {
-                Object obj = jsonObject.get(name);
-                if (!(obj instanceof JSONObject)) {
-                    this.setProperty(props, name, obj);
-                }
+            else if (!(entry.getValue() instanceof Map)) {
+                props.put(name, entry.getValue());
             }
         }
-
-        // validate JCR primary type
-        Object primaryTypeObj = jsonObject.opt(JcrConstants.JCR_PRIMARYTYPE);
-        String primaryType = null;
-        if (primaryTypeObj != null) {
-            primaryType = String.valueOf(primaryTypeObj);
-        }
-        if (primaryType == null) {
-            primaryType = JcrConstants.NT_UNSTRUCTURED;
-        }
-        props.put(JcrConstants.JCR_PRIMARYTYPE, primaryType);
-
+        
         // create resource
         Resource resource = resourceResolver.create(parentResource, childName, props);
         
@@ -256,121 +234,15 @@ public final class ContentLoader {
         }
 
         // add child resources
-        for (int i = 0; names != null && i < names.length(); i++) {
-            final String name = names.getString(i);
-            if (!IGNORED_NAMES.contains(name)) {
-                Object obj = jsonObject.get(name);
-                if (obj instanceof JSONObject) {
-                    createResource(resource, name, (JSONObject) obj);
-                }
+        for (Map.Entry<String,Object> entry : content.entrySet()) {
+            if (entry.getValue() instanceof Map) {
+                createResource(resource, entry.getKey(), (Map<String,Object>)entry.getValue());
             }
         }
 
         return resource;
     }
 
-    private void setProperty(Map<String, Object> props, String name, Object value) throws JSONException {
-        if (value instanceof JSONArray) {
-            // multivalue
-            final JSONArray array = (JSONArray) value;
-            if (array.length() > 0) {
-                final Object[] values = new Object[array.length()];
-                for (int i = 0; i < array.length(); i++) {
-                    values[i] = array.get(i);
-                }
-
-                if (values[0] instanceof Double || values[0] instanceof Float) {
-                    Double[] arrayValues = new Double[values.length];
-                    for (int i = 0; i < values.length; i++) {
-                        arrayValues[i] = (Double) values[i];
-                    }
-                    props.put(cleanupJsonName(name), arrayValues);
-                } else if (values[0] instanceof Number) {
-                    Long[] arrayValues = new Long[values.length];
-                    for (int i = 0; i < values.length; i++) {
-                        arrayValues[i] = ((Number) values[i]).longValue();
-                    }
-                    props.put(cleanupJsonName(name), arrayValues);
-                } else if (values[0] instanceof Boolean) {
-                    Boolean[] arrayValues = new Boolean[values.length];
-                    for (int i = 0; i < values.length; i++) {
-                        arrayValues[i] = (Boolean) values[i];
-                    }
-                    props.put(cleanupJsonName(name), arrayValues);
-                } else {
-                    String[] arrayValues = new String[values.length];
-                    for (int i = 0; i < values.length; i++) {
-                        arrayValues[i] = values[i].toString();
-                    }
-                    props.put(cleanupJsonName(name), arrayValues);
-                }
-            } else {
-                props.put(cleanupJsonName(name), new String[0]);
-            }
-
-        } else {
-            // single value
-            if (value instanceof Double || value instanceof Float) {
-                props.put(cleanupJsonName(name), value);
-            } else if (value instanceof Number) {
-                props.put(cleanupJsonName(name), ((Number) value).longValue());
-            } else if (value instanceof Boolean) {
-                props.put(cleanupJsonName(name), value);
-            } else {
-                String stringValue = value.toString();
-
-                // check if value is a Calendar object
-                Calendar calendar = tryParseCalendarValue(stringValue);
-                if (calendar != null) {
-                    props.put(cleanupJsonName(name), calendar);
-                } else {
-                    props.put(cleanupJsonName(name), stringValue);
-                }
-
-            }
-        }
-    }
-
-    private String cleanupJsonName(String name) {
-        if (name.startsWith(REFERENCE)) {
-            return name.substring(REFERENCE.length());
-        }
-        if (name.startsWith(PATH)) {
-            return name.substring(PATH.length());
-        }
-        return name;
-    }
-
-    private String convertToJsonString(InputStream inputStream) {
-        try {
-            return IOUtils.toString(inputStream, CharEncoding.UTF_8);
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        } finally {
-            try {
-                inputStream.close();
-            } catch (IOException ex) {
-                // ignore
-            }
-        }
-    }
-
-    private Calendar tryParseCalendarValue(String value) {
-        if (StringUtils.isNotBlank(value)) {
-            synchronized (calendarFormat) {
-                try {
-                    Date date = calendarFormat.parse(value);
-                    Calendar calendar = Calendar.getInstance();
-                    calendar.setTime(date);
-                    return calendar;
-                } catch (ParseException ex) {
-                    // ignore
-                }
-            }
-        }
-        return null;
-    }
-
     /**
      * Import binary file as nt:file binary node into repository. Auto-creates
      * parent hierarchies as nt:unstrucured nodes if missing. Mime type is

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 26/48: SLING-6595 switch to latest contentparser API

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 7e3d73c20b70274d268d9925a154f52534e9dd27
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Mar 17 22:24:27 2017 +0000

    SLING-6595 switch to latest contentparser API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1787513 13f79535-47bb-0310-9956-ffa450edef68
---
 .../testing/mock/sling/loader/ContentLoader.java   | 44 +---------
 .../mock/sling/loader/LoaderContentHandler.java    | 94 ++++++++++++++++++++++
 2 files changed, 97 insertions(+), 41 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
index 73120f9..b205812 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.loader;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
@@ -27,7 +26,6 @@ import java.util.Set;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jackrabbit.JcrConstants;
-import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -51,7 +49,6 @@ import com.google.common.collect.ImmutableSet;
 public final class ContentLoader {
 
     private static final String CONTENTTYPE_OCTET_STREAM = "application/octet-stream";
-    private static final String JCR_DATA_PLACEHOLDER = ":jcr:data";
 
     private static final Set<String> IGNORED_NAMES = ImmutableSet.of(
             JcrConstants.JCR_MIXINTYPES,
@@ -177,12 +174,12 @@ public final class ContentLoader {
                 throw new IllegalArgumentException("Resource does already exist: " + destPath);
             }
 
-            Map<String,Object> content = JSON_PARSER.parse(inputStream);
-            Resource resource = this.createResource(parentResource, childName, content);
+            LoaderContentHandler contentHandler = new LoaderContentHandler(destPath, resourceResolver);
+            JSON_PARSER.parse(contentHandler, inputStream);
             if (autoCommit) {
                 resourceResolver.commit();
             }
-            return resource;
+            return resourceResolver.getResource(destPath);
         } catch (ParseException ex) {
             throw new RuntimeException(ex);
         } catch (IOException ex) {
@@ -208,41 +205,6 @@ public final class ContentLoader {
         }
     }
 
-    @SuppressWarnings("unchecked")
-    private Resource createResource(Resource parentResource, String childName, Map<String,Object> content) throws IOException {
-        
-        // collect all properties first
-        boolean hasJcrData = false;
-        Map<String, Object> props = new HashMap<String, Object>();
-        for (Map.Entry<String,Object> entry : content.entrySet()) {
-            final String name = entry.getKey();
-            if (StringUtils.equals(name, JCR_DATA_PLACEHOLDER)) {
-                hasJcrData = true;
-            }
-            else if (!(entry.getValue() instanceof Map)) {
-                props.put(name, entry.getValue());
-            }
-        }
-        
-        // create resource
-        Resource resource = resourceResolver.create(parentResource, childName, props);
-        
-        if (hasJcrData) {
-            ModifiableValueMap valueMap = resource.adaptTo(ModifiableValueMap.class);
-            // we cannot import binary data here - but to avoid complaints by JCR we create it with empty binary data
-            valueMap.put(JcrConstants.JCR_DATA, new ByteArrayInputStream(new byte[0]));
-        }
-
-        // add child resources
-        for (Map.Entry<String,Object> entry : content.entrySet()) {
-            if (entry.getValue() instanceof Map) {
-                createResource(resource, entry.getKey(), (Map<String,Object>)entry.getValue());
-            }
-        }
-
-        return resource;
-    }
-
     /**
      * Import binary file as nt:file binary node into repository. Auto-creates
      * parent hierarchies as nt:unstrucured nodes if missing. Mime type is
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/LoaderContentHandler.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/LoaderContentHandler.java
new file mode 100644
index 0000000..9077cd4
--- /dev/null
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/LoaderContentHandler.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.sling.loader;
+
+import java.io.ByteArrayInputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.sling.api.resource.ModifiableValueMap;
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.jcr.contentparser.ContentHandler;
+
+final class LoaderContentHandler implements ContentHandler {
+
+    private static final String JCR_DATA_PLACEHOLDER = ":jcr:data";
+    
+    private final String rootPath;
+    private final ResourceResolver resourceResolver;
+    
+    public LoaderContentHandler(String rootPath, ResourceResolver resourceResolver) {
+        this.rootPath = rootPath;
+        this.resourceResolver = resourceResolver;
+    }
+
+    @Override
+    public void resource(String path, Map<String, Object> properties) {
+        String fullPath = rootPath;
+        if (!StringUtils.equals(path, "/")) {
+            fullPath += path;
+        }
+        String parentPath = ResourceUtil.getParent(fullPath);
+        String name = ResourceUtil.getName(fullPath);
+        
+        Resource parentResource = resourceResolver.getResource(parentPath);
+        if (parentResource == null) {
+            throw new RuntimeException("Parent resource '" + parentPath + "' not found.");
+        }
+        try {
+            createResource(parentResource, name, properties);
+        } 
+        catch (PersistenceException ex) {
+            throw new RuntimeException("Unable to create resource at '" + fullPath + "'.", ex);
+        }
+    }
+
+    private Resource createResource(Resource parentResource, String childName, Map<String,Object> content) throws PersistenceException {
+        
+        // collect all properties first
+        boolean hasJcrData = false;
+        Map<String, Object> props = new HashMap<String, Object>();
+        for (Map.Entry<String,Object> entry : content.entrySet()) {
+            final String name = entry.getKey();
+            if (StringUtils.equals(name, JCR_DATA_PLACEHOLDER)) {
+                hasJcrData = true;
+            }
+            else {
+                props.put(name, entry.getValue());
+            }
+        }
+        
+        // create resource
+        Resource resource = resourceResolver.create(parentResource, childName, props);
+        
+        if (hasJcrData) {
+            ModifiableValueMap valueMap = resource.adaptTo(ModifiableValueMap.class);
+            // we cannot import binary data here - but to avoid complaints by JCR we create it with empty binary data
+            valueMap.put(JcrConstants.JCR_DATA, new ByteArrayInputStream(new byte[0]));
+        }
+
+        return resource;
+    }
+
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 31/48: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 91d5a3903f0bc08f4d765dbc9ee5747cf961275e
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 27 15:21:19 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1788947 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 598e24b..264b1e0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.6</version>
+    <version>2.2.7-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 06/48: SLING-6387 Allow to control autocommit mode for ContentLoader (patch provided by Dirk Rudolph, with modifications)

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit a67e18978c75ae7622c115377ca807c377785cbe
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sun Dec 11 13:09:05 2016 +0000

    SLING-6387 Allow to control autocommit mode for ContentLoader (patch provided by Dirk Rudolph, with modifications)
    
    Closes #189
    Closes #190
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773569 13f79535-47bb-0310-9956-ffa450edef68
---
 .../mock/sling/context/SlingContextImpl.java       |  24 +-
 .../testing/mock/sling/context/package-info.java   |   2 +-
 .../testing/mock/sling/junit/package-info.java     |   2 +-
 .../testing/mock/sling/loader/ContentLoader.java   |  25 ++-
 .../testing/mock/sling/loader/package-info.java    |   2 +-
 .../loader/ContentLoaderAutoCommitTest.java}       |  16 +-
 .../AbstractContentLoaderAutoCommitTest.java       | 242 +++++++++++++++++++++
 .../loader/ContentLoaderAutoCommitTest.java}       |  17 +-
 8 files changed, 310 insertions(+), 20 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 161cf94..97cd8e9 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -94,6 +94,7 @@ public class SlingContextImpl extends OsgiContextImpl {
     protected MockSlingHttpServletResponse response;
     protected SlingScriptHelper slingScriptHelper;
     protected ContentLoader contentLoader;
+    protected ContentLoader contentLoaderAutoCommit;
     protected ContentBuilder contentBuilder;
     protected ResourceBuilder resourceBuilder;
     protected UniqueRoot uniqueRoot;
@@ -215,6 +216,7 @@ public class SlingContextImpl extends OsgiContextImpl {
         this.response = null;
         this.slingScriptHelper = null;
         this.contentLoader = null;
+        this.contentLoaderAutoCommit = null;
         this.contentBuilder = null;
         this.resourceBuilder = null;
         this.uniqueRoot = null;
@@ -294,10 +296,26 @@ public class SlingContextImpl extends OsgiContextImpl {
      * @return Content loader
      */
     public ContentLoader load() {
-        if (this.contentLoader == null) {
-            this.contentLoader = new ContentLoader(resourceResolver(), bundleContext());
+        return load(true);
+    }
+
+    /**
+     * @param autoCommit Automatically commit changes after loading content (default: true)
+     * @return Content loader
+     */
+    public ContentLoader load(boolean autoCommit) {
+        if (autoCommit) {
+            if (this.contentLoaderAutoCommit == null) {
+                this.contentLoaderAutoCommit = new ContentLoader(resourceResolver(), bundleContext(), true);
+            }
+            return this.contentLoaderAutoCommit;
+        }
+        else {
+            if (this.contentLoader == null) {
+                this.contentLoader = new ContentLoader(resourceResolver(), bundleContext(), false);
+            }
+            return this.contentLoader;
         }
-        return this.contentLoader;
     }
 
     /**
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/context/package-info.java
index cae884c..36a2859 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Sling context implementation for unit tests.
  */
-@org.osgi.annotation.versioning.Version("3.4")
+@org.osgi.annotation.versioning.Version("3.5")
 package org.apache.sling.testing.mock.sling.context;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/junit/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/junit/package-info.java
index 3225203..a998c8f 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/junit/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/junit/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Rule for providing easy access to Sling context in JUnit tests.
  */
-@org.osgi.annotation.versioning.Version("4.0")
+@org.osgi.annotation.versioning.Version("4.1")
 package org.apache.sling.testing.mock.sling.junit;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
index efbc82e..87df4b6 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
@@ -52,7 +52,7 @@ import com.google.common.collect.ImmutableSet;
 
 /**
  * Imports JSON data and binary data into Sling resource hierarchy.
- * After all import operations from json or binaries {@link ResourceResolver#commit()} is called.
+ * After all import operations from json or binaries {@link ResourceResolver#commit()} is called (when autocommit mode is active).
  */
 public final class ContentLoader {
 
@@ -77,6 +77,7 @@ public final class ContentLoader {
     private final ResourceResolver resourceResolver;
     private final BundleContext bundleContext;
     private final DateFormat calendarFormat;
+    private final boolean autoCommit;
 
     /**
      * @param resourceResolver Resource resolver
@@ -90,9 +91,19 @@ public final class ContentLoader {
      * @param bundleContext Bundle context
      */
     public ContentLoader(ResourceResolver resourceResolver, BundleContext bundleContext) {
+        this (resourceResolver, bundleContext, true);
+    }
+
+    /**
+     * @param resourceResolver Resource resolver
+     * @param bundleContext Bundle context
+     * @param autoCommit Automatically commit changes after loading content (default: true)
+     */
+    public ContentLoader(ResourceResolver resourceResolver, BundleContext bundleContext, boolean autoCommit) {
         this.resourceResolver = resourceResolver;
         this.bundleContext = bundleContext;
         this.calendarFormat = new SimpleDateFormat(JsonItemWriter.ECMA_DATE_FORMAT, JsonItemWriter.DATE_FORMAT_LOCALE);
+        this.autoCommit = autoCommit;
     }
 
     /**
@@ -175,7 +186,9 @@ public final class ContentLoader {
             String jsonString = convertToJsonString(inputStream).trim();
             JSONObject json = new JSONObject(jsonString);
             Resource resource = this.createResource(parentResource, childName, json);
-            resourceResolver.commit();
+            if (autoCommit) {
+                resourceResolver.commit();
+            }
             return resource;
         } catch (JSONException ex) {
             throw new RuntimeException(ex);
@@ -470,7 +483,9 @@ public final class ContentLoader {
             resourceResolver.create(file, JcrConstants.JCR_CONTENT,
                     ImmutableMap.<String, Object> builder().put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_RESOURCE)
                             .put(JcrConstants.JCR_DATA, inputStream).put(JcrConstants.JCR_MIMETYPE, mimeType).build());
-            resourceResolver.commit();
+            if (autoCommit) {
+                resourceResolver.commit();
+            }
             return file;
         } catch (PersistenceException ex) {
             throw new RuntimeException("Unable to create resource at " + parentResource.getPath() + "/" + name, ex);
@@ -586,7 +601,9 @@ public final class ContentLoader {
             Resource resource = resourceResolver.create(parentResource, name,
                     ImmutableMap.<String, Object> builder().put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_RESOURCE)
                             .put(JcrConstants.JCR_DATA, inputStream).put(JcrConstants.JCR_MIMETYPE, mimeType).build());
-            resourceResolver.commit();
+            if (autoCommit) {
+                resourceResolver.commit();
+            }
             return resource;
         } catch (PersistenceException ex) {
             throw new RuntimeException("Unable to create resource at " + parentResource.getPath() + "/" + name, ex);
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
index 60ea1bb..92b8da5 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Helpers for importing test content into the mocked repositories / resource hierarchies.
  */
-@org.osgi.annotation.versioning.Version("1.0")
+@org.osgi.annotation.versioning.Version("1.1")
 package org.apache.sling.testing.mock.sling.loader;
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java b/src/test/java/org/apache/sling/testing/mock/sling/jcrmock/loader/ContentLoaderAutoCommitTest.java
similarity index 65%
copy from src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
copy to src/test/java/org/apache/sling/testing/mock/sling/jcrmock/loader/ContentLoaderAutoCommitTest.java
index 60ea1bb..bd76ee5 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/jcrmock/loader/ContentLoaderAutoCommitTest.java
@@ -16,8 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-/**
- * Helpers for importing test content into the mocked repositories / resource hierarchies.
- */
-@org.osgi.annotation.versioning.Version("1.0")
-package org.apache.sling.testing.mock.sling.loader;
+package org.apache.sling.testing.mock.sling.jcrmock.loader;
+
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderAutoCommitTest;
+
+public class ContentLoaderAutoCommitTest extends AbstractContentLoaderAutoCommitTest {
+
+    @Override protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.JCR_MOCK;
+    }
+}
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/loader/AbstractContentLoaderAutoCommitTest.java b/src/test/java/org/apache/sling/testing/mock/sling/loader/AbstractContentLoaderAutoCommitTest.java
new file mode 100644
index 0000000..b0df5fd
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/loader/AbstractContentLoaderAutoCommitTest.java
@@ -0,0 +1,242 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.sling.loader;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.junit.Rule;
+import org.junit.Test;
+
+public abstract class AbstractContentLoaderAutoCommitTest {
+
+    private static String DEST_RES_NAME = "dest";
+    private static String MIME_TYPE_JSON = "application/json";
+    private static String CLP_CONTENT = "/json-import-samples/content.json";
+    private static byte[] MEM_CONTENT = ("{"
+            + "\"jcr:primaryType\":\"sling:Folder\""
+            + "}").getBytes();
+
+    private int destResCount = 1;
+
+    @Rule
+    public SlingContext context = new SlingContext(getResourceResolverType());
+
+    protected abstract ResourceResolverType getResourceResolverType();
+
+    @Test
+    public void testJsonAutocommitExplicitly() {
+        doTestJsonAutocommitExplicitly(false, new HasChangesAssertion());
+        doTestJsonAutocommitExplicitly(true, new NoChangesAssertion());
+    }
+
+    private void doTestJsonAutocommitExplicitly(final boolean commit, final Runnable assertion) {
+        final ContentLoader loader = context.load(commit);
+
+        final Resource a1 = context.create().resource(nextDestResource());
+        loader.json(CLP_CONTENT, a1, "child");
+        assertion.run();
+
+        loader.json(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource a3 = context.create().resource(nextDestResource());
+        loader.json(data, a3, "child");
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.json(data2, nextDestResource());
+        assertion.run();
+    }
+
+    @Test
+    public void testJsonAutocommitImplicitly() {
+        final ContentLoader loader = context.load();
+        final Runnable assertion = new NoChangesAssertion();
+
+        final Resource r = context.create().resource(nextDestResource());
+        loader.json(CLP_CONTENT, r, "child");
+        assertion.run();
+
+        loader.json(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r2 = context.create().resource(nextDestResource());
+        loader.json(data, r2, "child");
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.json(data2, nextDestResource());
+        assertion.run();
+    }
+
+    @Test
+    public void testBinaryFileAutocommitExplicitly() {
+        doTestBinaryFileAutocommitExplicitly(false, new HasChangesAssertion());
+        doTestBinaryFileAutocommitExplicitly(true, new NoChangesAssertion());
+    }
+
+    private void doTestBinaryFileAutocommitExplicitly(final boolean commit, final Runnable assertion) {
+        final ContentLoader loader = context.load(commit);
+
+        loader.binaryFile(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        loader.binaryFile(CLP_CONTENT, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryFile(data, nextDestResource());
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryFile(data2, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data3 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r = context.create().resource(nextDestResource());
+        loader.binaryFile(data3, r, "child");
+        assertion.run();
+
+        final InputStream data4 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r2 = context.create().resource(nextDestResource());
+        loader.binaryFile(data4, r2, "child", MIME_TYPE_JSON);
+        assertion.run();
+    }
+
+    @Test
+    public void testBinaryFileAutocommitImplicitly() {
+        final ContentLoader loader = context.load();
+        final Runnable assertion = new NoChangesAssertion();
+
+        loader.binaryFile(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        loader.binaryFile(CLP_CONTENT, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryFile(data, nextDestResource());
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryFile(data2, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data3 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r = context.create().resource(nextDestResource());
+        loader.binaryFile(data3, r, "child");
+        assertion.run();
+
+        final InputStream data4 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r2 = context.create().resource(nextDestResource());
+        loader.binaryFile(data4, r2, "child", MIME_TYPE_JSON);
+        assertion.run();
+    }
+
+    @Test
+    public void testBinaryResourceAutocommitExplicitly() {
+        doTestBinaryResourceAutocommitExplicitly(false, new HasChangesAssertion());
+        doTestBinaryResourceAutocommitExplicitly(true, new NoChangesAssertion());
+    }
+
+    private void doTestBinaryResourceAutocommitExplicitly(final boolean commit, final Runnable assertion) {
+        final ContentLoader loader = context.load(commit);
+
+        loader.binaryResource(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        loader.binaryResource(CLP_CONTENT, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryResource(data, nextDestResource());
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryResource(data2, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data3 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r = context.create().resource(nextDestResource());
+        loader.binaryResource(data3, r, "child");
+        assertion.run();
+
+        final InputStream data4 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r2 = context.create().resource(nextDestResource());
+        loader.binaryResource(data4, r2, "child", MIME_TYPE_JSON);
+        assertion.run();
+    }
+
+    @Test
+    public void testBinaryResourceAutocommitImplicitly() {
+        final ContentLoader loader = context.load();
+        final Runnable assertion = new NoChangesAssertion();
+
+        loader.binaryResource(CLP_CONTENT, nextDestResource());
+        assertion.run();
+
+        loader.binaryResource(CLP_CONTENT, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryResource(data, nextDestResource());
+        assertion.run();
+
+        final InputStream data2 = new ByteArrayInputStream(MEM_CONTENT);
+        loader.binaryResource(data2, nextDestResource(), MIME_TYPE_JSON);
+        assertion.run();
+
+        final InputStream data3 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r = context.create().resource(nextDestResource());
+        loader.binaryResource(data3, r, "child");
+        assertion.run();
+
+        final InputStream data4 = new ByteArrayInputStream(MEM_CONTENT);
+        final Resource r2 = context.create().resource(nextDestResource());
+        loader.binaryResource(data4, r2, "child", MIME_TYPE_JSON);
+        assertion.run();
+    }
+
+    private synchronized String nextDestResource() {
+        return '/' + DEST_RES_NAME + destResCount++;
+    }
+
+    private class HasChangesAssertion implements Runnable {
+        @Override
+        public void run() {
+            assertTrue(context.resourceResolver().hasChanges());
+        }
+    }
+
+    private class NoChangesAssertion implements Runnable {
+        @Override
+        public void run() {
+            assertFalse(context.resourceResolver().hasChanges());
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java b/src/test/java/org/apache/sling/testing/mock/sling/rrmock/loader/ContentLoaderAutoCommitTest.java
similarity index 64%
copy from src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
copy to src/test/java/org/apache/sling/testing/mock/sling/rrmock/loader/ContentLoaderAutoCommitTest.java
index 60ea1bb..21a48d6 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/package-info.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/rrmock/loader/ContentLoaderAutoCommitTest.java
@@ -16,8 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-/**
- * Helpers for importing test content into the mocked repositories / resource hierarchies.
- */
-@org.osgi.annotation.versioning.Version("1.0")
-package org.apache.sling.testing.mock.sling.loader;
+package org.apache.sling.testing.mock.sling.rrmock.loader;
+
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.loader.AbstractContentLoaderAutoCommitTest;
+
+public class ContentLoaderAutoCommitTest extends AbstractContentLoaderAutoCommitTest {
+
+    @Override
+    protected ResourceResolverType getResourceResolverType() {
+        return ResourceResolverType.RESOURCERESOLVER_MOCK;
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 07/48: update to release version

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 23535c2068a91682a34a324cd7609e9a7866075f
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 13 12:18:43 2016 +0000

    update to release version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773980 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7bb0d4a..6bc92ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,13 +45,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.0</version>
+            <version>2.2.2</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.1.17-SNAPSHOT</version>
+            <version>1.2.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 13/48: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9339002558f477562e33c36bf07a6ff8b0201c3d
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 08:49:03 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1775012 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 073267e..80cc564 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.3-SNAPSHOT</version>
+    <version>2.2.4</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 21/48: SLING-6595 update to latest API

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9fb839dc6cb5e520c932c5795c8b059974c1f1a7
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu Mar 2 21:57:25 2017 +0000

    SLING-6595 update to latest API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1785201 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                               | 2 +-
 .../org/apache/sling/testing/mock/sling/loader/ContentLoader.java     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 25c32c1..1bed73e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,7 +131,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.fscontentparser</artifactId>
+            <artifactId>org.apache.sling.commons.fscontentparser</artifactId>
             <version>1.0.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
index 7ab801e..68740ce 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java
@@ -33,9 +33,9 @@ import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.commons.mime.MimeTypeService;
-import org.apache.sling.fscontentparser.ContentFileExtension;
 import org.apache.sling.fscontentparser.ContentFileParser;
 import org.apache.sling.fscontentparser.ContentFileParserFactory;
+import org.apache.sling.fscontentparser.ContentFileType;
 import org.apache.sling.fscontentparser.ParseException;
 import org.apache.sling.fscontentparser.ParserOptions;
 import org.osgi.framework.BundleContext;
@@ -65,7 +65,7 @@ public final class ContentLoader {
             "jcr:isCheckedOut",
             "rep:policy");
     
-    private static ContentFileParser JSON_PARSER = ContentFileParserFactory.create(ContentFileExtension.JSON, new ParserOptions()
+    private static ContentFileParser JSON_PARSER = ContentFileParserFactory.create(ContentFileType.JSON, new ParserOptions()
             .detectCalendarValues(true)
             .ignorePropertyNames(IGNORED_NAMES)
             .ignoreResourceNames(IGNORED_NAMES));

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 43/48: switch to release versions

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9abcefe46989dfe90c203623af52a4d0f38532f9
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon May 8 08:36:00 2017 +0000

    switch to release versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794295 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e91a776..07f9a9b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -132,7 +132,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.contentparser</artifactId>
-            <version>1.0.0</version>
+            <version>1.1.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 44/48: SLING-6841 Sling Mocks should inject ResourceResolverFactory by default

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit c6c2ff24ca5da790bab4c046196277a49ef27f57
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon May 8 14:47:50 2017 +0000

    SLING-6841 Sling Mocks should inject ResourceResolverFactory by default
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794387 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/testing/mock/sling/context/SlingContextImpl.java       | 6 ++++++
 .../testing/mock/sling/context/AbstractSlingContextImplTest.java | 9 +++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 0b47560..4eb5607 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -118,6 +118,12 @@ public class SlingContextImpl extends OsgiContextImpl {
             MockOsgi.setConfigForPid(bundleContext(), RESOURCERESOLVERFACTORYACTIVATOR_PID, this.resourceResolverFactoryActivatorProps);
         }
         
+        // automatically register resource resolver factory when ResourceResolverType != NONE,
+        // so the ResourceResolverFactory is available as OSGi service immediately
+        if (resourceResolverType != ResourceResolverType.NONE) {
+            resourceResolverFactory();
+        }
+        
         registerDefaultServices();
     }
     
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/context/AbstractSlingContextImplTest.java b/src/test/java/org/apache/sling/testing/mock/sling/context/AbstractSlingContextImplTest.java
index 6299dfb..4c2d13b 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/context/AbstractSlingContextImplTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/context/AbstractSlingContextImplTest.java
@@ -48,6 +48,9 @@ public abstract class AbstractSlingContextImplTest {
 
     @Before
     public void setUp() throws Exception {
+        // make sure ResourceResolverFactory is available immediately and not lazily
+        assertEquals(1, context.getServices(ResourceResolverFactory.class, null).length);
+
         context.addModelsForPackage("org.apache.sling.testing.mock.sling.context.models");
         
         ContentLoader contentLoader = this.context.load();
@@ -138,10 +141,4 @@ public abstract class AbstractSlingContextImplTest {
         assertTrue(newRunModes.contains("mode2"));
     }
     
-    @Test
-    public void testResourceResolverFactory() {
-        ResourceResolverFactory[] factories = context.getServices(ResourceResolverFactory.class, null);
-        assertEquals(1, factories.length);
-    }
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 35/48: SLING-6813 sling-mock: Make compatible with org.apache.sling.jcr.resource 3.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 960d1056090fd479feeda324fe07e5a8af23a9c3
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Apr 29 07:46:04 2017 +0000

    SLING-6813 sling-mock: Make compatible with org.apache.sling.jcr.resource 3.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793173 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                       |  2 +-
 .../mock/sling/ResourceResolverFactoryInitializer.java        | 11 +++++++++--
 .../apache/sling/testing/mock/sling/context/UniqueRoot.java   |  8 +++-----
 .../testing/mock/sling/resource/AbstractJcrNamespaceTest.java |  5 ++---
 .../mock/sling/resource/AbstractJcrResourceResolverTest.java  |  6 ++----
 5 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 39cb36f..ab30579 100644
--- a/pom.xml
+++ b/pom.xml
@@ -280,7 +280,7 @@
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.jcr.resource</artifactId>
-                    <version>2.9.2</version>
+                    <version>3.0.1-SNAPSHOT</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
index 0b42c49..5b64c58 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
@@ -28,7 +28,6 @@ import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider;
-import org.apache.sling.jcr.resource.internal.helper.jcr.PathMapper;
 import org.apache.sling.resourceresolver.impl.ResourceAccessSecurityTracker;
 import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
 import org.apache.sling.serviceusermapping.ServiceUserMapper;
@@ -84,11 +83,19 @@ class ResourceResolverFactoryInitializer {
      * Ensure dependencies for JcrResourceProvider are present.
      * @param bundleContext Bundle context
      */
+    @SuppressWarnings("unchecked")
     private static void ensureJcrResourceProviderDependencies(BundleContext bundleContext) {
         if (bundleContext.getServiceReference(DynamicClassLoaderManager.class) == null) {
             bundleContext.registerService(DynamicClassLoaderManager.class, new MockDynamicClassLoaderManager(), null);
         }
-        registerServiceIfNotPresent(bundleContext, PathMapper.class, new PathMapper());
+        
+        try {
+            Class pathMapperClass = Class.forName("org.apache.sling.jcr.resource.internal.helper.jcr.PathMapper");
+            registerServiceIfNotPresent(bundleContext, pathMapperClass, pathMapperClass.newInstance());
+        }
+        catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
+            // ignore - service was removed in org.apache.sling.jcr.resource 3.0.0
+        }
     }
  
     /**
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/UniqueRoot.java b/src/main/java/org/apache/sling/testing/mock/sling/context/UniqueRoot.java
index 7e897ef..f5f68d3 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/UniqueRoot.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/UniqueRoot.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.context;
 
-import static org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_ORDERED_FOLDER;
-
 import java.util.UUID;
 
 import org.apache.jackrabbit.JcrConstants;
@@ -81,7 +79,7 @@ public class UniqueRoot {
      */
     public final String content() {
         if (contentRoot == null) {
-            contentRoot = getOrCreateResource("/content/" + uniquePathPart, NT_SLING_ORDERED_FOLDER);
+            contentRoot = getOrCreateResource("/content/" + uniquePathPart, "sling:OrderedFolder");
         }
         return contentRoot.getPath();
     }
@@ -93,7 +91,7 @@ public class UniqueRoot {
      */
     public final String apps() {
         if (appsRoot == null) {
-            appsRoot = getOrCreateResource("/apps/" + uniquePathPart, NT_SLING_ORDERED_FOLDER);
+            appsRoot = getOrCreateResource("/apps/" + uniquePathPart, "sling:OrderedFolder");
         }
         return appsRoot.getPath();
     }
@@ -105,7 +103,7 @@ public class UniqueRoot {
      */
     public final String libs() {
         if (libsRoot == null) {
-            libsRoot = getOrCreateResource("/libs/" + uniquePathPart, NT_SLING_ORDERED_FOLDER);
+            libsRoot = getOrCreateResource("/libs/" + uniquePathPart, "sling:OrderedFolder");
         }
         return libsRoot.getPath();
     }
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrNamespaceTest.java b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrNamespaceTest.java
index 427e338..3fedcca 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrNamespaceTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrNamespaceTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.resource;
 
-import static org.apache.sling.jcr.resource.JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY;
 import static org.junit.Assert.assertEquals;
 
 import javax.jcr.RepositoryException;
@@ -57,7 +56,7 @@ public abstract class AbstractJcrNamespaceTest {
         Resource resource = resolver.getResource(context.uniqueRoot().content() + "/foo");
         
         ValueMap props = ResourceUtil.getValueMap(resource);
-        assertEquals("fooType", props.get(SLING_RESOURCE_TYPE_PROPERTY));
+        assertEquals("fooType", props.get("sling:resourceType"));
         assertEquals("fooType", resource.getResourceType());
         
         MockOsgi.shutdown(bundleContext);
@@ -73,7 +72,7 @@ public abstract class AbstractJcrNamespaceTest {
         Resource resource = resolver.getResource(context.uniqueRoot().content() + "/foo");
         
         ValueMap props = ResourceUtil.getValueMap(resource);
-        assertEquals("fooType", props.get(SLING_RESOURCE_TYPE_PROPERTY));
+        assertEquals("fooType", props.get("sling:resourceType"));
         assertEquals("fooType", resource.getResourceType());
     }
 
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrResourceResolverTest.java b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrResourceResolverTest.java
index 2726da9..8b6251a 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractJcrResourceResolverTest.java
@@ -18,8 +18,6 @@
  */
 package org.apache.sling.testing.mock.sling.resource;
 
-import static org.apache.sling.jcr.resource.JcrResourceConstants.NT_SLING_ORDERED_FOLDER;
-import static org.apache.sling.jcr.resource.JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -153,7 +151,7 @@ public abstract class AbstractJcrResourceResolverTest {
         Resource parent = context.resourceResolver().getResource(getTestRootNode().getPath());
 
         Resource child = context.resourceResolver().create(parent, "nodeTypeResource", ImmutableMap.<String, Object> builder()
-                .put(SLING_RESOURCE_TYPE_PROPERTY, JcrConstants.NT_UNSTRUCTURED).build());
+                .put("sling:resourceType", JcrConstants.NT_UNSTRUCTURED).build());
         assertNotNull(child);
         assertEquals(JcrConstants.NT_UNSTRUCTURED, child.getResourceType());
         assertEquals(JcrConstants.NT_UNSTRUCTURED, child.adaptTo(Node.class).getPrimaryNodeType().getName());
@@ -166,7 +164,7 @@ public abstract class AbstractJcrResourceResolverTest {
         Resource child = ResourceUtil.getOrCreateResource(context.resourceResolver(), parent.getPath() + "/intermediate/child",
                 "sling/resource/type", JcrConstants.NT_UNSTRUCTURED, true);
         assertNotNull(child);
-        assertEquals(NT_SLING_ORDERED_FOLDER, parent.getResourceType());
+        assertEquals("sling:OrderedFolder", parent.getResourceType());
         assertEquals("sling/resource/type", child.getResourceType());
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 23/48: fix compile errors after switchting to parent 30: - add scr annotation dependency where appropiate or remove maven-scr-plugin - switch to osgi versioning annotations

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 1f0ff4c4c8c8d8478561fa42d160c44528ff2a64
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 6 15:50:05 2017 +0000

    fix compile errors after switchting to parent 30:
    - add scr annotation dependency where appropiate or remove maven-scr-plugin
    - switch to osgi versioning annotations
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1785674 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pom.xml b/pom.xml
index a78fc75..afa5eb8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,6 +43,12 @@
     <dependencies>
   
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
             <version>2.2.3-SNAPSHOT</version>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 37/48: SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 8f1c0f7d899f26423ed5169d0a41ac480b677bc5
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Apr 29 08:04:00 2017 +0000

    SLING-6812 sling-mock: Lazy initialization of ResourceResolverFactory
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793175 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/testing/mock/sling/context/SlingContextImpl.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 20557eb..0b47560 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -208,6 +208,7 @@ public class SlingContextImpl extends OsgiContextImpl {
         this.contentBuilder = null;
         this.resourceBuilder = null;
         this.uniqueRoot = null;
+        this.resourceResolverFactory = null;
         
         super.tearDown();
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 14/48: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit f7eb8c30e90ff4f4bc078fe52d7c28501508e2d4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 08:49:17 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1775014 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 80cc564..8f7647d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.4</version>
+    <version>2.2.5-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.4</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 45/48: SLING-6845 sling-mock: Support Sling Models Impl 1.4.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit c6a0d847bd4b99c9b436ffa6d71524047c29fd40
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 9 12:30:53 2017 +0000

    SLING-6845 sling-mock: Support Sling Models Impl 1.4.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1794552 13f79535-47bb-0310-9956-ffa450edef68
---
 .../mock/sling/context/SlingContextImpl.java       | 51 ++++++++++++----------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 4eb5607..3b84922 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -32,17 +32,7 @@ import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.api.scripting.SlingBindings;
 import org.apache.sling.api.scripting.SlingScriptHelper;
 import org.apache.sling.commons.mime.MimeTypeService;
-import org.apache.sling.models.impl.FirstImplementationPicker;
 import org.apache.sling.models.impl.ModelAdapterFactory;
-import org.apache.sling.models.impl.injectors.BindingsInjector;
-import org.apache.sling.models.impl.injectors.ChildResourceInjector;
-import org.apache.sling.models.impl.injectors.OSGiServiceInjector;
-import org.apache.sling.models.impl.injectors.RequestAttributeInjector;
-import org.apache.sling.models.impl.injectors.ResourcePathInjector;
-import org.apache.sling.models.impl.injectors.SelfInjector;
-import org.apache.sling.models.impl.injectors.SlingObjectInjector;
-import org.apache.sling.models.impl.injectors.ValueMapInjector;
-import org.apache.sling.models.spi.ImplementationPicker;
 import org.apache.sling.resourcebuilder.api.ResourceBuilder;
 import org.apache.sling.resourcebuilder.api.ResourceBuilderFactory;
 import org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService;
@@ -151,21 +141,23 @@ public class SlingContextImpl extends OsgiContextImpl {
         registerInjectActivateService(new ScriptEngineManagerFactory());
         registerInjectActivateService(new BindingsValuesProvidersByContextImpl());
         
-        // adapter factories
+        // sling models
         registerInjectActivateService(new ModelAdapterFactory());
-
-        // sling models injectors
-        registerInjectActivateService(new BindingsInjector());
-        registerInjectActivateService(new ChildResourceInjector());
-        registerInjectActivateService(new OSGiServiceInjector());
-        registerInjectActivateService(new RequestAttributeInjector());
-        registerInjectActivateService(new ResourcePathInjector());
-        registerInjectActivateService(new SelfInjector());
-        registerInjectActivateService(new SlingObjectInjector());
-        registerInjectActivateService(new ValueMapInjector());
-
-        // sling models implementation pickers
-        registerService(ImplementationPicker.class, new FirstImplementationPicker());
+        registerInjectActivateServiceByClassName(
+                "org.apache.sling.models.impl.FirstImplementationPicker",
+                "org.apache.sling.models.impl.ResourceTypeBasedResourcePicker",
+                "org.apache.sling.models.impl.injectors.BindingsInjector",
+                "org.apache.sling.models.impl.injectors.ChildResourceInjector",
+                "org.apache.sling.models.impl.injectors.OSGiServiceInjector",
+                "org.apache.sling.models.impl.injectors.RequestAttributeInjector",
+                "org.apache.sling.models.impl.injectors.ResourcePathInjector",
+                "org.apache.sling.models.impl.injectors.SelfInjector",
+                "org.apache.sling.models.impl.injectors.SlingObjectInjector",
+                "org.apache.sling.models.impl.injectors.ValueMapInjector",
+                "org.apache.sling.models.impl.via.BeanPropertyViaProvider",
+                "org.apache.sling.models.impl.via.ChildResourceViaProvider",
+                "org.apache.sling.models.impl.via.ForcedResourceTypeViaProvider",
+                "org.apache.sling.models.impl.via.ResourceSuperTypeViaProvider");
 
         // other services
         registerService(SlingSettingsService.class, new MockSlingSettingService(DEFAULT_RUN_MODES));
@@ -175,6 +167,17 @@ public class SlingContextImpl extends OsgiContextImpl {
         // scan for models defined via bundle headers in classpath
         ModelAdapterFactoryUtil.addModelsForManifestEntries(this.bundleContext());
     }
+    
+    private void registerInjectActivateServiceByClassName(String... classNames) {
+        for (String className : classNames) {
+            try {
+                Class<?> clazz = Class.forName(className);
+                registerInjectActivateService(clazz.newInstance());
+            } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+                // ignore - probably not the latest sling models impl version
+            }
+        }
+    }
 
     /**
      * Teardown actions after test method execution

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 48/48: [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-2.2.10

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 60497df4bcc540461fba25af628f04f97077417e
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Thu May 11 12:17:03 2017 +0000

    [maven-release-plugin] copy for tag org.apache.sling.testing.sling-mock-2.2.10
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.10@1794823 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 01/48: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit fc132d0189ede6aaaf38b5e0b2a5a4a80d707cbb
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 5 17:48:21 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1772737 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 01c2cfd..b223636 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.0</version>
+    <version>2.2.1-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 29/48: SLING-6728 sling-mock: Resource Resolver Type "NONE" does not work

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 863898e502f702477ec155fd537ff7277e894d92
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 27 15:04:42 2017 +0000

    SLING-6728 sling-mock: Resource Resolver Type "NONE" does not work
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1788943 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/ResourceResolverFactoryInitializer.java  |  2 ++
 .../sling/context/NoResourceResolverTypeTest.java  | 41 ++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
index 8b3d3d1..65d8dc1 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
@@ -122,6 +122,8 @@ class ResourceResolverFactoryInitializer {
      */
     private static void initializeResourceResolverFactoryActivator(BundleContext bundleContext) {
         Dictionary<String, Object> config = new Hashtable<String, Object>();
+        // do not required a specific resource provider (otherwise "NONE" will not work)
+        config.put("resource.resolver.required.providers", "");
         ResourceResolverFactoryActivator activator = new ResourceResolverFactoryActivator();
         MockOsgi.injectServices(activator, bundleContext);
         MockOsgi.activate(activator, bundleContext, config);
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
new file mode 100644
index 0000000..bf861f3
--- /dev/null
+++ b/src/test/java/org/apache/sling/testing/mock/sling/context/NoResourceResolverTypeTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.sling.context;
+
+import static org.junit.Assert.assertTrue;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.SyntheticResource;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class NoResourceResolverTypeTest {
+
+    @Rule
+    public SlingContext context = new SlingContext(ResourceResolverType.NONE);
+    
+    @Test
+    public void testRoot() {
+        Resource root = context.resourceResolver().getResource("/");
+        assertTrue(root instanceof SyntheticResource);
+    }
+    
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 30/48: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.6

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 26d77aacc3c9062f8a437fd5668ca195478821d4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Mar 27 15:21:03 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.6
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1788945 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index b911791..598e24b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.5-SNAPSHOT</version>
+    <version>2.2.6</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.6</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 08/48: [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 9e983a2fc5938de7c155a826b0e6eb59cf02b3e5
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 13 12:19:08 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.testing.sling-mock-2.2.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773981 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6bc92ea..5101dfb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.1-SNAPSHOT</version>
+    <version>2.2.2</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.2</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 10/48: update to next snapshot version until releases are available on maven central

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit edcb1a4391bea51f82eb9445333f11991d375145
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 13 12:27:16 2016 +0000

    update to next snapshot version until releases are available on maven central
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773991 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3221193..d353d03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,13 +45,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.2</version>
+            <version>2.2.3-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.2.0</version>
+            <version>1.2.1-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 12/48: SLING-6410 sling-mock: Add support für scripting BindingsValuesProvidersByContext

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit d044ce316e575d01168e40c732d9f1c42f48192e
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sat Dec 17 08:56:42 2016 +0000

    SLING-6410 sling-mock: Add support für scripting BindingsValuesProvidersByContext
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1774724 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                      | 12 ++++++++++++
 .../sling/testing/mock/sling/context/SlingContextImpl.java   |  6 ++++++
 2 files changed, 18 insertions(+)

diff --git a/pom.xml b/pom.xml
index 3221193..073267e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -113,6 +113,18 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.api</artifactId>
+            <version>2.1.8</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.core</artifactId>
+            <version>2.0.36</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.mime</artifactId>
             <version>2.1.8</version>
             <scope>compile</scope>
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index 97cd8e9..a9501e1 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -49,6 +49,8 @@ import org.apache.sling.models.spi.ImplementationPicker;
 import org.apache.sling.resourcebuilder.api.ResourceBuilder;
 import org.apache.sling.resourcebuilder.api.ResourceBuilderFactory;
 import org.apache.sling.resourcebuilder.impl.ResourceBuilderFactoryService;
+import org.apache.sling.scripting.core.impl.BindingsValuesProvidersByContextImpl;
+import org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory;
 import org.apache.sling.settings.SlingSettingsService;
 import org.apache.sling.testing.mock.osgi.context.OsgiContextImpl;
 import org.apache.sling.testing.mock.sling.MockSling;
@@ -157,6 +159,10 @@ public class SlingContextImpl extends OsgiContextImpl {
      */
     protected void registerDefaultServices() {
 
+        // scripting services (required by sling models impl since 1.3.6)
+        registerInjectActivateService(new ScriptEngineManagerFactory());
+        registerInjectActivateService(new BindingsValuesProvidersByContextImpl());
+        
         // adapter factories
         registerInjectActivateService(new ModelAdapterFactory());
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 05/48: update to latest jcr-mock snapshot

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 605e327d4df4b36686a8f5cc4971d352f012c4d5
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Sun Dec 11 12:34:20 2016 +0000

    update to latest jcr-mock snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1773568 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b223636..7bb0d4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.1.16</version>
+            <version>1.1.17-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 03/48: cosmetic: fix javadoc typos

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit f9f5ac5182712bbf2a26a238f5b88870a5621b08
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Dec 6 08:38:36 2016 +0000

    cosmetic: fix javadoc typos
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1772842 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/testing/mock/sling/context/ModelAdapterFactoryUtil.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtil.java b/src/main/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtil.java
index 38675ee..7ff2195 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtil.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/ModelAdapterFactoryUtil.java
@@ -49,7 +49,7 @@ import org.osgi.framework.Version;
 import org.reflections.Reflections;
 
 /**
- * Helper methos for simulating sling models bundle events.
+ * Helper methods for registering Sling Models from the classpath.
  */
 final class ModelAdapterFactoryUtil {
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 11/48: switch to released versions

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 436ba6697ac3660a7127866d6737d85802d93a8f
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Fri Dec 16 15:13:36 2016 +0000

    switch to released versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1774615 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index d353d03..3221193 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,13 +45,13 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.3-SNAPSHOT</version>
+            <version>2.2.2</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.jcr-mock</artifactId>
-            <version>1.2.1-SNAPSHOT</version>
+            <version>1.2.0</version>
             <scope>compile</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 19/48: update to latest osgi-mock version

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 6a5747c8ceb50df8c47c8c573e8fc93ab59aad1b
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Mar 1 17:30:43 2017 +0000

    update to latest osgi-mock version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1785007 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7de79d2..adf1e27 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
-            <version>2.2.2</version>
+            <version>2.2.3-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
@@ -196,36 +196,6 @@
             <version>1.8.3</version>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.reflections</groupId>
-            <artifactId>reflections</artifactId>
-            <!-- Do not use version 0.9.10, it created threading issues when running junit tests in parallel (see SLING-5002) -->
-            <version>0.9.9</version>
-            <scope>compile</scope>
-            <!-- exclude all optional dependencies -->
-            <exclusions>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>dom4j</groupId>
-                    <artifactId>dom4j</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.google.code.gson</groupId>
-                    <artifactId>gson</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>javax.servlet</groupId>
-                    <artifactId>servlet-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-simple</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
     
         <dependency>
             <groupId>javax.servlet</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-testing-sling-mock] 40/48: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.testing.sling-mock-2.2.10
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit debf3cf3c19bc72032f5fe62fb763482b970f4c6
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue May 2 16:05:23 2017 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1793555 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index a6e9128..d0779b9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
     </parent>
 
     <artifactId>org.apache.sling.testing.sling-mock</artifactId>
-    <version>2.2.8</version>
+    <version>2.2.9-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Testing Sling Mock</name>
     <description>Mock implementation of selected Sling APIs.</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.sling-mock-2.2.8</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/testing/mocks/sling-mock</url>
     </scm>
 
     <dependencies>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.