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 2021/08/12 13:10:16 UTC

[sling-org-apache-sling-event] branch master updated (14a0ffc -> 343c14b)

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-event.git.


    from 14a0ffc  fix typo
     new a3c88d8  SLING-10727 Fix bundle classpath broken by embedded Event API
     new f2bbbd4  SLING-10724 Update to Sling Bundle Parent 44
     new d2e7a1c  SLING-10725 Update Felix Framework to 7.0.1
     new 9e41f01  SLING-10730 Improve configurations of integration tests
     new e55d579  rename integration tests from *Test to *IT and remove obsolete configurations
     new 7857adc  remove obsolete plugin configurations
     new 3a2b006  style
     new 343c14b  remove unused services (injecting JobManager is sufficient)

The 8 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:
 bnd.bnd                                            |   5 +-
 pom.xml                                            |  73 +---
 .../sling/event/it/AbstractJobHandlingIT.java      | 164 +++++++++
 .../sling/event/it/AbstractJobHandlingTest.java    | 369 ---------------------
 ...arallelTest.java => AbstractMaxParallelIT.java} |  22 +-
 .../event/it/{ChaosTest.java => ChaosIT.java}      |  84 +++--
 .../{ClassloadingTest.java => ClassloadingIT.java} |  55 ++-
 .../event/it/{HistoryTest.java => HistoryIT.java}  |  86 +++--
 .../{JobHandlingTest.java => JobHandlingIT.java}   |  75 ++---
 .../org/apache/sling/event/it/JobsTestSupport.java | 108 ++++++
 ...ParallelTest.java => OrderedMaxParallelIT.java} |  49 ++-
 .../{OrderedQueueTest.java => OrderedQueueIT.java} |  64 ++--
 ...allelTest.java => RoundRobinMaxParallelIT.java} |  48 ++-
 ...dRobinQueueTest.java => RoundRobinQueueIT.java} |  61 ++--
 .../it/{SchedulingTest.java => SchedulingIT.java}  |  58 ++--
 .../it/{TimedJobsTest.java => TimedJobsIT.java}    |  38 +--
 ...TopicMatchingTest.java => TopicMatchingIT.java} |  40 +--
 ...orderedQueueTest.java => UnorderedQueueIT.java} |  61 ++--
 18 files changed, 614 insertions(+), 846 deletions(-)
 create mode 100644 src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
 delete mode 100644 src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
 rename src/test/java/org/apache/sling/event/it/{AbstractMaxParallelTest.java => AbstractMaxParallelIT.java} (94%)
 rename src/test/java/org/apache/sling/event/it/{ChaosTest.java => ChaosIT.java} (86%)
 rename src/test/java/org/apache/sling/event/it/{ClassloadingTest.java => ClassloadingIT.java} (87%)
 rename src/test/java/org/apache/sling/event/it/{HistoryTest.java => HistoryIT.java} (55%)
 rename src/test/java/org/apache/sling/event/it/{JobHandlingTest.java => JobHandlingIT.java} (90%)
 create mode 100644 src/test/java/org/apache/sling/event/it/JobsTestSupport.java
 rename src/test/java/org/apache/sling/event/it/{OrderedMaxParallelTest.java => OrderedMaxParallelIT.java} (57%)
 rename src/test/java/org/apache/sling/event/it/{OrderedQueueTest.java => OrderedQueueIT.java} (82%)
 rename src/test/java/org/apache/sling/event/it/{RoundRobinMaxParallelTest.java => RoundRobinMaxParallelIT.java} (59%)
 rename src/test/java/org/apache/sling/event/it/{RoundRobinQueueTest.java => RoundRobinQueueIT.java} (81%)
 rename src/test/java/org/apache/sling/event/it/{SchedulingTest.java => SchedulingIT.java} (68%)
 rename src/test/java/org/apache/sling/event/it/{TimedJobsTest.java => TimedJobsIT.java} (76%)
 rename src/test/java/org/apache/sling/event/it/{TopicMatchingTest.java => TopicMatchingIT.java} (88%)
 rename src/test/java/org/apache/sling/event/it/{UnorderedQueueTest.java => UnorderedQueueIT.java} (81%)

[sling-org-apache-sling-event] 07/08: style

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-event.git

commit 3a2b006503da9596bc54cb422fc24caf19b14273
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 14:57:38 2021 +0200

    style
---
 .../java/org/apache/sling/event/it/AbstractJobHandlingIT.java  | 10 +++++-----
 .../java/org/apache/sling/event/it/AbstractMaxParallelIT.java  |  8 ++++----
 src/test/java/org/apache/sling/event/it/ChaosIT.java           |  8 ++++----
 src/test/java/org/apache/sling/event/it/JobsTestSupport.java   |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
