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 09:27:15 UTC

[sling-org-apache-sling-discovery-commons] annotated tag org.apache.sling.discovery.commons-1.0.14 created (now ddaf531)

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

rombert pushed a change to annotated tag org.apache.sling.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git.


      at ddaf531  (tag)
 tagging d58c766aecf1f2a0a06f101aa0796365287e3b59 (commit)
      by Stefan Egli
      on Wed Sep 21 14:53:19 2016 +0000

- Log -----------------------------------------------------------------
org.apache.sling.discovery.commons-1.0.14
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new b8fe30c  SLING-4665 : adding patch provided by Timothee Maret, many thanks
     new 7eadb24  svn:ignore updated
     new 5943189  SLING-4685 : adding initial version of ViewStateManager - a shared implementation of TopologyEventListener-handling and sending of events based on activate/deactivate/changing/newView triggers - intended for use by implementors of the discovery.api (not clients of it)
     new f438f9e  SLING-4698 - Set parent.relativePath to empty for all modules
     new 576bc0d  Update svn:ignore
     new f93b193  Update to Sling Parent 23
     new 0035b7d  set parent version to 24 and add empty relativePath where missing
     new e599fa8  Update the main reactor to parent 25
     new 9a31ba9  SLING-5131 : introducing ConsistencyService and an oak-discovery-lite based implementation of it - plus SLING-4697 : support for PROPERTIES_CHANGED added to ViewStateManagerImpl
     new b33eee0  SLING-5131 : re-adding ViewStateManager which for some reason got removed by svn in 1707548
     new bb3d20d  SLING-4697 : support for PROPERTIES_CHANGED in ViewStateManagerImpl tested and thus fixed
     new 0e44e3d  SLING-5173 : introducing discovery.base which is the sharable parts of discovery.impl for discovery.oak - eg it includes topology connectors and base classes - plus it also includes many it-kind tests of discovery.impl
     new 3d923b4  SLING-5173 : rename commons impl packages to base as they are meant for reuse by discovery.impl and discovery.oak - plus avoid using abstract component class with scr annotations - use abstract getters instead - plus some more fine-tuning of log messages - plus make discovery.impl's Config also implement DiscoveryLiteConfig - plus properly handle binds happening before activate in DiscoveryServiceImpl
     new 6dd90e1  SLING-5173 : adding refactored SyncTokenOnlyConsistencyService again
     new dd9150c  SLING-4603 related : some fixes in class structure / syncToken handling
     new cf6bb53  SLING-5173 related : EventFactory renamed to EventHelper - and introduced toShortString() for a few base view classes to shorten and make the log output more readable
     new dcfc44f  SLING-5173 and SLING-4603 related : more syncToken log.info - plus always doing the syncToken thingy, independent of whether any instance left or joined the cluster as otherwise this thing wont work
     new 81a52c9  SLING-5173 : log.info fix
     new 8b4c590  SLING-5094 / SLING-4603 related : cancel ongoing sync explicitly in order to avoid dangerous CHANGED event when changes happen during sync
     new f957528  SLING-5173 : reducing visibility of isDelaying
     new 732f4d6  SLING-5173 : reduce log in cancel when already done
     new e88458a  SLING-4603 : more aggressively clearing the idMap-cache to avoid stale entries on slingId change - plus added getSyncHistory to BaseSyncTokenConsistencyService to allow adding it to the webconsole for debug - plus some cleanup in webconsole wrt discoveryLite info
     new 36ac966  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new 1a36029  SLING-5173 : added simple implementation for findInstances
     new 8d22485  SLING-5173 : added getInstance(slingId) to simplify things
     new 6dd354e  SLING-5173 : introducing a more explicit chain concept for ConsistencyServices than the previous hidden/implicit one: ConsistencyServiceChain
     new df6d865  SLING-5173 : bugfix for leader changes: leader change was treated as a properties change - which was very bad - now it is properly treated as a TOPOLOGY_CHANGED. Note that leader change should not happen in an otherwise unchanged topology - but it can if one instance's discovery.oak bundle for example is restarted, thus getting a lower leaderElectionId. Thus discovery.commons must account for this
     new 3edba1a  SLING-5173 : re-added complete consistency-history after introducing splitting them and using the ConsistencyServiceChain. Probably should be refactored into something slightly nicer though
     new 05027b8  SLING-5173 : minor code cleanup (duplicate logger removed)
     new 2e5938f  SLING-4603 : even more aggressively clearing the idMap-cache to avoid stale entries : now registering an EventHandler that listens on /var/discovery/../idMap and clears the cache on any change therein
     new 11a225d  SLING-4603 : minor fix to previous commit : turns out the path must be /var/xy/idMap not /var/xy/idMap/* as that would apply to children only
     new 5a5f5ee  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new 26e1a7b  SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
     new fc2a805  SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService - plus making timeout/interval values for the same configurable in discovery.oak
     new 032f500  SLING-5094 related : more test stability by adding a wait time of 2sec
     new e5ded77  SLING-5094 / SLING-5191 / SLING-4603 : rename ConsistencyService to ClusterSyncService
     new fdd2176  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.0
     new 1df7dc1  [maven-release-plugin] prepare for next development iteration
     new 283f6b9  SLING-5214: include millis in testing log formats
     new 5c5f5e8  SLING-5225 : increase wait times to avoid test failure on jenkins due to lower hardware speed
     new 9dcf468  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.2
     new a5144bc  [maven-release-plugin] prepare for next development iteration
     new d71490a  SLING-5256 : change in localClusterSyncTokenId should always trigger a TOPOLOGY_CHANGED - ensured by adjusting ViewStateManager.onlyDiffersInProperties and DefaultTopologyView.compareTopology accordingly including new tests for both - plus added OakDiscoveryServiceTest.testDescriptorSeqNumChange to verify that discovery.oak now properly detects otherwise-equal topologies when their sequence_number==localClusterSyncTokenId differs (unlikely to happen under normal load sit [...]
     new 0f3c5c8  no-jira : fixed a log.trace message
     new 3529e4f  SLING-5267 : fixed testTwoNodesOneLeaving by making wait times safer, asserting for background-runnable done-state, plus added more logging in case this one is still not perfectly stable on jenkins
     new 8f8aedf  SLING-5282 : calling consistencyService.cancelSync(); in handleDeactivated
     new 7571e2f  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.4
     new 1cc2db6  [maven-release-plugin] prepare for next development iteration
     new dbdcc68  SLING-5310: adding cancelDelaying to MinEventDelayHandler - plus added a testReactivate test method which checks the scenario described in this ticket. Plus also added somewhat more logging to the HeartbeatHandler to help debugging should something similar reoccur
     new ca87b3d  SLING-5310 : replaced waitForAsyncEvents(4sec) with Thread.sleep(4sec) then another waitForAsyncEvents(2sec) to avoid making the assertion just when the event would yet be triggered
     new be1c2b7  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.6
     new 51fd2d4  [maven-release-plugin] prepare for next development iteration
     new 4830188  Remove type from bundle dependencies
     new ea02b02  Switch to parent pom 26
     new 8cb4867  SLING-5458 : id can now be null - return null in getViewId in that case
     new c664312  SLING-5458 : when clusterView.getId differs, that must result in a TOPOLOGY_CHANGING/CHANGED sequence - unlike before this fix where it just resulted in a PROPERTIES_CHANGED - which is wrong
     new c29e93e  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.8
     new ccce69b  [maven-release-plugin] prepare for next development iteration
     new 8468d76  SLING-5464 : fixed regression introduced in onlyDiffersInProperties - and added a proper JUnit test which would have avoided the problem in the first place
     new 6d303d2  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.10
     new 6e713d1  [maven-release-plugin] prepare for next development iteration
     new c57bb81  SLING-5494 : Discovery InstancesDiff.retained() implementation not according to API doc - Match the API with the implementation - This closes #122 of github pull request of tmaret, many thx
     new 1e2a10d  SLING-5592 : cancel backgroundCheck thread in deactivate for rare cases where it is still running
     new e3d6546  SLING-5620 : upgrade sling.commons.scheduler dependency to 2.4.0
     new 202f5b9  SLING-5621 : adding InitDelayingTopologyEventListener that came up as part of SLING-5560 to discovery.commons
     new 5fdb4c5  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.12
     new a73e87d  [maven-release-plugin] prepare for next development iteration
     new a3da984  SLING-5598 : exclude slow running test by newly introduced Slow junit category - to run them nevertheless use -PincludeSlowTests
     new da23f5b  use org.apache.sling.commons.testing 2.0.26
     new 188fecc  use stable releases (Jackrabbit and Oak)
     new 37e5450  SLING-5995 : changing IdMapService from being an OSGi EventListener to a Sling ResourceChangeListener
     new 31f4a00  [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.14
     new d58c766  [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.14

The 73 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-discovery-commons] 06/07: [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.14

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 31f4a00235e19f58924694d97c6556931df368b2
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Sep 21 14:53:04 2016 +0000

    [maven-release-plugin] prepare release org.apache.sling.discovery.commons-1.0.14
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1761758 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index ec30556..5d3daad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.13-SNAPSHOT</version>
+    <version>1.0.14</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
     
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.14</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.14</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.14</url>
     </scm>
 
     <properties>
@@ -91,7 +91,7 @@
                 achieve that. -->
             <id>includeSlowTests</id>
             <properties>
-                <sling.excluded.surefire.groups></sling.excluded.surefire.groups>
+                <sling.excluded.surefire.groups />
             </properties>
         </profile>
     </profiles>

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

[sling-org-apache-sling-discovery-commons] 07/07: [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.14

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit d58c766aecf1f2a0a06f101aa0796365287e3b59
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Sep 21 14:53:19 2016 +0000

    [maven-release-plugin] copy for tag org.apache.sling.discovery.commons-1.0.14
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.14@1761759 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-discovery-commons] 01/07: [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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit a73e87d3ad820371bbdbb116a3c8afab1b534819
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Mar 21 14:21:34 2016 +0000

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

diff --git a/pom.xml b/pom.xml
index e459123..9a7c69d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,15 +29,15 @@
 
     <artifactId>org.apache.sling.discovery.commons</artifactId>
     <packaging>bundle</packaging>
-    <version>1.0.12</version>
+    <version>1.0.13-SNAPSHOT</version>
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.12</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.discovery.commons-1.0.12</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.discovery.commons-1.0.12</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
     <build>

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

[sling-org-apache-sling-discovery-commons] 05/07: SLING-5995 : changing IdMapService from being an OSGi EventListener to a Sling ResourceChangeListener

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 37e545076ed339cf1dd128fb8e6174817f367905
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Sep 21 14:46:59 2016 +0000

    SLING-5995 : changing IdMapService from being an OSGi EventListener to a Sling ResourceChangeListener
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1761756 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  8 ++--
 .../commons/providers/spi/base/IdMapService.java   | 48 +++++++++-------------
 .../commons/providers/spi/base/package-info.java   |  4 +-
 .../providers/spi/base/MockedResourceResolver.java | 20 +++++++++
 4 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/pom.xml b/pom.xml
index b5b8105..ec30556 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,8 +119,8 @@
 		<dependency>
 			<groupId>org.apache.sling</groupId>
 			<artifactId>org.apache.sling.api</artifactId>
-			<version>2.4.0</version>
-            <scope>provided</scope>
+			<version>2.10.0</version>
+			<scope>provided</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.sling</groupId>
@@ -161,7 +161,9 @@
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
+            <version>6.0.0</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
index 7828103..e171738 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
@@ -22,6 +22,7 @@ import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -31,7 +32,6 @@ import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
-import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.LoginException;
 import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.PersistenceException;
@@ -39,6 +39,9 @@ import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.resource.observation.ResourceChangeListener;
+import org.apache.sling.api.resource.observation.ResourceChange;
+import org.apache.sling.api.resource.observation.ResourceChange.ChangeType;
 import org.apache.sling.commons.json.JSONException;
 import org.apache.sling.discovery.commons.providers.util.ResourceHelper;
 import org.apache.sling.settings.SlingSettingsService;
@@ -46,8 +49,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
-import org.osgi.service.event.EventConstants;
-import org.osgi.service.event.EventHandler;
 
 /**
  * The IdMapService is responsible for storing a slingId-clusterNodeId
@@ -56,7 +57,7 @@ import org.osgi.service.event.EventHandler;
  */
 @Component(immediate = false)
 @Service(value = { IdMapService.class })
