You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2022/08/29 19:33:59 UTC

[sling-org-apache-sling-resource-presence] branch master updated (df4576f -> d278464)

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

olli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-presence.git


    from df4576f  add link, fix typo and improve code example
     new c33d7ed  SLING-11554 Update to Sling Bundle Parent 49
     new 847d629  unify imports (import from org.hamcrest.Matchers)
     new d5b3e7f  close ResourceResolver to avoid stack trace in logs
     new d278464  SLING-11473 Update Testing PaxExam to 4.0.0

The 4 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.


Summary of changes:
 pom.xml                                            | 24 +++++------
 .../apache/sling/resource/presence/ChangeIT.java   | 47 +++++++++++-----------
 .../presence/ResourcePresenterTestSupport.java     |  5 ++-
 .../apache/sling/resource/presence/SimpleIT.java   |  2 +-
 4 files changed, 41 insertions(+), 37 deletions(-)


[sling-org-apache-sling-resource-presence] 01/04: SLING-11554 Update to Sling Bundle Parent 49

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-presence.git

commit c33d7edd548326365910ebbafe5c7b0fbfece6c3
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sun Aug 28 22:22:56 2022 +0200

    SLING-11554 Update to Sling Bundle Parent 49
    
    rearrange version and mandatory scope
---
 pom.xml | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/pom.xml b/pom.xml
index c31c366..9a56f57 100644
--- a/pom.xml
+++ b/pom.xml
@@ -181,27 +181,27 @@
     <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.framework</artifactId>
-      <version>7.0.5</version>
       <scope>test</scope>
+      <version>7.0.5</version>
     </dependency>
     <!-- Apache Sling -->
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.api</artifactId>
-      <version>2.11.0</version>
       <scope>provided</scope>
+      <version>2.11.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.serviceusermapper</artifactId>
-      <version>1.2.4</version>
       <scope>provided</scope>
+      <version>1.2.4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.testing.paxexam</artifactId>
-      <version>4.0.0-SNAPSHOT</version>
       <scope>test</scope>
+      <version>4.0.0-SNAPSHOT</version>
     </dependency>
     <!-- nullability -->
     <dependency>
@@ -224,8 +224,8 @@
     <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest</artifactId>
-      <version>2.2</version>
       <scope>test</scope>
+      <version>2.2</version>
     </dependency>
     <dependency>
       <groupId>org.awaitility</groupId>
@@ -236,32 +236,32 @@
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam</artifactId>
-      <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
+      <version>${org.ops4j.pax.exam.version}</version>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-cm</artifactId>
-      <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
+      <version>${org.ops4j.pax.exam.version}</version>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-container-forked</artifactId>
-      <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
+      <version>${org.ops4j.pax.exam.version}</version>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-junit4</artifactId>
-      <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
+      <version>${org.ops4j.pax.exam.version}</version>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
       <artifactId>pax-exam-link-mvn</artifactId>
-      <version>${org.ops4j.pax.exam.version}</version>
       <scope>test</scope>
+      <version>${org.ops4j.pax.exam.version}</version>
     </dependency>
   </dependencies>
 


[sling-org-apache-sling-resource-presence] 04/04: SLING-11473 Update Testing PaxExam to 4.0.0

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-presence.git

commit d278464bbf64779750cf2d4df85ad3f17895be91
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Aug 29 21:33:42 2022 +0200

    SLING-11473 Update Testing PaxExam to 4.0.0
    
    switch back to Hamcrest 1.3 (SLING-11520)
---
 pom.xml                                                             | 6 +++---
 .../sling/resource/presence/ResourcePresenterTestSupport.java       | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9a56f57..ba1eb7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -222,10 +222,10 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.hamcrest</groupId>
-      <artifactId>hamcrest</artifactId>
+      <groupId>org.apache.servicemix.bundles</groupId>
+      <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
+      <version>1.3_1</version>
       <scope>test</scope>
-      <version>2.2</version>
     </dependency>
     <dependency>
       <groupId>org.awaitility</groupId>