index 37ef291..76d514f 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
@@ -68,7 +68,7 @@ public abstract class AbstractJobHandlingIT extends JobsTestSupport {
             final EventHandler handler) {
         final Dictionary<String, Object> props = new Hashtable<>();
         props.put(EventConstants.EVENT_TOPIC, topic);
-        final ServiceRegistration<EventHandler> reg = this.bc.registerService(EventHandler.class,
+        final ServiceRegistration<EventHandler> reg = this.bundleContext.registerService(EventHandler.class,
                 handler, props);
         this.registrations.add(reg);
         return reg;
@@ -77,7 +77,7 @@ public abstract class AbstractJobHandlingIT extends JobsTestSupport {
     protected long getConsumerChangeCount() {
         long result = -1;
         try {
-            final Collection<ServiceReference<PropertyProvider>> refs = this.bc.getServiceReferences(PropertyProvider.class, "(changeCount=*)");
+            final Collection<ServiceReference<PropertyProvider>> refs = this.bundleContext.getServiceReferences(PropertyProvider.class, "(changeCount=*)");
             log.info("GetConsumerChangeCount refs.size = {}", refs.size());
             if ( !refs.isEmpty() ) {
                 result = refs.stream().mapToLong(r -> (Long) r.getProperty("changeCount")).max().getAsLong();
@@ -117,7 +117,7 @@ public abstract class AbstractJobHandlingIT extends JobsTestSupport {
         long cc = this.getConsumerChangeCount();
         final Dictionary<String, Object> props = new Hashtable<>();
         props.put(JobConsumer.PROPERTY_TOPICS, topic);
-        final ServiceRegistration<JobConsumer> reg = this.bc.registerService(JobConsumer.class,
+        final ServiceRegistration<JobConsumer> reg = this.bundleContext.registerService(JobConsumer.class,
                 handler, props);
         this.registrations.add(reg);
         log.info("registered JobConsumer for topic {} and changecount={}",topic, cc);
@@ -128,7 +128,7 @@ public abstract class AbstractJobHandlingIT extends JobsTestSupport {
 
     protected void registerTopologyListener() {
         final Dictionary<String, Object> props = new Hashtable<>();
-        final ServiceRegistration<TopologyEventListener> reg = this.bc.registerService(TopologyEventListener.class,
+        final ServiceRegistration<TopologyEventListener> reg = this.bundleContext.registerService(TopologyEventListener.class,
                 new TopologyEventListener() {
 
                     @Override
@@ -148,7 +148,7 @@ public abstract class AbstractJobHandlingIT extends JobsTestSupport {
         long cc = this.getConsumerChangeCount();
         final Dictionary<String, Object> props = new Hashtable<>();
         props.put(JobConsumer.PROPERTY_TOPICS, topic);
-        final ServiceRegistration<JobExecutor> reg = this.bc.registerService(JobExecutor.class,
+        final ServiceRegistration<JobExecutor> reg = this.bundleContext.registerService(JobExecutor.class,
                 handler, props);
         this.registrations.add(reg);
         this.waitConsumerChangeCount(cc + 1);
diff --git a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
index b8afedf..d91a1b3 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
@@ -152,7 +152,7 @@ public abstract class AbstractMaxParallelIT extends AbstractJobHandlingIT {
             final AtomicLong finishedThreads, long duration) {
         final List<TopologyView> views = new ArrayList<>();
         // register topology listener
-        final ServiceRegistration<TopologyEventListener> reg = this.bc.registerService(TopologyEventListener.class, new TopologyEventListener() {
+        final ServiceRegistration<TopologyEventListener> reg = this.bundleContext.registerService(TopologyEventListener.class, new TopologyEventListener() {
 
             @Override
             public void handleTopologyEvent(final TopologyEvent event) {
@@ -168,17 +168,17 @@ public abstract class AbstractMaxParallelIT extends AbstractJobHandlingIT {
         final TopologyView view = views.get(0);
 
         try {
-            final Collection<ServiceReference<TopologyEventListener>> refs = this.bc.getServiceReferences(TopologyEventListener.class, null);
+            final Collection<ServiceReference<TopologyEventListener>> refs = this.bundleContext.getServiceReferences(TopologyEventListener.class, null);
             assertNotNull(refs);
             assertFalse(refs.isEmpty());
             TopologyEventListener found = null;
             for(final ServiceReference<TopologyEventListener> ref : refs) {
-                final TopologyEventListener listener = this.bc.getService(ref);
+                final TopologyEventListener listener = this.bundleContext.getService(ref);
                 if ( listener != null && listener.getClass().getName().equals("org.apache.sling.event.impl.jobs.config.TopologyHandler") ) {
                     found = listener;
                     break;
                 }
-                bc.ungetService(ref);
+                bundleContext.ungetService(ref);
             }
             assertNotNull(found);
             final TopologyEventListener tel = found;
diff --git a/src/test/java/org/apache/sling/event/it/ChaosIT.java b/src/test/java/org/apache/sling/event/it/ChaosIT.java
index bdbf656..6f6a410 100644
--- a/src/test/java/org/apache/sling/event/it/ChaosIT.java
+++ b/src/test/java/org/apache/sling/event/it/ChaosIT.java
@@ -231,7 +231,7 @@ public class ChaosIT extends AbstractJobHandlingIT {
             final AtomicLong finishedThreads) {
         final List<TopologyView> views = new ArrayList<>();
         // register topology listener
-        final ServiceRegistration<TopologyEventListener> reg = this.bc.registerService(TopologyEventListener.class, new TopologyEventListener() {
+        final ServiceRegistration<TopologyEventListener> reg = this.bundleContext.registerService(TopologyEventListener.class, new TopologyEventListener() {
 
             @Override
             public void handleTopologyEvent(final TopologyEvent event) {
@@ -247,17 +247,17 @@ public class ChaosIT extends AbstractJobHandlingIT {
         final TopologyView view = views.get(0);
 
         try {
-            final Collection<ServiceReference<TopologyEventListener>> refs = this.bc.getServiceReferences(TopologyEventListener.class, null);
+            final Collection<ServiceReference<TopologyEventListener>> refs = this.bundleContext.getServiceReferences(TopologyEventListener.class, null);
             assertNotNull(refs);
             assertFalse(refs.isEmpty());
             TopologyEventListener found = null;
             for(final ServiceReference<TopologyEventListener> ref : refs) {
-                final TopologyEventListener listener = this.bc.getService(ref);
+                final TopologyEventListener listener = this.bundleContext.getService(ref);
                 if ( listener != null && listener.getClass().getName().equals("org.apache.sling.event.impl.jobs.config.TopologyHandler") ) {
                     found = listener;
                     break;
                 }
-                bc.ungetService(ref);
+                bundleContext.ungetService(ref);
             }
             assertNotNull(found);
             final TopologyEventListener tel = found;
diff --git a/src/test/java/org/apache/sling/event/it/JobsTestSupport.java b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
index 5414d64..9edff88 100644
--- a/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
+++ b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
@@ -54,7 +54,7 @@ public abstract class JobsTestSupport extends TestSupport {
     protected ConfigurationAdmin configAdmin;
 
     @Inject
-    protected BundleContext bc;
+    protected BundleContext bundleContext;
 
     @Inject
     protected JobManager jobManager;

[sling-org-apache-sling-event] 01/08: SLING-10727 Fix bundle classpath broken by embedded Event API

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-event.git

commit a3c88d8604c379ff8041e9a543b7aca5ab1ab871
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 12:26:42 2021 +0200

    SLING-10727 Fix bundle classpath broken by embedded Event API
---
 bnd.bnd | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bnd.bnd b/bnd.bnd
index e8d1911..ac4acba 100644
--- a/bnd.bnd
+++ b/bnd.bnd
@@ -17,8 +17,9 @@ Export-Package: \
     org.apache.jackrabbit.util,\
     org.apache.sling.commons.osgi,\
     org.apache.sling.event.api
--includeresource: \
-    org.apache.sling.event.api-1.0.0.jar/=org.apache.sling.event.api-[0-9.]*.jar;lib:=true,\
+
+-includeresource:\
+    org.apache.sling.event.api-1.0.0.jar=org.apache.sling.event.api-1.0.0.jar;lib:=true,\
     @quartz-[0-9.]*.jar!/org/quartz/CronExpression.class,\
     @quartz-[0-9.]*.jar!/org/quartz/ValueSet.class,\
     @org.apache.sling.commons.osgi-[0-9.]*.jar!/org/apache/sling/commons/osgi/PropertiesUtil.class,\

[sling-org-apache-sling-event] 05/08: rename integration tests from *Test to *IT and remove obsolete configurations

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-event.git

commit e55d5792956b207b42ffd919405ba97747112a2e
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 14:52:34 2021 +0200

    rename integration tests from *Test to *IT and remove obsolete configurations
---
 pom.xml                                                           | 8 --------
 .../{AbstractJobHandlingTest.java => AbstractJobHandlingIT.java}  | 2 +-
 .../{AbstractMaxParallelTest.java => AbstractMaxParallelIT.java}  | 2 +-
 .../org/apache/sling/event/it/{ChaosTest.java => ChaosIT.java}    | 2 +-
 .../sling/event/it/{ClassloadingTest.java => ClassloadingIT.java} | 2 +-
 .../apache/sling/event/it/{HistoryTest.java => HistoryIT.java}    | 2 +-
 .../sling/event/it/{JobHandlingTest.java => JobHandlingIT.java}   | 2 +-
 .../it/{OrderedMaxParallelTest.java => OrderedMaxParallelIT.java} | 2 +-
 .../sling/event/it/{OrderedQueueTest.java => OrderedQueueIT.java} | 2 +-
 ...oundRobinMaxParallelTest.java => RoundRobinMaxParallelIT.java} | 2 +-
 .../event/it/{RoundRobinQueueTest.java => RoundRobinQueueIT.java} | 2 +-
 .../sling/event/it/{SchedulingTest.java => SchedulingIT.java}     | 2 +-
 .../sling/event/it/{TimedJobsTest.java => TimedJobsIT.java}       | 2 +-
 .../event/it/{TopicMatchingTest.java => TopicMatchingIT.java}     | 2 +-
 .../event/it/{UnorderedQueueTest.java => UnorderedQueueIT.java}   | 2 +-
 15 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/pom.xml b/pom.xml
index 177f82a..2b94da1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,11 +67,6 @@
             <!-- plain unit tests -->
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>**/it/**</exclude>
-                    </excludes>
-                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
@@ -110,9 +105,6 @@
                     <systemPropertyVariables combine.children="append">
                         <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
                     </systemPropertyVariables>
-                    <includes>
-                        <include>**/it/*</include>
-                    </includes>
                 </configuration>
             </plugin>
             <plugin>
diff --git a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
similarity index 98%
rename from src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
rename to src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
index 8eb6572..37ef291 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingIT.java
@@ -38,7 +38,7 @@ import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.EventConstants;
 import org.osgi.service.event.EventHandler;
 
-public abstract class AbstractJobHandlingTest extends JobsTestSupport {
+public abstract class AbstractJobHandlingIT extends JobsTestSupport {
 
     protected static final int DEFAULT_TEST_TIMEOUT = 1000*60*5;
 
diff --git a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java
rename to src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
index 407fc80..b8afedf 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelIT.java
@@ -49,7 +49,7 @@ import org.osgi.service.event.EventHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractMaxParallelTest extends AbstractJobHandlingTest {
+public abstract class AbstractMaxParallelIT extends AbstractJobHandlingIT {
 
     private static final int BACKGROUND_LOAD_DELAY_SECONDS = 1;
 
diff --git a/src/test/java/org/apache/sling/event/it/ChaosTest.java b/src/test/java/org/apache/sling/event/it/ChaosIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/ChaosTest.java
rename to src/test/java/org/apache/sling/event/it/ChaosIT.java
index ae8c245..bdbf656 100644
--- a/src/test/java/org/apache/sling/event/it/ChaosTest.java
+++ b/src/test/java/org/apache/sling/event/it/ChaosIT.java
@@ -59,7 +59,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class ChaosTest extends AbstractJobHandlingTest {
+public class ChaosIT extends AbstractJobHandlingIT {
 
     /** Duration for firing jobs in seconds. */
     private static final long DURATION = 1 * 60;
diff --git a/src/test/java/org/apache/sling/event/it/ClassloadingTest.java b/src/test/java/org/apache/sling/event/it/ClassloadingIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/ClassloadingTest.java
rename to src/test/java/org/apache/sling/event/it/ClassloadingIT.java
index d03ed6c..2214ab3 100644
--- a/src/test/java/org/apache/sling/event/it/ClassloadingTest.java
+++ b/src/test/java/org/apache/sling/event/it/ClassloadingIT.java
@@ -53,7 +53,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class ClassloadingTest extends AbstractJobHandlingTest {
+public class ClassloadingIT extends AbstractJobHandlingIT {
 
     private static final int CONDITION_INTERVAL_MILLIS = 50;
     private static final int CONDITION_TIMEOUT_SECONDS = 5;
diff --git a/src/test/java/org/apache/sling/event/it/HistoryTest.java b/src/test/java/org/apache/sling/event/it/HistoryIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/HistoryTest.java
rename to src/test/java/org/apache/sling/event/it/HistoryIT.java
index 37f0038..5c1895c 100644
--- a/src/test/java/org/apache/sling/event/it/HistoryTest.java
+++ b/src/test/java/org/apache/sling/event/it/HistoryIT.java
@@ -44,7 +44,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class HistoryTest extends AbstractJobHandlingTest {
+public class HistoryIT extends AbstractJobHandlingIT {
 
     private static final String TOPIC = "sling/test/history";
 
diff --git a/src/test/java/org/apache/sling/event/it/JobHandlingTest.java b/src/test/java/org/apache/sling/event/it/JobHandlingIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/JobHandlingTest.java
rename to src/test/java/org/apache/sling/event/it/JobHandlingIT.java
index dea7c32..99a6bc4 100644
--- a/src/test/java/org/apache/sling/event/it/JobHandlingTest.java
+++ b/src/test/java/org/apache/sling/event/it/JobHandlingIT.java
@@ -56,7 +56,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class JobHandlingTest extends AbstractJobHandlingTest {
+public class JobHandlingIT extends AbstractJobHandlingIT {
 
     public static final String TOPIC = "sling/test";
 
diff --git a/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/OrderedMaxParallelIT.java
similarity index 97%
rename from src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java
rename to src/test/java/org/apache/sling/event/it/OrderedMaxParallelIT.java
index 958f891..a861804 100644
--- a/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/OrderedMaxParallelIT.java
@@ -34,7 +34,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class OrderedMaxParallelTest extends AbstractMaxParallelTest {
+public class OrderedMaxParallelIT extends AbstractMaxParallelIT {
 
     private static final int DURATION = 40;
 
diff --git a/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java b/src/test/java/org/apache/sling/event/it/OrderedQueueIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/OrderedQueueTest.java
rename to src/test/java/org/apache/sling/event/it/OrderedQueueIT.java
index 5f7a18a..13222a6 100644
--- a/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/OrderedQueueIT.java
@@ -48,7 +48,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class OrderedQueueTest extends AbstractJobHandlingTest {
+public class OrderedQueueIT extends AbstractJobHandlingIT {
 
     @Configuration
     public Option[] configuration() {
diff --git a/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelIT.java
similarity index 97%
rename from src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java
rename to src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelIT.java
index b1b6494..2f731f4 100644
--- a/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelIT.java
@@ -34,7 +34,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class RoundRobinMaxParallelTest extends AbstractMaxParallelTest {
+public class RoundRobinMaxParallelIT extends AbstractMaxParallelIT {
 
     private static final int MAX_PARALLEL = 3;
 
diff --git a/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java b/src/test/java/org/apache/sling/event/it/RoundRobinQueueIT.java
similarity index 98%
rename from src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java
rename to src/test/java/org/apache/sling/event/it/RoundRobinQueueIT.java
index 36ab986..2aa95ea 100644
--- a/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/RoundRobinQueueIT.java
@@ -49,7 +49,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class RoundRobinQueueTest extends AbstractJobHandlingTest {
+public class RoundRobinQueueIT extends AbstractJobHandlingIT {
 
     private static final String QUEUE_NAME = "roundrobintest";
     private static final String TOPIC = "sling/roundrobintest";
diff --git a/src/test/java/org/apache/sling/event/it/SchedulingTest.java b/src/test/java/org/apache/sling/event/it/SchedulingIT.java
similarity index 98%
rename from src/test/java/org/apache/sling/event/it/SchedulingTest.java
rename to src/test/java/org/apache/sling/event/it/SchedulingIT.java
index d0156f1..c13b57b 100644
--- a/src/test/java/org/apache/sling/event/it/SchedulingTest.java
+++ b/src/test/java/org/apache/sling/event/it/SchedulingIT.java
@@ -41,7 +41,7 @@ import static org.ops4j.pax.exam.CoreOptions.options;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class SchedulingTest extends AbstractJobHandlingTest {
+public class SchedulingIT extends AbstractJobHandlingIT {
 
     private static final String TOPIC = "job/scheduled/topic";
 
diff --git a/src/test/java/org/apache/sling/event/it/TimedJobsTest.java b/src/test/java/org/apache/sling/event/it/TimedJobsIT.java
similarity index 97%
rename from src/test/java/org/apache/sling/event/it/TimedJobsTest.java
rename to src/test/java/org/apache/sling/event/it/TimedJobsIT.java
index 2d937d5..c3fa36f 100644
--- a/src/test/java/org/apache/sling/event/it/TimedJobsTest.java
+++ b/src/test/java/org/apache/sling/event/it/TimedJobsIT.java
@@ -38,7 +38,7 @@ import static org.ops4j.pax.exam.CoreOptions.options;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class TimedJobsTest extends AbstractJobHandlingTest {
+public class TimedJobsIT extends AbstractJobHandlingIT {
 
     private static final String TOPIC = "timed/test/topic";
 
diff --git a/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java b/src/test/java/org/apache/sling/event/it/TopicMatchingIT.java
similarity index 98%
rename from src/test/java/org/apache/sling/event/it/TopicMatchingTest.java
rename to src/test/java/org/apache/sling/event/it/TopicMatchingIT.java
index 0a6ac5b..35d4266 100644
--- a/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java
+++ b/src/test/java/org/apache/sling/event/it/TopicMatchingIT.java
@@ -39,7 +39,7 @@ import static org.ops4j.pax.exam.CoreOptions.options;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class TopicMatchingTest extends AbstractJobHandlingTest {
+public class TopicMatchingIT extends AbstractJobHandlingIT {
 
     public static final String TOPIC = "sling/test/a";
 
diff --git a/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java b/src/test/java/org/apache/sling/event/it/UnorderedQueueIT.java
similarity index 99%
rename from src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java
rename to src/test/java/org/apache/sling/event/it/UnorderedQueueIT.java
index 7a8104a..11f5c12 100644
--- a/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/UnorderedQueueIT.java
@@ -49,7 +49,7 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfigurati
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
-public class UnorderedQueueTest extends AbstractJobHandlingTest {
+public class UnorderedQueueIT extends AbstractJobHandlingIT {
 
     private static final String QUEUE_NAME = "unorderedtestqueue";
     private static final String TOPIC = "sling/unorderedtest";

[sling-org-apache-sling-event] 04/08: SLING-10730 Improve configurations of integration tests

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-event.git

commit 9e41f01647914e931d78fabe667b7bd626ebb0aa
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 14:28:24 2021 +0200

    SLING-10730 Improve configurations of integration tests
    
    * Use factoryConfiguration from Pax Exam instead of ConfigurationAdmin
    * Drop useless cleanup
    * Use slingEvent option
    * Use injected JobManager
    * Extract base configuration into new JobsTestSupport
---
 pom.xml                                            |  28 ++-
 .../sling/event/it/AbstractJobHandlingTest.java    | 211 +--------------------
 .../sling/event/it/AbstractMaxParallelTest.java    |  12 +-
 .../java/org/apache/sling/event/it/ChaosTest.java  |  74 ++++----
 .../apache/sling/event/it/ClassloadingTest.java    |  53 +++---
 .../org/apache/sling/event/it/HistoryTest.java     |  84 ++++----
 .../org/apache/sling/event/it/JobHandlingTest.java |  73 +++----
 .../org/apache/sling/event/it/JobsTestSupport.java | 116 +++++++++++
 .../sling/event/it/OrderedMaxParallelTest.java     |  47 +++--
 .../apache/sling/event/it/OrderedQueueTest.java    |  60 +++---
 .../sling/event/it/RoundRobinMaxParallelTest.java  |  46 +++--
 .../apache/sling/event/it/RoundRobinQueueTest.java |  59 +++---
 .../org/apache/sling/event/it/SchedulingTest.java  |  56 +++---
 .../org/apache/sling/event/it/TimedJobsTest.java   |  36 ++--
 .../apache/sling/event/it/TopicMatchingTest.java   |  38 ++--
 .../apache/sling/event/it/UnorderedQueueTest.java  |  59 +++---
 16 files changed, 431 insertions(+), 621 deletions(-)

diff --git a/pom.xml b/pom.xml
index 166d260..177f82a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,6 +95,7 @@
             </plugin>
             <!-- integration tests run with pax-exam -->
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>
                 <executions>
                     <execution>
@@ -105,23 +106,10 @@
                     </execution>
                 </executions>
                 <configuration>
-                    <systemProperties>
-                        <property>
-                            <name>bundle.filename</name>
-                            <value>${basedir}/target/${project.build.finalName}.jar</value>
-                        </property>
-                        <property>
-                            <name>org.ops4j.pax.url.mvn.useFallbackRepositories</name>
-                            <value>false</value>
-                        </property>
-                        <property>
-                            <name>org.ops4j.pax.url.mvn.repositories</name>
-                            <value>https://repo1.maven.org/maven2@id=central</value>
-                        </property>
-                    </systemProperties>
-                    <argLine>
-                        -Xmx2048m -XX:MaxPermSize=512m
-                    </argLine>
+                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
+                    <systemPropertyVariables combine.children="append">
+                        <bundle.filename>${basedir}/target/${project.build.finalName}.jar</bundle.filename>
+                    </systemPropertyVariables>
                     <includes>
                         <include>**/it/*</include>
                     </includes>
@@ -281,6 +269,12 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.json</artifactId>
+            <version>2.0.20</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.sling-mock</artifactId>
             <version>2.2.6</version>
             <scope>test</scope>
diff --git a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
index 47931c6..8eb6572 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
@@ -18,20 +18,6 @@
  */
 package org.apache.sling.event.it;
 
-
-import static org.apache.sling.testing.paxexam.SlingOptions.backing;
-import static org.apache.sling.testing.paxexam.SlingOptions.paxTinybundles;
-import static org.apache.sling.testing.paxexam.SlingOptions.spyfly;
-import static org.ops4j.pax.exam.CoreOptions.composite;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.keepCaches;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.repository;
-import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
-import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
-
-import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -40,148 +26,24 @@ import java.util.Hashtable;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
 
-import javax.inject.Inject;
-
-import org.apache.sling.api.resource.LoginException;
-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.ResourceResolverFactory;
 import org.apache.sling.discovery.PropertyProvider;
 import org.apache.sling.discovery.TopologyEvent;
 import org.apache.sling.discovery.TopologyEventListener;
-import org.apache.sling.event.impl.jobs.config.JobManagerConfiguration;
-import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
-import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.testing.paxexam.SlingOptions;
-import org.apache.sling.testing.paxexam.SlingVersionResolver;
-import org.apache.sling.testing.paxexam.TestSupport;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.options.ModifiableCompositeOption;
-import org.osgi.framework.BundleContext;
+import org.junit.Before;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cm.ConfigurationAdmin;
-import org.osgi.service.event.EventAdmin;
 import org.osgi.service.event.EventConstants;
 import org.osgi.service.event.EventHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractJobHandlingTest extends TestSupport {
 
-    private final Logger log = LoggerFactory.getLogger(this.getClass());
-
-	private static final String PROPERTY_BUNDLE_FILENAME = "bundle.filename";
+public abstract class AbstractJobHandlingTest extends JobsTestSupport {
 
     protected static final int DEFAULT_TEST_TIMEOUT = 1000*60*5;
 
-    @Inject
-    protected EventAdmin eventAdmin;
-
-    @Inject
-    protected ConfigurationAdmin configAdmin;
-
-    @Inject
-    protected BundleContext bc;
-
-    @Inject // just to block the dependencies
-    protected SlingRepository repo;
-
     protected List<ServiceRegistration<?>> registrations = new ArrayList<>();
 
-    public static SlingVersionResolver versionResolver = new SlingVersionResolver();
-
-    @Configuration
-    public Option[] config() {
-
-        final String workingDirectory = workingDirectory(); // from TestSupport
-        final int httpPort = findFreePort(); // from TestSupport
-
-        final String bundleFileName = System.getProperty(PROPERTY_BUNDLE_FILENAME );
-        final File bundleFile = new File( bundleFileName );
-        if ( !bundleFile.canRead() ) {
-            throw new IllegalArgumentException( "Cannot read from bundle file " + bundleFileName + " specified in the "
-                + PROPERTY_BUNDLE_FILENAME + " system property" );
-        }
-
-        return options(
-                newConfiguration("org.apache.sling.event.impl.jobs.jcr.PersistenceHandler")
-                    .put(JobManagerConfiguration.PROPERTY_BACKGROUND_LOAD_DELAY, backgroundLoadDelay())
-                    .put("startup.delay", 1L)
-                    .asOption(),
-                baseConfiguration(),
-                SlingOptions.slingQuickstartOakTar(workingDirectory, httpPort),
-                SlingOptions.logback(), testBundle(PROPERTY_BUNDLE_FILENAME), // this bundle
-                SlingOptions.slingDiscovery(),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.event.dea").version(versionResolver),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.inventory").version(versionResolver),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.serviceusermapper").version("1.5.2"),
-                factoryConfiguration("org.apache.sling.jcr.repoinit.RepositoryInitializer")
-                    .put("scripts", new String[]{"create service user sling-event\n\n  create path (sling:Folder) /var/eventing\n\n  set ACL for sling-event\n\n    allow   jcr:all     on /var/eventing\n\n  end"})
-                    .asOption(),
-                factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
-                    .put("user.mapping", new String[]{"org.apache.sling.event=[sling-event]", "org.apache.sling.event.dea=[sling-event]"})
-                    .asOption(),
-                newConfiguration("org.apache.sling.commons.scheduler.impl.QuartzScheduler")
-                    .put("allowedPoolNames",new String[] {"oak"})
-                    .asOption(),
-                // this test code uses loginAdministrative!
-                newConfiguration("org.apache.sling.jcr.base.internal.LoginAdminWhitelist")
-                    .put("whitelist.bundles.regexp", "PAXEXAM-PROBE-.*")
-                    .asOption(),
-                // otherwise we get ignored events
-                newConfiguration("org.apache.felix.eventadmin.impl.EventAdmin")
-                        .put("org.apache.felix.eventadmin.IgnoreTimeout", "*")
-                        .asOption(),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.tools").version("1.0.14"),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.json").version("2.0.20"),
-                junitBundles()
-           );
-    }
-
-    long backgroundLoadDelay() {
-        return 3L;
-    }
-
-    protected ModifiableCompositeOption baseConfiguration() {
-        return composite(
-            failOnUnresolvedBundles(),
-            keepCaches(),
-            localMavenRepo(),
-            repository("https://repo1.maven.org/maven2/").id("apache-snapshots").allowSnapshots(),
-            CoreOptions.workingDirectory(workingDirectory()),
-            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.paxexam").versionAsInProject(),
-            paxTinybundles(),
-            backing(),
-            spyfly()
-        );
-    }
-
-    protected JobManager getJobManager() {
-        JobManager result = null;
-        int count = 0;
-        do {
-            final ServiceReference<JobManager> sr = this.bc.getServiceReference(JobManager.class);
-            if ( sr != null ) {
-                result = this.bc.getService(sr);
-            } else {
-                count++;
-                if ( count == 10 ) {
-                    break;
-                }
-                sleep(500);
-            }
-
-        } while ( result == null );
-        return result;
-    }
-
     protected void sleep(final long time) {
         try {
             Thread.sleep(time);
@@ -191,81 +53,14 @@ public abstract class AbstractJobHandlingTest extends TestSupport {
         }
     }
 
+    @Before
     public void setup() throws IOException {
         log.info("starting setup");
         registerTopologyListener();
     }
 
-    private int deleteCount;
-
     protected AtomicReference<TopologyEvent> lastTopologyEvent = new AtomicReference<>();
 
-    private void delete(final Resource rsrc )
-    throws PersistenceException {
-        final ResourceResolver resolver = rsrc.getResourceResolver();
-        for(final Resource child : rsrc.getChildren()) {
-            delete(child);
-        }
-        resolver.delete(rsrc);
-        deleteCount++;
-        if ( deleteCount >= 20 ) {
-            resolver.commit();
-            deleteCount = 0;
-        }
-    }
-
-    public void cleanup() {
-        log.info("starting cleanup");
-        // clean job area
-        final ServiceReference<ResourceResolverFactory> ref = this.bc.getServiceReference(ResourceResolverFactory.class);
-        final ResourceResolverFactory factory = this.bc.getService(ref);
-        ResourceResolver resolver = null;
-        try {
-            resolver = factory.getAdministrativeResourceResolver(null);
-            final Resource rsrc = resolver.getResource("/var/eventing");
-            if ( rsrc != null ) {
-                delete(rsrc);
-                resolver.commit();
-            }
-        } catch ( final LoginException le ) {
-            // ignore
-        } catch (final PersistenceException e) {
-            // ignore
-        } catch ( final Exception e ) {
-            // sometimes an NPE is thrown from the repository, as we
-            // are in the cleanup, we can ignore this
-        } finally {
-            if ( resolver != null ) {
-                resolver.close();
-            }
-        }
-        // unregister all services
-        for(final ServiceRegistration<?> reg : this.registrations) {
-            reg.unregister();
-        }
-        this.registrations.clear();
-
-        // remove all configurations
-        try {
-            final org.osgi.service.cm.Configuration[] cfgs = this.configAdmin.listConfigurations(null);
-            if ( cfgs != null ) {
-                for(final org.osgi.service.cm.Configuration c : cfgs) {
-                    try {
-                        c.delete();
-                    } catch (final IOException io) {
-                        // ignore
-                    }
-                }
-            }
-        } catch (final IOException io) {
-            // ignore
-        } catch (final InvalidSyntaxException e) {
-            // ignore
-        }
-        this.sleep(1000);
-        log.info("cleanup completed");
-    }
-
     /**
      * Helper method to register an event handler
      */
diff --git a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java
index cf3ec2f..407fc80 100644
--- a/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/AbstractMaxParallelTest.java
@@ -41,7 +41,6 @@ import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
@@ -52,8 +51,6 @@ import org.slf4j.LoggerFactory;
 
 public abstract class AbstractMaxParallelTest extends AbstractJobHandlingTest {
 
-    private final Logger log = LoggerFactory.getLogger(this.getClass());
-
     private static final int BACKGROUND_LOAD_DELAY_SECONDS = 1;
 
     private static final int EXTRA_CHAOS_DURATION_SECONDS = 20;
@@ -71,16 +68,10 @@ public abstract class AbstractMaxParallelTest extends AbstractJobHandlingTest {
     protected int max = -1;
 
     @Override
-    long backgroundLoadDelay() {
+    protected long backgroundLoadDelay() {
         return BACKGROUND_LOAD_DELAY_SECONDS;
     }
 
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
-    }
-
     private void registerMax(int cnt) {
         synchronized(syncObj) {
             max = Math.max(max, cnt);
@@ -231,7 +222,6 @@ public abstract class AbstractMaxParallelTest extends AbstractJobHandlingTest {
     }
 
     void doTestMaxParallel(int numJobs, long jobRunMillis, long duration) throws Exception {
-        final JobManager jobManager = this.getJobManager();
 
         final Map<String, AtomicLong> added = new HashMap<>();
         final Map<String, AtomicLong> created = new HashMap<>();
diff --git a/src/test/java/org/apache/sling/event/it/ChaosTest.java b/src/test/java/org/apache/sling/event/it/ChaosTest.java
index 1538593..ae8c245 100644
--- a/src/test/java/org/apache/sling/event/it/ChaosTest.java
+++ b/src/test/java/org/apache/sling/event/it/ChaosTest.java
@@ -18,16 +18,10 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -45,18 +39,26 @@ import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class ChaosTest extends AbstractJobHandlingTest {
 
     /** Duration for firing jobs in seconds. */
@@ -90,39 +92,28 @@ public class ChaosTest extends AbstractJobHandlingTest {
         }
     }
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create ordered test queue
-        final org.osgi.service.cm.Configuration orderedConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> orderedProps = new Hashtable<>();
-        orderedProps.put(ConfigurationConstants.PROP_NAME, "chaos-ordered");
-        orderedProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name());
-        orderedProps.put(ConfigurationConstants.PROP_TOPICS, ORDERED_TOPICS);
-        orderedProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        orderedProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        orderedConfig.update(orderedProps);
-
-        // create round robin test queue
-        final org.osgi.service.cm.Configuration rrConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> rrProps = new Hashtable<>();
-        rrProps.put(ConfigurationConstants.PROP_NAME, "chaos-roundrobin");
-        rrProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name());
-        rrProps.put(ConfigurationConstants.PROP_TOPICS, ROUND_TOPICS);
-        rrProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        rrProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        rrProps.put(ConfigurationConstants.PROP_MAX_PARALLEL, 5);
-        rrConfig.update(rrProps);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create ordered test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "chaos-ordered")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, ORDERED_TOPICS)
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .asOption(),
+            // create round robin test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "chaos-roundrobin")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name())
+                .put(ConfigurationConstants.PROP_TOPICS, ROUND_TOPICS)
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .put(ConfigurationConstants.PROP_MAX_PARALLEL, 5)
+                .asOption()
+        );
     }
 
     /**
@@ -307,7 +298,6 @@ public class ChaosTest extends AbstractJobHandlingTest {
 
     @Test(timeout=DURATION * 16000L)
     public void testDoChaos() throws Exception {
-        final JobManager jobManager = this.getJobManager();
 
         // setup added, created and finished map
         // added and finished are filled by notifications
diff --git a/src/test/java/org/apache/sling/event/it/ClassloadingTest.java b/src/test/java/org/apache/sling/event/it/ClassloadingTest.java
index b182401..d03ed6c 100644
--- a/src/test/java/org/apache/sling/event/it/ClassloadingTest.java
+++ b/src/test/java/org/apache/sling/event/it/ClassloadingTest.java
@@ -18,17 +18,10 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Dictionary;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -42,15 +35,24 @@ import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.apache.sling.testing.tools.retry.RetryLoop;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class ClassloadingTest extends AbstractJobHandlingTest {
 
     private static final int CONDITION_INTERVAL_MILLIS = 50;
@@ -59,26 +61,17 @@ public class ClassloadingTest extends AbstractJobHandlingTest {
     private static final String QUEUE_NAME = "cltest";
     private static final String TOPIC = "sling/cltest";
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create ignore test queue
-        final org.osgi.service.cm.Configuration orderedConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> orderedProps = new Hashtable<String, Object>();
-        orderedProps.put(ConfigurationConstants.PROP_NAME, QUEUE_NAME);
-        orderedProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name());
-        orderedProps.put(ConfigurationConstants.PROP_TOPICS, TOPIC);
-        orderedConfig.update(orderedProps);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create ignore test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, QUEUE_NAME)
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, TOPIC)
+                .asOption()
+        );
     }
 
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
@@ -103,7 +96,6 @@ public class ClassloadingTest extends AbstractJobHandlingTest {
                         latch.countDown();
                     }
                 });
-        final JobManager jobManager = this.getJobManager();
 
         final List<String> list = new ArrayList<String>();
         list.add("1");
@@ -160,7 +152,6 @@ public class ClassloadingTest extends AbstractJobHandlingTest {
                         finishedEvents.add(event);
                     }
                 });
-        final JobManager jobManager = this.getJobManager();
 
         // dao is an invisible class for the dynamic class loader as it is not public
         // therefore scheduling this job should fail!
diff --git a/src/test/java/org/apache/sling/event/it/HistoryTest.java b/src/test/java/org/apache/sling/event/it/HistoryTest.java
index d797f35..37f0038 100644
--- a/src/test/java/org/apache/sling/event/it/HistoryTest.java
+++ b/src/test/java/org/apache/sling/event/it/HistoryTest.java
@@ -18,15 +18,8 @@
  */
 package org.apache.sling.event.it;
 
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
 import java.util.Collection;
-import java.util.Dictionary;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Map;
 
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
@@ -36,49 +29,48 @@ import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobExecutionContext;
 import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class HistoryTest extends AbstractJobHandlingTest {
 
     private static final String TOPIC = "sling/test/history";
 
     private static final String PROP_COUNTER = "counter";
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create test queue - we use an ordered queue to have a stable processing order
-        // keep the jobs in the history
-        final org.osgi.service.cm.Configuration config = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        Dictionary<String, Object> props = new Hashtable<String, Object>();
-        props.put(ConfigurationConstants.PROP_NAME, "test");
-        props.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name());
-        props.put(ConfigurationConstants.PROP_TOPICS, new String[] {TOPIC});
-        props.put(ConfigurationConstants.PROP_RETRIES, 2);
-        props.put(ConfigurationConstants.PROP_RETRY_DELAY, 2L);
-        props.put(ConfigurationConstants.PROP_KEEP_JOBS, true);
-        config.update(props);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create test queue - we use an ordered queue to have a stable processing order
+            // keep the jobs in the history
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "test")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, new String[]{TOPIC})
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2L)
+                .put(ConfigurationConstants.PROP_KEEP_JOBS, true)
+                .asOption()
+        );
     }
 
     private Job addJob(final long counter) {
         final Map<String, Object> props = new HashMap<String, Object>();
         props.put(PROP_COUNTER, counter);
-        return this.getJobManager().addJob(TOPIC, props );
+        return jobManager.addJob(TOPIC, props );
     }
 
     /**
@@ -105,23 +97,23 @@ public class HistoryTest extends AbstractJobHandlingTest {
             this.addJob(i);
         }
         this.sleep(200L);
-        while ( this.getJobManager().findJobs(JobManager.QueryType.HISTORY, TOPIC, -1, (Map<String, Object>[])null).size() < 10 ) {
+        while (jobManager.findJobs(JobManager.QueryType.HISTORY, TOPIC, -1, (Map<String, Object>[])null).size() < 10 ) {
             this.sleep(20L);
         }
-        Collection<Job> col = this.getJobManager().findJobs(JobManager.QueryType.HISTORY, TOPIC, -1, (Map<String, Object>[])null);
+        Collection<Job> col = jobManager.findJobs(JobManager.QueryType.HISTORY, TOPIC, -1, (Map<String, Object>[])null);
         assertEquals(10, col.size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.ACTIVE, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.QUEUED, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.ALL, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(3, this.getJobManager().findJobs(JobManager.QueryType.CANCELLED, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.DROPPED, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(3, this.getJobManager().findJobs(JobManager.QueryType.ERROR, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.GIVEN_UP, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(0, this.getJobManager().findJobs(JobManager.QueryType.STOPPED, TOPIC, -1, (Map<String, Object>[])null).size());
-        assertEquals(7, this.getJobManager().findJobs(JobManager.QueryType.SUCCEEDED, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.ACTIVE, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.QUEUED, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.ALL, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(3, jobManager.findJobs(JobManager.QueryType.CANCELLED, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.DROPPED, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(3, jobManager.findJobs(JobManager.QueryType.ERROR, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.GIVEN_UP, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(0, jobManager.findJobs(JobManager.QueryType.STOPPED, TOPIC, -1, (Map<String, Object>[])null).size());
+        assertEquals(7, jobManager.findJobs(JobManager.QueryType.SUCCEEDED, TOPIC, -1, (Map<String, Object>[])null).size());
 
         // find all topics
-        assertEquals(7, this.getJobManager().findJobs(JobManager.QueryType.SUCCEEDED, null, -1, (Map<String, Object>[])null).size());
+        assertEquals(7, jobManager.findJobs(JobManager.QueryType.SUCCEEDED, null, -1, (Map<String, Object>[])null).size());
 
         // verify order, message and state
         long last = 9;
diff --git a/src/test/java/org/apache/sling/event/it/JobHandlingTest.java b/src/test/java/org/apache/sling/event/it/JobHandlingTest.java
index d69d036..dea7c32 100644
--- a/src/test/java/org/apache/sling/event/it/JobHandlingTest.java
+++ b/src/test/java/org/apache/sling/event/it/JobHandlingTest.java
@@ -18,18 +18,9 @@
  */
 package org.apache.sling.event.it;
 
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -44,45 +35,46 @@ import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.apache.sling.event.jobs.consumer.JobExecutionContext;
 import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class JobHandlingTest extends AbstractJobHandlingTest {
 
     public static final String TOPIC = "sling/test";
 
     private final Logger log = LoggerFactory.getLogger(this.getClass());
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create test queue
-        final org.osgi.service.cm.Configuration config = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        Dictionary<String, Object> props = new Hashtable<String, Object>();
-        props.put(ConfigurationConstants.PROP_NAME, "test");
-        props.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name());
-        props.put(ConfigurationConstants.PROP_TOPICS, new String[] {TOPIC, TOPIC + "2"});
-        props.put(ConfigurationConstants.PROP_RETRIES, 2);
-        props.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        config.update(props);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "test")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, new String[]{TOPIC, TOPIC + "2"})
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .asOption()
+        );
     }
 
     /**
@@ -103,7 +95,7 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
                     }
                  });
 
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         assertTrue("No event received in the given time.", cb.block(5));
         cb.reset();
         assertFalse("Unexpected event received in the given time.", cb.block(5));
@@ -127,7 +119,7 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
                     }
                 });
 
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         assertTrue("No event received in the given time.", cb.block(5));
         cb.reset();
         assertFalse("Unexpected event received in the given time.", cb.block(5));
@@ -156,13 +148,13 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
         // we start "some" jobs
         final int COUNT = 300;
         for(int i = 0; i < COUNT; i++ ) {
-            this.getJobManager().addJob(TOPIC, null);
+            jobManager.addJob(TOPIC, null);
         }
         while ( count.get() < COUNT ) {
             this.sleep(50);
         }
         assertEquals("Finished count", COUNT, count.get());
-        assertEquals("Finished count", COUNT, this.getJobManager().getStatistics().getNumberOfFinishedJobs());
+        assertEquals("Finished count", COUNT, jobManager.getStatistics().getNumberOfFinishedJobs());
     }
 
     /**
@@ -190,7 +182,6 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
         jobPropertiesAsArray[0] = jobProperties;
 
         // create job
-        final JobManager jobManager = this.getJobManager();
         jobManager.addJob(TOPIC, jobProperties);
         cb.block();
 
@@ -235,7 +226,6 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
                         return JobResult.OK;
                     }
                 });
-        final JobManager jobManager = this.getJobManager();
         final Job j = jobManager.addJob(TOPIC, null);
         cb.block();
 
@@ -274,7 +264,6 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
                     }
                 });
 
-        final JobManager jobManager = this.getJobManager();
         final Job job = jobManager.addJob(TOPIC, null);
 
         assertTrue("No event received in the given time.", cb.block(5));
@@ -378,8 +367,6 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
                     }
                 });
 
-        final JobManager jobManager = this.getJobManager();
-
         jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"1"));
         jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"2"));
         jobManager.addJob(TOPIC, Collections.singletonMap("id", (Object)"3"));
@@ -420,8 +407,6 @@ public class JobHandlingTest extends AbstractJobHandlingTest {
             }
          });
 
-        final JobManager jobManager = this.getJobManager();
-
         log.info("testNoJobProcessor : starting 20 jobs, 10 on " + TOPIC + " and 10 on " + TOPIC + "2");
         // we start 20 jobs, every second job has no processor
         final int COUNT = 20;
diff --git a/src/test/java/org/apache/sling/event/it/JobsTestSupport.java b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
new file mode 100644
index 0000000..5414d64
--- /dev/null
+++ b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
@@ -0,0 +1,116 @@
+/*
+ * 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.event.it;
+
+import java.util.Objects;
+
+import javax.inject.Inject;
+
+import org.apache.sling.event.impl.jobs.config.JobManagerConfiguration;
+import org.apache.sling.event.jobs.JobManager;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.testing.paxexam.TestSupport;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.options.ModifiableCompositeOption;
+import org.ops4j.pax.exam.options.OptionalCompositeOption;
+import org.ops4j.pax.exam.options.extra.VMOption;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.sling.testing.paxexam.SlingOptions.slingEvent;
+import static org.apache.sling.testing.paxexam.SlingOptions.slingQuickstartOakTar;
+import static org.apache.sling.testing.paxexam.SlingOptions.versionResolver;
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.vmOption;
+import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
+
+public abstract class JobsTestSupport extends TestSupport {
+
+    @Inject
+    protected SlingRepository slingRepository;
+
+    @Inject
+    protected ConfigurationAdmin configAdmin;
+
+    @Inject
+    protected BundleContext bc;
+
+    @Inject
+    protected JobManager jobManager;
+
+    protected final Logger log = LoggerFactory.getLogger(this.getClass());
+
+    protected long backgroundLoadDelay() {
+        return 3L;
+    }
+
+    public ModifiableCompositeOption baseConfiguration() {
+        return composite(
+            super.baseConfiguration(),
+            slingQuickstart(),
+            // Sling Event
+            testBundle("bundle.filename"),
+            slingEvent(),
+            // testing configurations
+            newConfiguration("org.apache.sling.event.impl.jobs.jcr.PersistenceHandler")
+                .put(JobManagerConfiguration.PROPERTY_BACKGROUND_LOAD_DELAY, backgroundLoadDelay())
+                .put("startup.delay", 1L)
+                .asOption(),
+            newConfiguration("org.apache.sling.commons.scheduler.impl.QuartzScheduler")
+                .put("allowedPoolNames", new String[]{"oak"})
+                .asOption(),
+            // this test code uses loginAdministrative!
+            newConfiguration("org.apache.sling.jcr.base.internal.LoginAdminWhitelist")
+                .put("whitelist.bundles.regexp", "PAXEXAM-PROBE-.*")
+                .asOption(),
+            // otherwise we get ignored events
+            newConfiguration("org.apache.felix.eventadmin.impl.EventAdmin")
+                .put("org.apache.felix.eventadmin.IgnoreTimeout", "*")
+                .asOption(),
+            // testing
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.tools").versionAsInProject(),
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.json").versionAsInProject(),
+            junitBundles(),
+            jacoco() // remove with Testing PaxExam 4.0
+        ).remove(
+            mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.event").version(versionResolver)
+        );
+    }
+
+    protected Option slingQuickstart() {
+        final String workingDirectory = workingDirectory();
+        final int httpPort = findFreePort();
+        return composite(
+            slingQuickstartOakTar(workingDirectory, httpPort)
+        );
+    }
+
+    // remove with Testing PaxExam 4.0
+    protected OptionalCompositeOption jacoco() {
+        final String jacocoCommand = System.getProperty("jacoco.command");
+        final VMOption option = Objects.nonNull(jacocoCommand) && !jacocoCommand.trim().isEmpty() ? vmOption(jacocoCommand) : null;
+        return when(Objects.nonNull(option)).useOptions(option);
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java
index 03085cd..958f891 100644
--- a/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/OrderedMaxParallelTest.java
@@ -18,41 +18,40 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
 import org.apache.sling.event.jobs.QueueConfiguration;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+
+import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class OrderedMaxParallelTest extends AbstractMaxParallelTest {
 
     private static final int DURATION = 40;
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create ordered test queue
-        final org.osgi.service.cm.Configuration orderedConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> orderedProps = new Hashtable<>();
-        orderedProps.put(ConfigurationConstants.PROP_NAME, "ordered-max-parallel");
-        orderedProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name());
-        orderedProps.put(ConfigurationConstants.PROP_TOPICS, TOPIC_NAME);
-        orderedProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        orderedProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        orderedProps.put(ConfigurationConstants.PROP_MAX_PARALLEL, 1);
-        orderedConfig.update(orderedProps);
-
-        this.sleep(1000L);
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create ordered test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "ordered-max-parallel")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, TOPIC_NAME)
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .put(ConfigurationConstants.PROP_MAX_PARALLEL, 1)
+                .asOption()
+        );
     }
 
     @Test(timeout=DURATION * 16000L)
diff --git a/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java b/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java
index be23f69..5f7a18a 100644
--- a/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/OrderedQueueTest.java
@@ -18,60 +18,51 @@
  */
 package org.apache.sling.event.it;
 
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Dictionary;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.sling.event.impl.Barrier;
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
 import org.apache.sling.event.jobs.Job;
-import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.Queue;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class OrderedQueueTest extends AbstractJobHandlingTest {
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create ordered test queue
-        final org.osgi.service.cm.Configuration orderedConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> orderedProps = new Hashtable<String, Object>();
-        orderedProps.put(ConfigurationConstants.PROP_NAME, "orderedtest");
-        orderedProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name());
-        orderedProps.put(ConfigurationConstants.PROP_TOPICS, "sling/orderedtest/*");
-        orderedProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        orderedProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        orderedConfig.update(orderedProps);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create ordered test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "orderedtest")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.ORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, "sling/orderedtest/*")
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .asOption()
+        );
     }
 
     /**
@@ -79,7 +70,6 @@ public class OrderedQueueTest extends AbstractJobHandlingTest {
      */
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
     public void testOrderedQueue() throws Exception {
-        final JobManager jobManager = this.getJobManager();
 
         // register consumer and event handler
         final Barrier cb = new Barrier(2);
diff --git a/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java b/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java
index 7e5531b..b1b6494 100644
--- a/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java
+++ b/src/test/java/org/apache/sling/event/it/RoundRobinMaxParallelTest.java
@@ -18,43 +18,41 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
 import org.apache.sling.event.jobs.QueueConfiguration;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
 
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class RoundRobinMaxParallelTest extends AbstractMaxParallelTest {
 
     private static final int MAX_PARALLEL = 3;
 
     private static final int DURATION = 50;
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create ordered test queue
-        final org.osgi.service.cm.Configuration orderedConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> orderedProps = new Hashtable<>();
-        orderedProps.put(ConfigurationConstants.PROP_NAME, "round-robin-max-parallel");
-        orderedProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name());
-        orderedProps.put(ConfigurationConstants.PROP_TOPICS, TOPIC_NAME);
-        orderedProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        orderedProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        orderedProps.put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PARALLEL);
-        orderedConfig.update(orderedProps);
-
-        this.sleep(1000L);
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, "round-robin-max-parallel")
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name())
+                .put(ConfigurationConstants.PROP_TOPICS, TOPIC_NAME)
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PARALLEL)
+                .asOption()
+        );
     }
 
     @Test(timeout=DURATION * 16000L)
diff --git a/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java b/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java
index 00dfe2d..36ab986 100644
--- a/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/RoundRobinQueueTest.java
@@ -18,15 +18,8 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -34,20 +27,28 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.sling.event.impl.Barrier;
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
 import org.apache.sling.event.jobs.Job;
-import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.Queue;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class RoundRobinQueueTest extends AbstractJobHandlingTest {
 
     private static final String QUEUE_NAME = "roundrobintest";
@@ -55,34 +56,24 @@ public class RoundRobinQueueTest extends AbstractJobHandlingTest {
     private static int MAX_PAR = 5;
     private static int NUM_JOBS = 300;
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create round robin test queue
-        final org.osgi.service.cm.Configuration rrConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> rrProps = new Hashtable<String, Object>();
-        rrProps.put(ConfigurationConstants.PROP_NAME, QUEUE_NAME);
-        rrProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name());
-        rrProps.put(ConfigurationConstants.PROP_TOPICS, TOPIC + "/*");
-        rrProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        rrProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        rrProps.put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PAR);
-        rrConfig.update(rrProps);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create round robin test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, QUEUE_NAME)
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.TOPIC_ROUND_ROBIN.name())
+                .put(ConfigurationConstants.PROP_TOPICS, TOPIC + "/*")
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PAR)
+                .asOption()
+        );
     }
 
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
     public void testRoundRobinQueue() throws Exception {
-        final JobManager jobManager = this.getJobManager();
 
         final Barrier cb = new Barrier(2);
 
diff --git a/src/test/java/org/apache/sling/event/it/SchedulingTest.java b/src/test/java/org/apache/sling/event/it/SchedulingTest.java
index 980e694..d0156f1 100644
--- a/src/test/java/org/apache/sling/event/it/SchedulingTest.java
+++ b/src/test/java/org/apache/sling/event/it/SchedulingTest.java
@@ -18,10 +18,6 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
 import java.util.Date;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -29,33 +25,33 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.ScheduledJobInfo;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class SchedulingTest extends AbstractJobHandlingTest {
 
     private static final String TOPIC = "job/scheduled/topic";
 
     private final Logger logger = LoggerFactory.getLogger(getClass());
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration()
+        );
     }
 
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
@@ -75,20 +71,20 @@ public class SchedulingTest extends AbstractJobHandlingTest {
         });
 
         // we schedule three jobs
-        final ScheduledJobInfo info1 = this.getJobManager().createJob(TOPIC).schedule().hourly(5).add();
+        final ScheduledJobInfo info1 = jobManager.createJob(TOPIC).schedule().hourly(5).add();
         assertNotNull(info1);
-        final ScheduledJobInfo info2 = this.getJobManager().createJob(TOPIC).schedule().daily(10, 5).add();
+        final ScheduledJobInfo info2 = jobManager.createJob(TOPIC).schedule().daily(10, 5).add();
         assertNotNull(info2);
-        final ScheduledJobInfo info3 = this.getJobManager().createJob(TOPIC).schedule().weekly(3, 19, 12).add();
+        final ScheduledJobInfo info3 = jobManager.createJob(TOPIC).schedule().weekly(3, 19, 12).add();
         assertNotNull(info3);
 
-        assertEquals(3, this.getJobManager().getScheduledJobs().size()); // scheduled jobs
+        assertEquals(3, jobManager.getScheduledJobs().size()); // scheduled jobs
         info3.unschedule();
-        assertEquals(2, this.getJobManager().getScheduledJobs().size()); // scheduled jobs
+        assertEquals(2, jobManager.getScheduledJobs().size()); // scheduled jobs
         info1.unschedule();
-        assertEquals(1, this.getJobManager().getScheduledJobs().size()); // scheduled jobs
+        assertEquals(1, jobManager.getScheduledJobs().size()); // scheduled jobs
         info2.unschedule();
-        assertEquals(0, this.getJobManager().getScheduledJobs().size()); // scheduled jobs
+        assertEquals(0, jobManager.getScheduledJobs().size()); // scheduled jobs
     }
 
     @Test
@@ -110,20 +106,20 @@ public class SchedulingTest extends AbstractJobHandlingTest {
         });
         for(int i=0; i<NUM_ITERATIONS; i++) {
             logger.info("schedulingLoadTest: loop-" + i);
-            this.getJobManager().createJob(ownTopic).schedule().at(new Date(System.currentTimeMillis() + 2500)).add();
+            jobManager.createJob(ownTopic).schedule().at(new Date(System.currentTimeMillis() + 2500)).add();
             Thread.sleep(1);
         }
-        logger.info("schedulingLoadTest: done, letting jobs be triggered, currently at {} jobs, {} schedules", counter.get(), this.getJobManager().getScheduledJobs().size());
+        logger.info("schedulingLoadTest: done, letting jobs be triggered, currently at {} jobs, {} schedules", counter.get(), jobManager.getScheduledJobs().size());
         final long timeout = System.currentTimeMillis() + 60000;
         while(System.currentTimeMillis() < timeout) {
-            if ((counter.get() == NUM_ITERATIONS) && (this.getJobManager().getScheduledJobs().size() == 0)) {
+            if ((counter.get() == NUM_ITERATIONS) && (jobManager.getScheduledJobs().size() == 0)) {
                 break;
             }
-            logger.info("schedulingLoadTest: currently at {} jobs, {} schedules", counter.get(), getJobManager().getScheduledJobs().size());
+            logger.info("schedulingLoadTest: currently at {} jobs, {} schedules", counter.get(), jobManager.getScheduledJobs().size());
             Thread.sleep(100);
         }
         assertEquals(NUM_ITERATIONS, counter.get());
-        assertEquals(0, this.getJobManager().getScheduledJobs().size());
+        assertEquals(0, jobManager.getScheduledJobs().size());
         logger.info("schedulingLoadTest: end");
     }
 }
diff --git a/src/test/java/org/apache/sling/event/it/TimedJobsTest.java b/src/test/java/org/apache/sling/event/it/TimedJobsTest.java
index 0b2d556..2d937d5 100644
--- a/src/test/java/org/apache/sling/event/it/TimedJobsTest.java
+++ b/src/test/java/org/apache/sling/event/it/TimedJobsTest.java
@@ -18,39 +18,35 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
 import java.util.Date;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.ScheduledJobInfo;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
 
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class TimedJobsTest extends AbstractJobHandlingTest {
 
     private static final String TOPIC = "timed/test/topic";
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration()
+        );
     }
 
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
@@ -73,13 +69,13 @@ public class TimedJobsTest extends AbstractJobHandlingTest {
         d.setTime(System.currentTimeMillis() + 3000); // run in 3 seconds
 
         // create scheduled job
-        final ScheduledJobInfo info = this.getJobManager().createJob(TOPIC).schedule().at(d).add();
+        final ScheduledJobInfo info = jobManager.createJob(TOPIC).schedule().at(d).add();
         assertNotNull(info);
 
         while ( counter.get() == 0 ) {
             this.sleep(1000);
         }
-        assertEquals(0, this.getJobManager().getScheduledJobs().size()); // job is not scheduled anymore
+        assertEquals(0, jobManager.getScheduledJobs().size()); // job is not scheduled anymore
         info.unschedule();
     }
 
diff --git a/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java b/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java
index 40f7439..0a6ac5b 100644
--- a/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java
+++ b/src/test/java/org/apache/sling/event/it/TopicMatchingTest.java
@@ -18,40 +18,36 @@
  */
 package org.apache.sling.event.it;
 
-import java.io.IOException;
-
 import org.apache.sling.event.impl.Barrier;
 import org.apache.sling.event.jobs.Job;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.consumer.JobExecutionContext;
 import org.apache.sling.event.jobs.consumer.JobExecutionResult;
 import org.apache.sling.event.jobs.consumer.JobExecutor;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.ops4j.pax.exam.CoreOptions.options;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class TopicMatchingTest extends AbstractJobHandlingTest {
 
     public static final String TOPIC = "sling/test/a";
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration()
+        );
     }
 
     /**
@@ -78,7 +74,7 @@ public class TopicMatchingTest extends AbstractJobHandlingTest {
                     }
                 });
 
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         barrier.block();
     }
 
@@ -106,7 +102,7 @@ public class TopicMatchingTest extends AbstractJobHandlingTest {
                     }
                 });
 
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         barrier.block();
     }
 
@@ -148,21 +144,21 @@ public class TopicMatchingTest extends AbstractJobHandlingTest {
                 });
 
         // first test, all three registered, reg3 should get the precedence
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         barrier3.block();
 
         // second test, unregister reg3, now it should be reg2
         long cc = this.getConsumerChangeCount();
         this.unregister(reg3);
         this.waitConsumerChangeCount(cc + 1);
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         barrier2.block();
 
         // third test, unregister reg2, reg1 is now the only one
         cc = this.getConsumerChangeCount();
         this.unregister(reg2);
         this.waitConsumerChangeCount(cc + 1);
-        this.getJobManager().addJob(TOPIC, null);
+        jobManager.addJob(TOPIC, null);
         barrier1.block();
     }
 }
diff --git a/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java b/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java
index bd0eea3..7a8104a 100644
--- a/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java
+++ b/src/test/java/org/apache/sling/event/it/UnorderedQueueTest.java
@@ -18,15 +18,8 @@
  */
 package org.apache.sling.event.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -34,20 +27,28 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.sling.event.impl.Barrier;
 import org.apache.sling.event.impl.jobs.config.ConfigurationConstants;
 import org.apache.sling.event.jobs.Job;
-import org.apache.sling.event.jobs.JobManager;
 import org.apache.sling.event.jobs.NotificationConstants;
 import org.apache.sling.event.jobs.Queue;
 import org.apache.sling.event.jobs.QueueConfiguration;
 import org.apache.sling.event.jobs.consumer.JobConsumer;
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerMethod;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventHandler;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration;
+
 @RunWith(PaxExam.class)
+@ExamReactorStrategy(PerMethod.class)
 public class UnorderedQueueTest extends AbstractJobHandlingTest {
 
     private static final String QUEUE_NAME = "unorderedtestqueue";
@@ -55,34 +56,24 @@ public class UnorderedQueueTest extends AbstractJobHandlingTest {
     private static int MAX_PAR = 5;
     private static int NUM_JOBS = 300;
 
-    @Override
-    @Before
-    public void setup() throws IOException {
-        super.setup();
-
-        // create round robin test queue
-        final org.osgi.service.cm.Configuration rrConfig = this.configAdmin.createFactoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration", null);
-        final Dictionary<String, Object> rrProps = new Hashtable<String, Object>();
-        rrProps.put(ConfigurationConstants.PROP_NAME, QUEUE_NAME);
-        rrProps.put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name());
-        rrProps.put(ConfigurationConstants.PROP_TOPICS, TOPIC + "/*");
-        rrProps.put(ConfigurationConstants.PROP_RETRIES, 2);
-        rrProps.put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L);
-        rrProps.put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PAR);
-        rrConfig.update(rrProps);
-
-        this.sleep(1000L);
-    }
-
-    @Override
-    @After
-    public void cleanup() {
-        super.cleanup();
+    @Configuration
+    public Option[] configuration() {
+        return options(
+            baseConfiguration(),
+            // create round robin test queue
+            factoryConfiguration("org.apache.sling.event.jobs.QueueConfiguration")
+                .put(ConfigurationConstants.PROP_NAME, QUEUE_NAME)
+                .put(ConfigurationConstants.PROP_TYPE, QueueConfiguration.Type.UNORDERED.name())
+                .put(ConfigurationConstants.PROP_TOPICS, TOPIC + "/*")
+                .put(ConfigurationConstants.PROP_RETRIES, 2)
+                .put(ConfigurationConstants.PROP_RETRY_DELAY, 2000L)
+                .put(ConfigurationConstants.PROP_MAX_PARALLEL, MAX_PAR)
+                .asOption()
+        );
     }
 
     @Test(timeout = DEFAULT_TEST_TIMEOUT)
     public void testUnorderedQueue() throws Exception {
-        final JobManager jobManager = this.getJobManager();
 
         final Barrier cb = new Barrier(2);
 

[sling-org-apache-sling-event] 02/08: SLING-10724 Update to Sling Bundle Parent 44

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-event.git

commit f2bbbd421a70570404cc2c50f256ae70a6633e04
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 12:28:58 2021 +0200

    SLING-10724 Update to Sling Bundle Parent 44
---
 pom.xml | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 665b153..3e13edf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
@@ -20,21 +20,19 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
+
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling-bundle-parent</artifactId>
-        <version>41</version>
+        <version>44</version>
         <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.event</artifactId>
-    <packaging>jar</packaging>
     <version>4.2.25-SNAPSHOT</version>
 
     <name>Apache Sling Event Support</name>
-    <description>
-        Support for eventing.
-    </description>
+    <description>Support for eventing.</description>
 
     <scm>
         <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git</connection>

[sling-org-apache-sling-event] 06/08: remove obsolete plugin configurations

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-event.git

commit 7857adc4690343af215845710d55c61638ae4cbe
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 14:53:19 2021 +0200

    remove obsolete plugin configurations
---
 pom.xml | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2b94da1..0006a8e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,15 +55,6 @@
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>derby.log</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
             <!-- plain unit tests -->
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
@@ -112,22 +103,6 @@
                 <artifactId>depends-maven-plugin</artifactId>
             </plugin>
             <plugin>
-                <artifactId>maven-clean-plugin</artifactId>
-                <configuration>
-                    <filesets>
-                        <fileset>
-                            <directory>${basedir}</directory>
-                            <includes>
-                                <include>derby.log</include>
-                            </includes>
-                        </fileset>
-                        <fileset>
-                            <directory>jackrabbit</directory>
-                        </fileset>
-                    </filesets>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>

[sling-org-apache-sling-event] 08/08: remove unused services (injecting JobManager is sufficient)

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-event.git

commit 343c14bb1978cca1111a08c2ef5df634577f355d
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 15:07:18 2021 +0200

    remove unused services (injecting JobManager is sufficient)
---
 src/test/java/org/apache/sling/event/it/JobsTestSupport.java | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/test/java/org/apache/sling/event/it/JobsTestSupport.java b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
index 9edff88..ef76bde 100644
--- a/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
+++ b/src/test/java/org/apache/sling/event/it/JobsTestSupport.java
@@ -24,14 +24,12 @@ import javax.inject.Inject;
 
 import org.apache.sling.event.impl.jobs.config.JobManagerConfiguration;
 import org.apache.sling.event.jobs.JobManager;
-import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.testing.paxexam.TestSupport;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.options.ModifiableCompositeOption;
 import org.ops4j.pax.exam.options.OptionalCompositeOption;
 import org.ops4j.pax.exam.options.extra.VMOption;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.cm.ConfigurationAdmin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,12 +46,6 @@ import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration;
 public abstract class JobsTestSupport extends TestSupport {
 
     @Inject
-    protected SlingRepository slingRepository;
-
-    @Inject
-    protected ConfigurationAdmin configAdmin;
-
-    @Inject
     protected BundleContext bundleContext;
 
     @Inject

[sling-org-apache-sling-event] 03/08: SLING-10725 Update Felix Framework to 7.0.1

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-event.git

commit d2e7a1ca3bf91681398210a8da13f7d513890342
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Aug 12 12:30:08 2021 +0200

    SLING-10725 Update Felix Framework to 7.0.1
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3e13edf..166d260 100644
--- a/pom.xml
+++ b/pom.xml
@@ -341,7 +341,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
-            <version>5.6.2</version>
+            <version>7.0.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>