Package org.apache.sling.replication.communication

Examples of org.apache.sling.replication.communication.ReplicationRequest


        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "subServiceName", packageImporter,
                packageExporter, packageExporterStrategy,
                queueProvider,
                distributionHandler, replicationEventFactory, resolverFactory, null);
        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
                ReplicationActionType.ADD, "/");
        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);

        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
View Full Code Here


        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
                false, "serviceName", packageImporter,
                packageExporter, packageExporterStrategy,
                queueProvider, distributionHandler,
                replicationEventFactory, resolverFactory, null);
        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
                ReplicationActionType.ADD, "/");
        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);

        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
View Full Code Here

        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
        int maxNoOfPackages = 1;
        SimpleHttpReplicationTransportHandler simpleHttpReplicationTransportHandler = new SimpleHttpReplicationTransportHandler(
                authProvider, endpoint, packageBuilder, maxNoOfPackages);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        ReplicationRequest replicationRequest = new ReplicationRequest(ReplicationActionType.ADD, new String[]{"/"});
        List<ReplicationPackage> packages = simpleHttpReplicationTransportHandler.retrievePackages(resourceResolver, replicationRequest);
        assertNotNull(packages);
        assertTrue(packages.isEmpty());
    }
View Full Code Here

        when(packageBuilder.readPackage(any(ResourceResolver.class), any(InputStream.class))).thenReturn(replicationPackage);
        int maxNoOfPackages = 1;
        SimpleHttpReplicationTransportHandler simpleHttpReplicationTransportHandler = new SimpleHttpReplicationTransportHandler(
                authProvider, endpoint, packageBuilder, maxNoOfPackages);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        ReplicationRequest replicationRequest = new ReplicationRequest(ReplicationActionType.ADD, new String[]{"/"});
        List<ReplicationPackage> packages = simpleHttpReplicationTransportHandler.retrievePackages(resourceResolver, replicationRequest);
        assertNotNull(packages);
        assertFalse(packages.isEmpty());
        assertEquals(1, packages.size());
        assertNotNull(packages.get(0));
View Full Code Here

    @Test
    public void testRetrievePackagesWithoutSubHandlers() throws Exception {
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
            MultipleEndpointReplicationTransportHandler multipleEndpointReplicationTransportHandler = new MultipleEndpointReplicationTransportHandler(subHandlers, strategy);
            List<ReplicationPackage> replicationPackages = multipleEndpointReplicationTransportHandler.retrievePackages(resourceResolver, replicationRequest);
            assertNotNull(replicationPackages);
            assertTrue(replicationPackages.isEmpty());
View Full Code Here

    public void testRetrievePackagesWithSubHandlers() throws Exception {
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        subHandlers.add(mock(ReplicationTransportHandler.class));
        subHandlers.add(mock(ReplicationTransportHandler.class));
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
            MultipleEndpointReplicationTransportHandler multipleEndpointReplicationTransportHandler = new MultipleEndpointReplicationTransportHandler(subHandlers, strategy);
            List<ReplicationPackage> replicationPackages = multipleEndpointReplicationTransportHandler.retrievePackages(resourceResolver, replicationRequest);
            assertNotNull(replicationPackages);
            assertTrue(replicationPackages.isEmpty());
View Full Code Here

        }
    }

    @Test
    public void testRetrievePackagesWithOneReturningSubHandlerAndAllStrategy() throws Exception {
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        ReplicationTransportHandler handler1 = mock(ReplicationTransportHandler.class);
        List<ReplicationPackage> packages1 = new ArrayList<ReplicationPackage>();
        packages1.add(mock(ReplicationPackage.class));
View Full Code Here

        assertEquals(2, replicationPackages.size());
    }

    @Test
    public void testRetrievePackagesWithOneEmptyOneReturningSubHandlerAndOneStrategy() throws Exception {
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        subHandlers.add(mock(ReplicationTransportHandler.class));
        ReplicationTransportHandler handler2 = mock(ReplicationTransportHandler.class);
        List<ReplicationPackage> packages2 = new ArrayList<ReplicationPackage>();
View Full Code Here

        assertTrue(replicationPackages.isEmpty());
    }

    @Test
    public void testRetrievePackagesWithTwoReturningSubHandlersAndAllStrategy() throws Exception {
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        ReplicationTransportHandler handler1 = mock(ReplicationTransportHandler.class);
        List<ReplicationPackage> packages1 = new ArrayList<ReplicationPackage>();
        packages1.add(mock(ReplicationPackage.class));
View Full Code Here

        assertEquals(5, replicationPackages.size());
    }

    @Test
    public void testRetrievePackagesWithTwoReturningSubHandlersAndOneStrategy() throws Exception {
        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
        ResourceResolver resourceResolver = mock(ResourceResolver.class);
        List<ReplicationTransportHandler> subHandlers = new ArrayList<ReplicationTransportHandler>();
        ReplicationTransportHandler handler1 = mock(ReplicationTransportHandler.class);
        List<ReplicationPackage> packages1 = new ArrayList<ReplicationPackage>();
        packages1.add(mock(ReplicationPackage.class));
View Full Code Here

TOP

Related Classes of org.apache.sling.replication.communication.ReplicationRequest

Copyright © 2018 www.massapicom. 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.