-public class IdMapService extends AbstractServiceWithBackgroundCheck implements EventHandler {
+public class IdMapService extends AbstractServiceWithBackgroundCheck implements ResourceChangeListener {
 
     @Reference
     private ResourceResolverFactory resourceResolverFactory;
@@ -80,7 +81,7 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
 
     private BundleContext bundleContext;
 
-    private ServiceRegistration eventHandlerRegistration;
+    private volatile ServiceRegistration<ResourceChangeListener> eventHandlerRegistration;
     
     /** test-only constructor **/
     public static IdMapService testConstructor(
@@ -131,18 +132,16 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
         }
         Dictionary<String,Object> properties = new Hashtable<String,Object>();
         properties.put(Constants.SERVICE_DESCRIPTION, "IdMap Change Listener.");
+        properties.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         String[] topics = new String[] {
-                SlingConstants.TOPIC_RESOURCE_ADDED,
-                SlingConstants.TOPIC_RESOURCE_CHANGED,
-                SlingConstants.TOPIC_RESOURCE_REMOVED };
-        properties.put(EventConstants.EVENT_TOPIC, topics);
-        String path = getIdMapPath();
-        if (path.endsWith("/")) {
-            path = path.substring(0, path.length()-1);
-        }
-        properties.put(EventConstants.EVENT_FILTER, "(&(path="+path+"))");
-        eventHandlerRegistration = bundleContext.registerService(
-                EventHandler.class.getName(), this, properties);
+                ChangeType.ADDED.toString(),
+                ChangeType.CHANGED.toString(),
+                ChangeType.REMOVED.toString()
+                };
+        properties.put(ResourceChangeListener.CHANGES, topics);
+        properties.put(ResourceChangeListener.PATHS, getIdMapPath());
+
+        this.eventHandlerRegistration = bundleContext.registerService(ResourceChangeListener.class, this, properties);
     }
 
     /** Get or create a ResourceResolver **/
