Examples of ReplicationRequestHandler


Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

        when(repository.loginService(serviceName, null)).thenReturn(session);

        String path = "/some/path";
        PersistingJcrEventReplicationTrigger persistingJcrEventReplicationTrigger = new PersistingJcrEventReplicationTrigger(
                repository, path, serviceName, nuggetsPath);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        persistingJcrEventReplicationTrigger.register(handler);

        Node nuggetsNode = mock(Node.class);
        Node eventNode = mock(Node.class);
        when(nuggetsNode.addNode(any(String.class))).thenReturn(eventNode);
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

    @Test
    public void testRegister() throws Exception {
        String pathPrefix = "/prefix";
        BundleContext bundleContext = mock(BundleContext.class);
        ChainReplicateReplicationTrigger chainReplicateReplicationTrigger = new ChainReplicateReplicationTrigger(pathPrefix, bundleContext);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        chainReplicateReplicationTrigger.register(handler);
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

    @Test
    public void testUnregister() throws Exception {
        String pathPrefix = "/prefix";
        BundleContext bundleContext = mock(BundleContext.class);
        ChainReplicateReplicationTrigger chainReplicateReplicationTrigger = new ChainReplicateReplicationTrigger(pathPrefix, bundleContext);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        chainReplicateReplicationTrigger.unregister(handler);
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

    @Test
    public void testRegister() throws Exception {
        for (ReplicationActionType action : ReplicationActionType.values()) {
            String path = "/path/to/somewhere";
            int interval = 10;
            ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
            Scheduler scheduler = mock(Scheduler.class);
            ScheduleOptions options = mock(ScheduleOptions.class);
            when(scheduler.NOW(-1, interval)).thenReturn(options);
            when(options.name(handler.toString())).thenReturn(options);
            ScheduledReplicationTrigger scheduledReplicationTrigger = new ScheduledReplicationTrigger(action.name(), path, interval, scheduler);
            scheduledReplicationTrigger.register(handler);
        }
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

        for (ReplicationActionType action : ReplicationActionType.values()) {
            String path = "/path/to/somewhere";
            int interval = 10;
            Scheduler scheduler = mock(Scheduler.class);
            ScheduledReplicationTrigger scheduledReplicationTrigger = new ScheduledReplicationTrigger(action.name(), path, interval, scheduler);
            ReplicationRequestHandler handlerId = mock(ReplicationRequestHandler.class);
            scheduledReplicationTrigger.unregister(handlerId);
        }
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

*/
public class RemoteEventReplicationTriggerTest {

    @Test
    public void testRegister() throws Exception {
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        String endpoint = "";
        TransportAuthenticationProvider<CredentialsProvider, CredentialsProvider> authProvider = mock(TransportAuthenticationProvider.class);
        when(authProvider.canAuthenticate(CredentialsProvider.class)).thenReturn(true);
        Scheduler scheduler = mock(Scheduler.class);
        ScheduleOptions options = mock(ScheduleOptions.class);
        when(options.name(handler.toString())).thenReturn(options);
        when(scheduler.NOW()).thenReturn(options);
        RemoteEventReplicationTrigger remoteEventReplicationTrigger = new RemoteEventReplicationTrigger(
                endpoint, authProvider, scheduler);
        remoteEventReplicationTrigger.register(handler);
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

        TransportAuthenticationProvider<CredentialsProvider, CredentialsProvider> authProvider = mock(TransportAuthenticationProvider.class);
        when(authProvider.canAuthenticate(CredentialsProvider.class)).thenReturn(true);
        Scheduler scheduler = mock(Scheduler.class);
        RemoteEventReplicationTrigger remoteEventReplicationTrigger = new RemoteEventReplicationTrigger(
                endpoint, authProvider, scheduler);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        remoteEventReplicationTrigger.unregister(handler);
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

        String path = "/some/path";
        BundleContext bundleContext = mock(BundleContext.class);
        ServiceRegistration registration = mock(ServiceRegistration.class);
        when(bundleContext.registerService(any(String.class), any(Object.class), any(Dictionary.class))).thenReturn(registration);
        ResourceEventReplicationTrigger resourceEventReplicationTrigger = new ResourceEventReplicationTrigger(path, bundleContext);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        resourceEventReplicationTrigger.register(handler);
    }
View Full Code Here

Examples of org.apache.sling.replication.trigger.ReplicationRequestHandler

    @Test
    public void testUnregister() throws Exception {
        String path = "/some/path";
        BundleContext bundleContext = mock(BundleContext.class);
        ResourceEventReplicationTrigger resourceEventReplicationTrigger = new ResourceEventReplicationTrigger(path, bundleContext);
        ReplicationRequestHandler handler = mock(ReplicationRequestHandler.class);
        resourceEventReplicationTrigger.unregister(handler);
    }
View Full Code Here

Examples of org.xtreemfs.babudb.replication.service.ReplicationRequestHandler

    @Before
    public void setUp() throws Exception {
       
        client = new ReplicationClientAdapter(rpcClient, config.getInetSocketAddress());
       
        RequestHandler rqHandler = new ReplicationRequestHandler(new StatesManipulation() {
           
            @Override
            public void update(InetSocketAddress participant, LSN acknowledgedLSN, long receiveTime)
                    throws UnknownParticipantException {
               
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.