Search in sources :

Example 11 with DistributionRequestHandler

use of org.apache.sling.distribution.trigger.DistributionRequestHandler in project sling by apache.

the class ScheduledDistributionTriggerTest method testUnregister.

@Test
public void testUnregister() throws Exception {
    String path = "/path/to/somewhere";
    int interval = 10;
    Scheduler scheduler = mock(Scheduler.class);
    ScheduledDistributionTrigger scheduleddistributionTrigger = new ScheduledDistributionTrigger(action.name(), path, interval, null, scheduler, mock(ResourceResolverFactory.class));
    DistributionRequestHandler handlerId = mock(DistributionRequestHandler.class);
    scheduleddistributionTrigger.unregister(handlerId);
}
Also used : DistributionRequestHandler(org.apache.sling.distribution.trigger.DistributionRequestHandler) ResourceResolverFactory(org.apache.sling.api.resource.ResourceResolverFactory) Scheduler(org.apache.sling.commons.scheduler.Scheduler) Test(org.junit.Test)

Aggregations

DistributionRequestHandler (org.apache.sling.distribution.trigger.DistributionRequestHandler)11 Test (org.junit.Test)10 Scheduler (org.apache.sling.commons.scheduler.Scheduler)6 ResourceResolverFactory (org.apache.sling.api.resource.ResourceResolverFactory)4 BundleContext (org.osgi.framework.BundleContext)4 DistributionRequest (org.apache.sling.distribution.DistributionRequest)3 Node (javax.jcr.Node)2 Session (javax.jcr.Session)2 Workspace (javax.jcr.Workspace)2 Event (javax.jcr.observation.Event)2 ObservationManager (javax.jcr.observation.ObservationManager)2 ScheduleOptions (org.apache.sling.commons.scheduler.ScheduleOptions)2 DistributionTransportSecretProvider (org.apache.sling.distribution.transport.DistributionTransportSecretProvider)2 SlingRepository (org.apache.sling.jcr.api.SlingRepository)2 PrintWriter (java.io.PrintWriter)1 Dictionary (java.util.Dictionary)1 Nonnull (javax.annotation.Nonnull)1 Nullable (javax.annotation.Nullable)1 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)1 DistributionException (org.apache.sling.distribution.common.DistributionException)1