diff --git a/src/test/java/org/apache/sling/resource/presence/ResourcePresenterTestSupport.java b/src/test/java/org/apache/sling/resource/presence/ResourcePresenterTestSupport.java
index f1a9ad8..fb26c77 100644
--- a/src/test/java/org/apache/sling/resource/presence/ResourcePresenterTestSupport.java
+++ b/src/test/java/org/apache/sling/resource/presence/ResourcePresenterTestSupport.java
@@ -24,6 +24,7 @@ import org.ops4j.pax.exam.options.ModifiableCompositeOption;
 
 import static org.apache.sling.testing.paxexam.SlingOptions.slingQuickstartOakTar;
 import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 
 public abstract class ResourcePresenterTestSupport extends TestSupport {
@@ -38,7 +39,9 @@ public abstract class ResourcePresenterTestSupport extends TestSupport {
             testBundle("bundle.filename"),
             factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
                 .put("user.mapping", new String[]{"org.apache.sling.resource.presence=[sling-readall]"})
-                .asOption()
+                .asOption(),
+            // testing
+            mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject()
         );
     }
 


[sling-org-apache-sling-resource-presence] 03/04: close ResourceResolver to avoid stack trace in logs

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-presence.git

commit d5b3e7f40b0319a810cd1f397dd90d8b52f002f5
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sun Aug 28 22:36:15 2022 +0200

    close ResourceResolver to avoid stack trace in logs
---
 .../apache/sling/resource/presence/ChangeIT.java   | 45 +++++++++++-----------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/test/java/org/apache/sling/resource/presence/ChangeIT.java b/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
index 58eff4f..f6fa072 100644
--- a/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
+++ b/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
@@ -80,28 +80,29 @@ public class ChangeIT extends ResourcePresenterTestSupport {
         assertThat(countingServiceListener.unregisteredCount(), is(0));
 
         // create/register
-        final ResourceResolver resourceResolver = resourceResolverFactory.getAdministrativeResourceResolver(null);
-        final Resource root = resourceResolver.getResource("/");
-        final Resource test = resourceResolver.create(root, "test", null);
-        resourceResolver.commit();
-        with().
-            pollInterval(100, MILLISECONDS).
-            then().
-            await().
-            alias("counting register events").
-            atMost(1, SECONDS).
-            until(() -> countingServiceListener.registeredCount() == 1);
-
-        // delete/unregister
-        resourceResolver.delete(test);
-        resourceResolver.commit();
-        with().
-            pollInterval(100, MILLISECONDS).
-            then().
-            await().
-            alias("counting unregister events").
-            atMost(1, SECONDS).
-            until(() -> countingServiceListener.unregisteredCount() == 1);
+        try (ResourceResolver resourceResolver = resourceResolverFactory.getAdministrativeResourceResolver(null)) {
+            final Resource root = resourceResolver.getResource("/");
+            final Resource test = resourceResolver.create(root, "test", null);
+            resourceResolver.commit();
+            with().
+                pollInterval(100, MILLISECONDS).
+                then().
+                await().
+                alias("counting register events").
+                atMost(1, SECONDS).
+                until(() -> countingServiceListener.registeredCount() == 1);
+
+            // delete/unregister
+            resourceResolver.delete(test);
+            resourceResolver.commit();
+            with().
+                pollInterval(100, MILLISECONDS).
+                then().
+                await().
+                alias("counting unregister events").
+                atMost(1, SECONDS).
+                until(() -> countingServiceListener.unregisteredCount() == 1);
+        }
     }
 
     private static class CountingServiceListener implements ServiceListener {


[sling-org-apache-sling-resource-presence] 02/04: unify imports (import from org.hamcrest.Matchers)

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

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resource-presence.git

commit 847d629728ca21a12e447f521d9ae66ceebff681
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sun Aug 28 22:33:54 2022 +0200

    unify imports (import from org.hamcrest.Matchers)
---
 src/test/java/org/apache/sling/resource/presence/ChangeIT.java | 2 +-
 src/test/java/org/apache/sling/resource/presence/SimpleIT.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/sling/resource/presence/ChangeIT.java b/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
index d08f70a..58eff4f 100644
--- a/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
+++ b/src/test/java/org/apache/sling/resource/presence/ChangeIT.java
@@ -40,8 +40,8 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.sling.testing.paxexam.SlingOptions.awaitility;
 import static org.awaitility.Awaitility.with;
-import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
diff --git a/src/test/java/org/apache/sling/resource/presence/SimpleIT.java b/src/test/java/org/apache/sling/resource/presence/SimpleIT.java
index 7bfaa1e..854e998 100644
--- a/src/test/java/org/apache/sling/resource/presence/SimpleIT.java
+++ b/src/test/java/org/apache/sling/resource/presence/SimpleIT.java
@@ -29,8 +29,8 @@ import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 import org.ops4j.pax.exam.util.Filter;
 
-import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;