Author: cziegeler
Date: Wed Oct 12 13:10:26 2016
New Revision: 1764458

URL: http://svn.apache.org/viewvc?rev=1764458&view=rev
Log:
SLING-5232 : Remove loginAdministrative() usage from org.apache.sling.event

Modified:
    
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
    
sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java

Modified: 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java?rev=1764458&r1=1764457&r2=1764458&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java
 Wed Oct 12 13:10:26 2016
@@ -42,9 +42,9 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.commons.scheduler.Scheduler;
 import org.apache.sling.discovery.TopologyEvent;
+import org.apache.sling.discovery.TopologyEvent.Type;
 import org.apache.sling.discovery.TopologyEventListener;
 import org.apache.sling.discovery.commons.InitDelayingTopologyEventListener;
-import org.apache.sling.discovery.TopologyEvent.Type;
 import org.apache.sling.event.impl.EnvironmentComponent;
 import org.apache.sling.event.impl.jobs.Utility;
 import org.apache.sling.event.impl.jobs.tasks.CheckTopologyTask;
@@ -103,7 +103,7 @@ public class JobManagerConfiguration {
 
     /** Default startup delay. */
     public static final long DEFAULT_STARTUP_DELAY = 30;
-    
+
     /** Default for disabling the distribution. */
     public static final boolean DEFAULT_DISABLE_DISTRIBUTION = false;
 
@@ -118,7 +118,7 @@ public class JobManagerConfiguration {
 
     /** The entire job handling waits time amount of seconds until it starts - 
to allow avoiding reassign on restart of a cluster */
     public static final String PROPERTY_STARTUP_DELAY = "startup.delay";
-    
+
     /** Configuration switch for distributing the jobs. */
     public static final String PROPERTY_DISABLE_DISTRIBUTION = 
"job.consumermanager.disableDistribution";
 
@@ -156,7 +156,7 @@ public class JobManagerConfiguration {
     private volatile long backgroundLoadDelay;
 
     private volatile long startupDelay;
-    
+
     private volatile InitDelayingTopologyEventListener startupDelayListener;
 
     private volatile boolean disabledDistribution;
@@ -233,7 +233,7 @@ public class JobManagerConfiguration {
             resolver.close();
         }
         this.active.set(true);
-        
+
         // SLING-5560 : use an InitDelayingTopologyEventListener
         if (this.startupDelay > 0) {
             logger.debug("activate: job manager will start in {} sec. ({})", 
this.startupDelay, PROPERTY_STARTUP_DELAY);
@@ -295,7 +295,7 @@ public class JobManagerConfiguration {
         final ResourceResolverFactory factory = this.resourceResolverFactory;
         if ( factory != null ) {
             try {
-                resolver = 
this.resourceResolverFactory.getAdministrativeResourceResolver(null);
+                resolver = 
this.resourceResolverFactory.getServiceResourceResolver(null);
             } catch ( final LoginException le) {
                 logger.error("Unable to create new resource resolver: " + 
le.getMessage(), le);
                 throw new RuntimeException(le);
@@ -566,7 +566,7 @@ public class JobManagerConfiguration {
             doHandleTopologyEvent(event);
         }
     }
-    
+
     void doHandleTopologyEvent(final TopologyEvent event) {
 
         // check if there is a change of properties which doesn't affect us

Modified: 
sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java?rev=1764458&r1=1764457&r2=1764458&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
 Wed Oct 12 13:10:26 2016
@@ -161,7 +161,16 @@ public abstract class AbstractJobHandlin
                     .put("name", "Default NodeStore")
                     .asOption(),
 
-                // logging
+                
ConfigurationAdminOptions.factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended")
+                    .create(true)
+                    .put("user.mapping", "org.apache.sling.event=admin")
+                    .asOption(),
+                
ConfigurationAdminOptions.newConfiguration("org.apache.sling.jcr.resource.internal.JcrSystemUserValidator")
+                    .create(true)
+                    .put("allow.only.system.user", "false")
+                    .asOption(),
+
+                    // logging
                 systemProperty("pax.exam.logging").value("none"),
                 mavenBundle("org.apache.sling", 
"org.apache.sling.commons.log", "4.0.6"),
                 mavenBundle("org.apache.sling", 
"org.apache.sling.commons.logservice", "1.0.6"),
@@ -185,8 +194,8 @@ public abstract class AbstractJobHandlin
                 // infrastructure
                 mavenBundle("org.apache.felix", 
"org.apache.felix.http.servlet-api", "1.1.2"),
                 mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", 
"3.1.6"),
-                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", 
"1.4.4"),
-                mavenBundle("org.apache.felix", "org.apache.felix.scr", 
"2.0.4"),
+                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", 
"1.4.8"),
+                mavenBundle("org.apache.felix", "org.apache.felix.scr", 
"2.0.6"),
                 mavenBundle("org.apache.felix", 
"org.apache.felix.configadmin", "1.8.10"),
                 mavenBundle("org.apache.felix", "org.apache.felix.inventory", 
"1.0.4"),
                 mavenBundle("org.apache.felix", "org.apache.felix.metatype", 
"1.1.2"),


Reply via email to