@@ -318,18 +317,11 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
     }
 
     @Override
-    public void handleEvent(Event event) {
-        final String resourcePath = (String) event.getProperty("path");
-        if (resourcePath == null) {
-            // not of my business
-            return;
-        }
-        
-        if (!resourcePath.startsWith(getIdMapPath())) {
-            // not of my business
-            return;
-        }
-        logger.debug("handleEvent: got event for path: {}, event: {}", resourcePath, event);
+    public void onChange(List<ResourceChange> changes) {
+        // the listener is registered on the .../idmap subpath, so any
+        // change it receives should be relevant. hence no further
+        // filtering necessary here.
+        logger.debug("onChange: got notified of changes, clearing cache.");
         clearCache();
     }
 
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/package-info.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/package-info.java
index aa1fe77..8a66f21 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/package-info.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/package-info.java
@@ -20,9 +20,9 @@
 /**
  * Provides default SPI-implementations used by discovery.commons.providers.impl
  *
- * @version 1.0.0
+ * @version 2.0.0
  */
-@Version("1.0.0")
+@Version("2.0.0")
 package org.apache.sling.discovery.commons.providers.spi.base;
 
 import aQute.bnd.annotation.Version;
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/MockedResourceResolver.java b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/MockedResourceResolver.java
index a86a380..16a9c38 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/MockedResourceResolver.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/MockedResourceResolver.java
@@ -326,4 +326,24 @@ public class MockedResourceResolver implements ResourceResolver {
 
     }
 
+    @Override
+    public Resource getParent(Resource child) {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
+    @Override
+    public boolean hasChildren(Resource resource) {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
+    @Override
+    public Resource copy(String srcAbsPath, String destAbsPath) throws PersistenceException {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
+    @Override
+    public Resource move(String srcAbsPath, String destAbsPath) throws PersistenceException {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
 }

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

[sling-org-apache-sling-discovery-commons] 02/07: SLING-5598 : exclude slow running test by newly introduced Slow junit category - to run them nevertheless use -PincludeSlowTests

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit a3da98478d4b596bed7728d0c5b0ed00cade176c
Author: Stefan Egli <st...@apache.org>
AuthorDate: Wed Apr 27 09:25:49 2016 +0000

    SLING-5598 : exclude slow running test by newly introduced Slow junit category - to run them nevertheless use -PincludeSlowTests
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1741177 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  37 ++++-
 .../providers/base/TestMinEventDelayHandler.java   |   6 +-
 .../providers/base/TestSlowViewStateManager.java   | 153 +++++++++++++++++++++
 .../providers/base/TestViewStateManager.java       | 119 ++--------------
 .../providers/spi/base/RepositoryTestHelper.java   |   6 +-
 5 files changed, 207 insertions(+), 114 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9a7c69d..19150f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,13 +33,18 @@
 
     <name>Apache Sling Discovery Commons</name>
     <description>Common services related to Sling Discovery</description>
-
+    
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons</developerConnection>
         <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/commons</url>
     </scm>
 
+    <properties>
+        <!-- by default Slow tests are excluded - use -PincludeSlowTests to include them -->
+    	<sling.excluded.surefire.groups>org.apache.sling.commons.testing.junit.categories.Slow</sling.excluded.surefire.groups>
+    </properties>
+
     <build>
         <plugins>
             <plugin>
@@ -66,8 +71,28 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <argLine>-Xmx2048m</argLine>
+                    <excludedGroups>${sling.excluded.surefire.groups}</excludedGroups>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <!-- when -PincludeSlowTests is set, the Slow tests should also be executed, 
+                hence unsetting the category excludes 'sling.excluded.surefire.groups' to 
+                achieve that. -->
+            <id>includeSlowTests</id>
+            <properties>
+                <sling.excluded.surefire.groups></sling.excluded.surefire.groups>
+            </properties>
+        </profile>
+    </profiles>
     <dependencies>
         <dependency>
             <groupId>org.apache.felix</groupId>
@@ -110,7 +135,7 @@
         <dependency>
         	<groupId>org.apache.sling</groupId>
         	<artifactId>org.apache.sling.commons.testing</artifactId>
-        	<version>2.0.16</version>
+        	<version>2.0.25-SNAPSHOT</version>
         	<scope>test</scope>
             <exclusions>
                 <!-- slf4j simple implementation logs INFO + higher to stdout (we don't want that behaviour) -->
@@ -208,5 +233,13 @@
 			<version>1.2.2</version>
             <scope>provided</scope>
 		</dependency>
+        <dependency>
+            <groupId>org.jmock</groupId>
+            <artifactId>jmock-junit4</artifactId>
+            <!-- with 2.5.1 jmock-junit4, which has a dependency on junit 4.4 
+                you get the following: NoSuchMethodError: org.junit.runner.Request.classes(Lorg/junit/runner/Computer;[Ljava/lang/Class;)Lorg/junit/runner/Request; 
+                hence this explicit newer dependency. -->
+            <version>2.8.2</version>
+        </dependency>
     </dependencies>
 </project>
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
index 0b868ea..eabc85f 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestMinEventDelayHandler.java
@@ -29,6 +29,7 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.log4j.Level;
 import org.apache.log4j.LogManager;
+import org.apache.sling.commons.testing.junit.categories.Slow;
 import org.apache.sling.discovery.commons.providers.BaseTopologyView;
 import org.apache.sling.discovery.commons.providers.DefaultClusterView;
 import org.apache.sling.discovery.commons.providers.DummyTopologyView;
@@ -39,6 +40,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -77,7 +79,7 @@ public class TestMinEventDelayHandler {
 
         final org.apache.log4j.Logger discoveryLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery");
         logLevel = discoveryLogger.getLevel();
-        discoveryLogger.setLevel(Level.DEBUG);
+        discoveryLogger.setLevel(Level.INFO); // changed from Level.DEBUG
     }
     
     @After
@@ -165,6 +167,7 @@ public class TestMinEventDelayHandler {
         assertEquals(0, listener.countEvents());
     }
 
+    @Category(Slow.class) //TODO test takes env 50sec
     @Test
     public void testNormalDelaying() throws Exception {
         final DummyListener listener = new DummyListener();
@@ -190,6 +193,7 @@ public class TestMinEventDelayHandler {
         }
     }
 
+    @Category(Slow.class) //TODO test takes env 45sec
     @Test
     public void testFailedDelaying() throws Exception {
         scheduler.failMode();
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestSlowViewStateManager.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestSlowViewStateManager.java
new file mode 100644
index 0000000..866acd7
--- /dev/null
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestSlowViewStateManager.java
@@ -0,0 +1,153 @@
+/*
+ * 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.discovery.commons.providers.base;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Random;
+import java.util.UUID;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.apache.sling.commons.testing.junit.categories.Slow;
+import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.commons.providers.DefaultClusterView;
+import org.apache.sling.discovery.commons.providers.DummyTopologyView;
+import org.apache.sling.discovery.commons.providers.EventHelper;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category(Slow.class)
+public class TestSlowViewStateManager extends TestViewStateManager {
+
+    /** does couple loops randomly calling handleChanging() (or not) and then handleNewView().
+     * Note: random is passed to allow customizing and not hardcoding this method to a particular random 
+     * @throws InterruptedException **/
+    protected void randomEventLoop(final Random random, DummyListener... listeners) throws InterruptedException {
+        TestHelper.randomEventLoop(mgr, null, 100, -1, random, listeners);
+    }
+    
+    @Category(Slow.class) //TODO test takes env 10sec
+    @Test
+    public void testClusterSyncService_withConcurrency() throws Exception {
+        final org.apache.log4j.Logger commonsLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery.commons.providers");
+        final org.apache.log4j.Level logLevel = commonsLogger.getLevel();
+        commonsLogger.setLevel(Level.INFO); // change here to DEBUG in case of issues with this test
+        final Semaphore serviceSemaphore = new Semaphore(0);
+        final Semaphore testSemaphore = new Semaphore(0);
+        final ReentrantLock lock = new ReentrantLock();
+        final ClusterSyncServiceWithSemaphore cs = new ClusterSyncServiceWithSemaphore(lock, serviceSemaphore );
+        mgr = new ViewStateManagerImpl(lock, cs);
+        final DummyListener listener = new DummyListener();
+        mgr.bind(listener);
+        TestHelper.assertNoEvents(listener);
+        mgr.handleActivated();
+        TestHelper.assertNoEvents(listener);
+        final String slingId1 = UUID.randomUUID().toString();
+        final String slingId2 = UUID.randomUUID().toString();
+        final String slingId3 = UUID.randomUUID().toString();
+        final String clusterId = UUID.randomUUID().toString();
+        final DefaultClusterView cluster = new DefaultClusterView(clusterId);
+        final DummyTopologyView view1 = new DummyTopologyView()
+                .addInstance(slingId1, cluster, true, true)
+                .addInstance(slingId2, cluster, false, false)
+                .addInstance(slingId3, cluster, false, false);
+        final DummyTopologyView view2 = DummyTopologyView.clone(view1).removeInstance(slingId2);
+        final DummyTopologyView view3 = DummyTopologyView.clone(view1).removeInstance(slingId2).removeInstance(slingId3);
+        async(new Runnable() {
+
+            public void run() {
+                mgr.handleNewView(view1);
+            }
+            
+        });
+        Thread.sleep(1000);
+        TestHelper.assertNoEvents(listener);
+        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
+        serviceSemaphore.release(1); // release the first one only
+        Thread.sleep(1000);
+        assertEvents(listener, EventHelper.newInitEvent(view1));
+        mgr.handleChanging();
+        assertEquals(0, mgr.waitForAsyncEvents(500));
+        assertEvents(listener, EventHelper.newChangingEvent(view1));
+        async(new Runnable() {
+
+            public void run() {
+                mgr.handleNewView(view2);
+            }
+            
+        });
+        logger.debug("run: waiting 1sec");
+        Thread.sleep(1000);
+        logger.debug("run: asserting no events");
+        TestHelper.assertNoEvents(listener);
+        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
+        assertFalse("should not be locked", lock.isLocked());
+
+        logger.debug("run: issuing a second event");
+        // before releasing, issue another event, lets do a combination of changing/changed
+        async(new Runnable() {
+
+            public void run() {
+                logger.debug("run2: calling handleChanging...");
+                mgr.handleChanging();
+                try {
+                    logger.debug("run2: done with handleChanging, acquiring testSemaphore...");
+                    testSemaphore.acquire();
+                    logger.debug("run2: calling handleNewView...");
+                    mgr.handleNewView(view3);
+                    logger.debug("run2: done with handleNewView...");
+                } catch (InterruptedException e) {
+                    // fail
+                    logger.error("interrupted: "+e, e);
+                }
+            }
+            
+        });
+        logger.debug("run: waiting 1sec");
+        Thread.sleep(1000);
+        int remainingAsyncEvents = mgr.waitForAsyncEvents(2000);
+        logger.info("run: result of waitForAsyncEvent is: "+remainingAsyncEvents);
+        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
+        assertEquals("should be acquiring (by thread2)", 1, testSemaphore.getQueueLength());
+        // releasing the testSemaphore
+        testSemaphore.release();
+        logger.debug("run: waiting 1sec");
+        Thread.sleep(1000);
+        assertEquals("should have two async events now in the queue or being sent", 2, mgr.waitForAsyncEvents(500));
+        assertEquals("but should only have 1 thread actually sitting on the semaphore waiting", 1, serviceSemaphore.getQueueLength());
+        logger.debug("run: releasing consistencyService");
+        serviceSemaphore.release(1); // release the first one only
+        logger.debug("run: waiting 1sec");
+        Thread.sleep(1000);
+        assertFalse("should not be locked", lock.isLocked());
+        TestHelper.assertNoEvents(listener); // this should not have triggered any event 
+        serviceSemaphore.release(1); // then release the 2nd one
+        logger.debug("run: waiting 1sec");
+        Thread.sleep(1000);
+        logger.debug("run: asserting 1 event");
+        final TopologyEvent changedEvent = EventHelper.newChangedEvent(view1, view3);
+        assertEvents(listener, changedEvent);
+        commonsLogger.setLevel(Level.INFO); // back to default
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
index 4e73bc7..34cfa93 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/base/TestViewStateManager.java
@@ -32,6 +32,7 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.log4j.Level;
 import org.apache.log4j.LogManager;
+import org.apache.sling.commons.testing.junit.categories.Slow;
 import org.apache.sling.discovery.ClusterView;
 import org.apache.sling.discovery.DiscoveryService;
 import org.apache.sling.discovery.InstanceDescription;
@@ -46,14 +47,15 @@ import org.apache.sling.discovery.commons.providers.spi.ClusterSyncService;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class TestViewStateManager {
 
-    private static final Logger logger = LoggerFactory.getLogger(TestViewStateManager.class);
+    protected static final Logger logger = LoggerFactory.getLogger(TestViewStateManager.class);
 
-    private class ClusterSyncServiceWithSemaphore implements ClusterSyncService {
+    class ClusterSyncServiceWithSemaphore implements ClusterSyncService {
 
         private final Semaphore semaphore;
         private final Lock lock;
@@ -86,7 +88,7 @@ public class TestViewStateManager {
         
     }
     
-    private ViewStateManagerImpl mgr;
+    protected ViewStateManagerImpl mgr;
     
     private Random defaultRandom;
 
@@ -130,8 +132,8 @@ public class TestViewStateManager {
     /** does couple loops randomly calling handleChanging() (or not) and then handleNewView().
      * Note: random is passed to allow customizing and not hardcoding this method to a particular random 
      * @throws InterruptedException **/
-    private void randomEventLoop(final Random random, DummyListener... listeners) throws InterruptedException {
-        TestHelper.randomEventLoop(mgr, null, 100, -1, random, listeners);
+    protected void randomEventLoop(final Random random, DummyListener... listeners) throws InterruptedException {
+        TestHelper.randomEventLoop(mgr, null, 5, -1, random, listeners);
     }
     
     @Test
@@ -616,117 +618,14 @@ public class TestViewStateManager {
         commonsLogger.setLevel(Level.INFO); // back to default
     }
 
-    private void async(Runnable runnable) {
+    protected void async(Runnable runnable) {
         new Thread(runnable).start();
     }
 
     @Test
-    public void testClusterSyncService_withConcurrency() throws Exception {
-        final org.apache.log4j.Logger commonsLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery.commons.providers");
-        final org.apache.log4j.Level logLevel = commonsLogger.getLevel();
-        commonsLogger.setLevel(Level.INFO); // change here to DEBUG in case of issues with this test
-        final Semaphore serviceSemaphore = new Semaphore(0);
-        final Semaphore testSemaphore = new Semaphore(0);
-        final ReentrantLock lock = new ReentrantLock();
-        final ClusterSyncServiceWithSemaphore cs = new ClusterSyncServiceWithSemaphore(lock, serviceSemaphore );
-        mgr = new ViewStateManagerImpl(lock, cs);
-        final DummyListener listener = new DummyListener();
-        mgr.bind(listener);
-        TestHelper.assertNoEvents(listener);
-        mgr.handleActivated();
-        TestHelper.assertNoEvents(listener);
-        final String slingId1 = UUID.randomUUID().toString();
-        final String slingId2 = UUID.randomUUID().toString();
-        final String slingId3 = UUID.randomUUID().toString();
-        final String clusterId = UUID.randomUUID().toString();
-        final DefaultClusterView cluster = new DefaultClusterView(clusterId);
-        final DummyTopologyView view1 = new DummyTopologyView()
-                .addInstance(slingId1, cluster, true, true)
-                .addInstance(slingId2, cluster, false, false)
-                .addInstance(slingId3, cluster, false, false);
-        final DummyTopologyView view2 = DummyTopologyView.clone(view1).removeInstance(slingId2);
-        final DummyTopologyView view3 = DummyTopologyView.clone(view1).removeInstance(slingId2).removeInstance(slingId3);
-        async(new Runnable() {
-
-            public void run() {
-                mgr.handleNewView(view1);
-            }
-            
-        });
-        Thread.sleep(1000);
-        TestHelper.assertNoEvents(listener);
-        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
-        serviceSemaphore.release(1); // release the first one only
-        Thread.sleep(1000);
-        assertEvents(listener, EventHelper.newInitEvent(view1));
-        mgr.handleChanging();
-        assertEquals(0, mgr.waitForAsyncEvents(500));
-        assertEvents(listener, EventHelper.newChangingEvent(view1));
-        async(new Runnable() {
-
-            public void run() {
-                mgr.handleNewView(view2);
-            }
-            
-        });
-        logger.debug("run: waiting 1sec");
-        Thread.sleep(1000);
-        logger.debug("run: asserting no events");
-        TestHelper.assertNoEvents(listener);
-        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
-        assertFalse("should not be locked", lock.isLocked());
-
-        logger.debug("run: issuing a second event");
-        // before releasing, issue another event, lets do a combination of changing/changed
-        async(new Runnable() {
-
-            public void run() {
-                logger.debug("run2: calling handleChanging...");
-                mgr.handleChanging();
-                try {
-                    logger.debug("run2: done with handleChanging, acquiring testSemaphore...");
-                    testSemaphore.acquire();
-                    logger.debug("run2: calling handleNewView...");
-                    mgr.handleNewView(view3);
-                    logger.debug("run2: done with handleNewView...");
-                } catch (InterruptedException e) {
-                    // fail
-                    logger.error("interrupted: "+e, e);
-                }
-            }
-            
-        });
-        logger.debug("run: waiting 1sec");
-        Thread.sleep(1000);
-        int remainingAsyncEvents = mgr.waitForAsyncEvents(2000);
-        logger.info("run: result of waitForAsyncEvent is: "+remainingAsyncEvents);
-        assertEquals("should have one thread now waiting", 1, serviceSemaphore.getQueueLength());
-        assertEquals("should be acquiring (by thread2)", 1, testSemaphore.getQueueLength());
-        // releasing the testSemaphore
-        testSemaphore.release();
-        logger.debug("run: waiting 1sec");
-        Thread.sleep(1000);
-        assertEquals("should have two async events now in the queue or being sent", 2, mgr.waitForAsyncEvents(500));
-        assertEquals("but should only have 1 thread actually sitting on the semaphore waiting", 1, serviceSemaphore.getQueueLength());
-        logger.debug("run: releasing consistencyService");
-        serviceSemaphore.release(1); // release the first one only
-        logger.debug("run: waiting 1sec");
-        Thread.sleep(1000);
-        assertFalse("should not be locked", lock.isLocked());
-        TestHelper.assertNoEvents(listener); // this should not have triggered any event 
-        serviceSemaphore.release(1); // then release the 2nd one
-        logger.debug("run: waiting 1sec");
-        Thread.sleep(1000);
-        logger.debug("run: asserting 1 event");
-        final TopologyEvent changedEvent = EventHelper.newChangedEvent(view1, view3);
-        assertEvents(listener, changedEvent);
-        commonsLogger.setLevel(Level.INFO); // back to default
-    }
-
-    @Test
     public void testOnlyDiffersInProperties() throws Exception {
         final org.apache.log4j.Logger discoveryLogger = LogManager.getRootLogger().getLogger("org.apache.sling.discovery");
-        discoveryLogger.setLevel(Level.DEBUG);
+        discoveryLogger.setLevel(Level.INFO); // changed from Level.DEBUG
         logger.info("testOnlyDiffersInProperties: start");
         final String slingId1 = UUID.randomUUID().toString();
         final String slingId2 = UUID.randomUUID().toString();
diff --git a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/RepositoryTestHelper.java b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/RepositoryTestHelper.java
index 9e4fcfd..1d2ff35 100644
--- a/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/RepositoryTestHelper.java
+++ b/src/test/java/org/apache/sling/discovery/commons/providers/spi/base/RepositoryTestHelper.java
@@ -57,6 +57,7 @@ import org.jmock.Mockery;
 import org.jmock.api.Action;
 import org.jmock.api.Invocation;
 import org.jmock.integration.junit4.JUnit4Mockery;
+import org.jmock.lib.concurrent.Synchroniser;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -214,7 +215,10 @@ public class RepositoryTestHelper {
 
     public static ResourceResolverFactory mockResourceResolverFactory(final SlingRepository repositoryOrNull)
             throws Exception {
-        Mockery context = new JUnit4Mockery();
+        Mockery context = new JUnit4Mockery(){{
+        	// @see http://www.jmock.org/threading-synchroniser.html
+            setThreadingPolicy(new Synchroniser());
+        }};
     
         final ResourceResolverFactory resourceResolverFactory = context
                 .mock(ResourceResolverFactory.class);

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

[sling-org-apache-sling-discovery-commons] 03/07: use org.apache.sling.commons.testing 2.0.26

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit da23f5b15265d42f341821688e65300c17bc86cf
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Jul 13 12:39:32 2016 +0000

    use org.apache.sling.commons.testing 2.0.26
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1752413 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 19150f6..706075a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,7 +135,7 @@
         <dependency>
         	<groupId>org.apache.sling</groupId>
         	<artifactId>org.apache.sling.commons.testing</artifactId>
-        	<version>2.0.25-SNAPSHOT</version>
+        	<version>2.0.26</version>
         	<scope>test</scope>
             <exclusions>
                 <!-- slf4j simple implementation logs INFO + higher to stdout (we don't want that behaviour) -->

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

[sling-org-apache-sling-discovery-commons] 04/07: use stable releases (Jackrabbit and Oak)

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.discovery.commons-1.0.14
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 188feccffb4e91725303c357996de98d33ecd036
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Jul 13 13:09:53 2016 +0000

    use stable releases (Jackrabbit and Oak)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1752419 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 706075a..b5b8105 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,6 +41,8 @@
     </scm>
 
     <properties>
+      <jackrabbit.version>2.12.2</jackrabbit.version>
+      <oak.version>1.4.4</oak.version>
         <!-- by default Slow tests are excluded - use -PincludeSlowTests to include them -->
     	<sling.excluded.surefire.groups>org.apache.sling.commons.testing.junit.categories.Slow</sling.excluded.surefire.groups>
     </properties>
@@ -168,13 +170,13 @@
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>oak-core</artifactId>
-            <version>1.3.7</version>
+            <version>${oak.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>oak-jcr</artifactId>
-            <version>1.3.7</version>
+            <version>${oak.version}</version>
             <scope>provided</scope>
         </dependency>
 		<dependency>
@@ -218,13 +220,13 @@
         <dependency>
         	<groupId>org.apache.jackrabbit</groupId>
         	<artifactId>jackrabbit-jcr-commons</artifactId>
-        	<version>2.11.0</version>
+        	<version>${jackrabbit.version}</version>
         	<scope>test</scope>
         </dependency>
         <dependency>
         	<groupId>org.apache.jackrabbit</groupId>
         	<artifactId>jackrabbit-api</artifactId>
-        	<version>2.11.0</version>
+        	<version>${jackrabbit.version}</version>
         	<scope>test</scope>
         </dependency>
 		<dependency>

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