sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637333 [9/12] - in /sling/trunk/contrib/extensions: distribution/ distribution/core/ distribution/core/src/main/java/org/apache/sling/distribution/ distribution/core/src/main/java/org/apache/sling/distribution/agent/ distribution/core/src...
Date Fri, 07 Nov 2014 10:28:08 GMT
Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentTest.java Fri Nov  7 10:28:02 2014
@@ -16,26 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.agent.impl;
+package org.apache.sling.distribution.agent.impl;
 
 import java.util.Arrays;
 
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
-import org.apache.sling.replication.agent.ReplicationRequestAuthorizationStrategy;
-import org.apache.sling.replication.communication.ReplicationActionType;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.communication.ReplicationResponse;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.packaging.ReplicationPackageExporter;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueItemState;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.apache.sling.replication.queue.impl.simple.SimpleReplicationQueue;
+import org.apache.sling.distribution.agent.DistributionRequestAuthorizationStrategy;
+import org.apache.sling.distribution.communication.DistributionActionType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.communication.DistributionResponse;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.packaging.DistributionPackageExporter;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueDistributionStrategy;
+import org.apache.sling.distribution.queue.DistributionQueueProvider;
+import org.apache.sling.distribution.queue.impl.simple.SimpleDistributionQueue;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -47,98 +45,98 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link SimpleReplicationAgent}
+ * Testcase for {@link SimpleDistributionAgent}
  */
-public class SimpleReplicationAgentTest {
+public class SimpleDistributionAgentTest {
 
     @Test
-    public void testReplicationWithFailingDistributionStrategy() throws Exception {
+    public void testdistributionWithFailingDistributionStrategy() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        when(distributionHandler.add(any(ReplicationPackage.class), any(ReplicationQueueProvider.class))).thenReturn(false);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        when(distributionHandler.add(any(DistributionPackage.class), any(DistributionQueueProvider.class))).thenReturn(false);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
 
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "serviceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider, distributionHandler,
-                replicationEventFactory, resolverFactory,  null);
-        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
-                ReplicationActionType.ADD, "/");
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
+                distributionEventFactory, resolverFactory,  null);
+        DistributionRequest request = new DistributionRequest(System.nanoTime(),
+                DistributionActionType.ADD, "/");
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
         ResourceResolver resourceResolver = mock(ResourceResolver.class);
 
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
-        when(packageExporter.exportPackages(any(ResourceResolver.class), any(ReplicationRequest.class)))
-                .thenReturn(Arrays.asList(replicationPackage));
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
-                new SimpleReplicationQueue(name, "name"));
-        ReplicationResponse response = agent.execute(resourceResolver, request);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/"});
+        when(packageExporter.exportPackages(any(ResourceResolver.class), any(DistributionRequest.class)))
+                .thenReturn(Arrays.asList(distributionPackage));
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
+                new SimpleDistributionQueue(name, "name"));
+        DistributionResponse response = agent.execute(resourceResolver, request);
         assertNotNull(response);
         assertEquals("ERROR", response.getStatus());
     }
 
     @Test
-    public void testReplicationWithWorkingDistributionStrategy() throws Exception {
+    public void testdistributionWithWorkingDistributionStrategy() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "subServiceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider,
-                distributionHandler, replicationEventFactory, resolverFactory, null);
-        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
-                ReplicationActionType.ADD, "/");
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
+                distributionHandler, distributionEventFactory, resolverFactory, null);
+        DistributionRequest request = new DistributionRequest(System.nanoTime(),
+                DistributionActionType.ADD, "/");
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
         ResourceResolver resourceResolver = mock(ResourceResolver.class);
 
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
-        when(distributionHandler.add(any(ReplicationPackage.class), eq(queueProvider))).thenReturn(true);
-        when(packageExporter.exportPackages(any(ResourceResolver.class), any(ReplicationRequest.class)))
-                .thenReturn(Arrays.asList(replicationPackage));
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
-                new SimpleReplicationQueue(name, "name"));
-        ReplicationResponse response = agent.execute(resourceResolver, request);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/"});
+        when(distributionHandler.add(any(DistributionPackage.class), eq(queueProvider))).thenReturn(true);
+        when(packageExporter.exportPackages(any(ResourceResolver.class), any(DistributionRequest.class)))
+                .thenReturn(Arrays.asList(distributionPackage));
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
+                new SimpleDistributionQueue(name, "name"));
+        DistributionResponse response = agent.execute(resourceResolver, request);
         assertNotNull(response);
         assertEquals("QUEUED", response.getStatus());
     }
 
     @Test
-    public void testReplication() throws Exception {
+    public void testdistribution() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
 
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "serviceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider, distributionHandler,
-                replicationEventFactory, resolverFactory, null);
-        ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
-                ReplicationActionType.ADD, "/");
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
+                distributionEventFactory, resolverFactory, null);
+        DistributionRequest request = new DistributionRequest(System.nanoTime(),
+                DistributionActionType.ADD, "/");
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
         ResourceResolver resourceResolver = mock(ResourceResolver.class);
 
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
-        when(packageExporter.exportPackages(resourceResolver, request)).thenReturn(Arrays.asList(replicationPackage));
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
-                new SimpleReplicationQueue(name, "name"));
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/"});
+        when(packageExporter.exportPackages(resourceResolver, request)).thenReturn(Arrays.asList(distributionPackage));
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(
+                new SimpleDistributionQueue(name, "name"));
 
         agent.execute(resourceResolver, request);
     }
@@ -146,22 +144,22 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetDefaultQueue() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
 
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
 
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "serviceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider, distributionHandler,
-                replicationEventFactory, resolverFactory, null);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME))
+                distributionEventFactory, resolverFactory, null);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME))
                 .thenReturn(queue);
         assertNotNull(agent.getQueue(null));
     }
@@ -169,21 +167,21 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetExistingNamedQueue() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
 
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
 
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "serviceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider, distributionHandler,
-                replicationEventFactory, resolverFactory, null);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+                distributionEventFactory, resolverFactory, null);
+        DistributionQueue queue = mock(DistributionQueue.class);
         when(queueProvider.getQueue("priority")).thenReturn(queue);
         assertNotNull(agent.getQueue("priority"));
     }
@@ -191,21 +189,21 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetNonExistingNamedQueue() throws Exception {
         String name = "sample-agent";
-        ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
-        ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
-        ReplicationRequestAuthorizationStrategy packageExporterStrategy = mock(ReplicationRequestAuthorizationStrategy.class);
+        DistributionPackageImporter packageImporter = mock(DistributionPackageImporter.class);
+        DistributionPackageExporter packageExporter = mock(DistributionPackageExporter.class);
+        DistributionRequestAuthorizationStrategy packageExporterStrategy = mock(DistributionRequestAuthorizationStrategy.class);
 
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
-        ReplicationEventFactory replicationEventFactory = mock(ReplicationEventFactory.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueueDistributionStrategy distributionHandler = mock(DistributionQueueDistributionStrategy.class);
+        DistributionEventFactory distributionEventFactory = mock(DistributionEventFactory.class);
         ResourceResolverFactory resolverFactory = mock(ResourceResolverFactory.class);
 
-        SimpleReplicationAgent agent = new SimpleReplicationAgent(name,
+        SimpleDistributionAgent agent = new SimpleDistributionAgent(name,
                 false, "serviceName", packageImporter,
                 packageExporter, packageExporterStrategy,
                 queueProvider, distributionHandler,
-                replicationEventFactory, resolverFactory, null);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+                distributionEventFactory, resolverFactory, null);
+        DistributionQueue queue = mock(DistributionQueue.class);
         when(queueProvider.getQueue("priority")).thenReturn(queue);
         assertNull(agent.getQueue("weird"));
     }

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactoryTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/component/impl/DefaultReplicationComponentFactoryTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactoryTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactoryTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/component/impl/DefaultReplicationComponentFactoryTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/component/impl/DefaultReplicationComponentFactoryTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentFactoryTest.java Fri Nov  7 10:28:02 2014
@@ -16,18 +16,18 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.component.impl;
+package org.apache.sling.distribution.component.impl;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.component.ReplicationComponentProvider;
-import org.apache.sling.replication.packaging.ReplicationPackageExporter;
-import org.apache.sling.replication.packaging.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.trigger.ReplicationTrigger;
-import org.apache.sling.replication.trigger.impl.PersistingJcrEventReplicationTrigger;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.component.DistributionComponentProvider;
+import org.apache.sling.distribution.packaging.DistributionPackageExporter;
+import org.apache.sling.distribution.packaging.DistributionPackageImporter;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.apache.sling.distribution.trigger.impl.PersistingJcrEventDistributionTrigger;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -38,21 +38,21 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link org.apache.sling.replication.component.impl.DefaultReplicationComponentFactory}
+ * Testcase for {@link DefaultDistributionComponentFactory}
  */
-public class DefaultReplicationComponentFactoryTest {
+public class DefaultDistributionComponentFactoryTest {
 
     @Test
     public void testDefaultCreateComponentForAgentByService() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         String name = "sample-agent";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("name", name);
-        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
-        ReplicationAgent agent = mock(ReplicationAgent.class);
-        when(provider.getComponent(ReplicationAgent.class, name)).thenReturn(agent);
+        DistributionComponentProvider provider = mock(DistributionComponentProvider.class);
+        DistributionAgent agent = mock(DistributionAgent.class);
+        when(provider.getComponent(DistributionAgent.class, name)).thenReturn(agent);
         try {
-            ReplicationAgent component = defaultReplicationComponentFactory.createComponent(ReplicationAgent.class, properties, provider);
+            DistributionAgent component = defaultdistributionComponentFactory.createComponent(DistributionAgent.class, properties, provider);
 
             fail("agents cannot be referenced by service name using the factory");
 
@@ -64,66 +64,66 @@ public class DefaultReplicationComponent
 
     @Test
     public void testDefaultCreateComponentForTriggerByService() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         String name = "sample-trigger";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("name", name);
-        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
-        ReplicationTrigger trigger = mock(ReplicationTrigger.class);
-        when(provider.getComponent(ReplicationTrigger.class, name)).thenReturn(trigger);
-        ReplicationTrigger component = defaultReplicationComponentFactory.createComponent(ReplicationTrigger.class, properties, provider);
+        DistributionComponentProvider provider = mock(DistributionComponentProvider.class);
+        DistributionTrigger trigger = mock(DistributionTrigger.class);
+        when(provider.getComponent(DistributionTrigger.class, name)).thenReturn(trigger);
+        DistributionTrigger component = defaultdistributionComponentFactory.createComponent(DistributionTrigger.class, properties, provider);
         assertNotNull(component);
     }
 
     @Test
     public void testDefaultCreateComponentForTransportAuthenticationProviderByService() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         String name = "sample-auth";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("name", name);
-        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
+        DistributionComponentProvider provider = mock(DistributionComponentProvider.class);
         TransportAuthenticationProvider authenticationProvider = mock(TransportAuthenticationProvider.class);
         when(provider.getComponent(TransportAuthenticationProvider.class, name)).thenReturn(authenticationProvider);
-        TransportAuthenticationProvider component = defaultReplicationComponentFactory.createComponent(TransportAuthenticationProvider.class, properties, provider);
+        TransportAuthenticationProvider component = defaultdistributionComponentFactory.createComponent(TransportAuthenticationProvider.class, properties, provider);
         assertNotNull(component);
     }
 
     @Test
     public void testDefaultCreateComponentForImporterByService() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         String name = "sample-importer";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("name", name);
-        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
-        ReplicationPackageImporter importer = mock(ReplicationPackageImporter.class);
-        when(provider.getComponent(ReplicationPackageImporter.class, name)).thenReturn(importer);
-        ReplicationPackageImporter component = defaultReplicationComponentFactory.createComponent(ReplicationPackageImporter.class, properties, provider);
+        DistributionComponentProvider provider = mock(DistributionComponentProvider.class);
+        DistributionPackageImporter importer = mock(DistributionPackageImporter.class);
+        when(provider.getComponent(DistributionPackageImporter.class, name)).thenReturn(importer);
+        DistributionPackageImporter component = defaultdistributionComponentFactory.createComponent(DistributionPackageImporter.class, properties, provider);
         assertNotNull(component);
     }
 
     @Test
     public void testDefaultCreateComponentForExporterByService() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         String name = "sample-exporter";
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("name", name);
-        ReplicationComponentProvider provider = mock(ReplicationComponentProvider.class);
-        ReplicationPackageExporter exporter = mock(ReplicationPackageExporter.class);
-        when(provider.getComponent(ReplicationPackageExporter.class, name)).thenReturn(exporter);
-        ReplicationPackageExporter component = defaultReplicationComponentFactory.createComponent(ReplicationPackageExporter.class, properties, provider);
+        DistributionComponentProvider provider = mock(DistributionComponentProvider.class);
+        DistributionPackageExporter exporter = mock(DistributionPackageExporter.class);
+        when(provider.getComponent(DistributionPackageExporter.class, name)).thenReturn(exporter);
+        DistributionPackageExporter component = defaultdistributionComponentFactory.createComponent(DistributionPackageExporter.class, properties, provider);
         assertNotNull(component);
     }
 
     @Test
     public void testPersistingJcrEventTriggerCreation() throws Exception {
-        DefaultReplicationComponentFactory defaultReplicationComponentFactory = new DefaultReplicationComponentFactory();
+        DefaultDistributionComponentFactory defaultdistributionComponentFactory = new DefaultDistributionComponentFactory();
         Map<String, Object> properties = new HashMap<String, Object>();
         properties.put("type", "persistedJcrEvent");
         properties.put("path", "/content/persistedEvents");
-        properties.put("servicename", "replicationService");
-        ReplicationComponentProvider componentProvider = mock(ReplicationComponentProvider.class);
-        ReplicationTrigger trigger = defaultReplicationComponentFactory.createTrigger(properties, componentProvider);
+        properties.put("servicename", "distributionService");
+        DistributionComponentProvider componentProvider = mock(DistributionComponentProvider.class);
+        DistributionTrigger trigger = defaultdistributionComponentFactory.createTrigger(properties, componentProvider);
         assertNotNull(trigger);
-        assertEquals(PersistingJcrEventReplicationTrigger.class, trigger.getClass());
+        assertEquals(PersistingJcrEventDistributionTrigger.class, trigger.getClass());
     }
 }
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/SettingsUtilsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/SettingsUtilsTest.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/SettingsUtilsTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/component/impl/SettingsUtilsTest.java Fri Nov  7 10:28:02 2014
@@ -1,4 +1,4 @@
-package org.apache.sling.replication.component.impl;
+package org.apache.sling.distribution.component.impl;
 
 import org.junit.Test;
 

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/monitor/ReplicationQueueHealthCheckTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/monitor/ReplicationQueueHealthCheckTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/monitor/ReplicationQueueHealthCheckTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/monitor/DistributionQueueHealthCheckTest.java Fri Nov  7 10:28:02 2014
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.monitor;
+package org.apache.sling.distribution.monitor;
 
 import java.util.*;
 
 import org.apache.sling.hc.api.Result;
-import org.apache.sling.replication.agent.ReplicationAgent;
-import org.apache.sling.replication.queue.ReplicationQueue;
-import org.apache.sling.replication.queue.ReplicationQueueItem;
-import org.apache.sling.replication.queue.ReplicationQueueItemState;
-import org.apache.sling.replication.queue.ReplicationQueueProvider;
+import org.apache.sling.distribution.agent.DistributionAgent;
+import org.apache.sling.distribution.queue.DistributionQueue;
+import org.apache.sling.distribution.queue.DistributionQueueItem;
+import org.apache.sling.distribution.queue.DistributionQueueItemState;
 import org.junit.Test;
 
 import static org.junit.Assert.assertFalse;
@@ -33,87 +32,87 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.mockingDetails;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link org.apache.sling.replication.monitor.ReplicationQueueHealthCheck}
+ * Testcase for {@link DistributionQueueHealthCheck}
  */
-public class ReplicationQueueHealthCheckTest {
+public class DistributionQueueHealthCheckTest {
 
     @Test
-    public void testWithNoReplicationQueueProvider() throws Exception {
-        ReplicationQueueHealthCheck replicationQueueHealthCheck = new ReplicationQueueHealthCheck();
-        replicationQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
-        Result result = replicationQueueHealthCheck.execute();
+    public void testWithNodistributionQueueProvider() throws Exception {
+        DistributionQueueHealthCheck distributionQueueHealthCheck = new DistributionQueueHealthCheck();
+        distributionQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
+        Result result = distributionQueueHealthCheck.execute();
         assertNotNull(result);
         assertTrue(result.isOk());
     }
 
     @Test
     public void testWithNoItemInTheQueue() throws Exception {
-        ReplicationQueueHealthCheck replicationQueueHealthCheck = new ReplicationQueueHealthCheck();
+        DistributionQueueHealthCheck distributionQueueHealthCheck = new DistributionQueueHealthCheck();
 
-        replicationQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+        distributionQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
+        DistributionQueue queue = mock(DistributionQueue.class);
         when(queue.getHead()).thenReturn(null);
-        ReplicationAgent replicationAgent = mock(ReplicationAgent.class);
+        DistributionAgent distributionAgent = mock(DistributionAgent.class);
 
         List<String> queues = new ArrayList<String>();
         queues.add("queueName");
-        when(replicationAgent.getQueueNames()).thenReturn(queues);        when(replicationAgent.getQueue(anyString())).thenReturn(queue);
-        replicationQueueHealthCheck.bindReplicationAgent(replicationAgent);
+        when(distributionAgent.getQueueNames()).thenReturn(queues);
+        when(distributionAgent.getQueue(anyString())).thenReturn(queue);
+        distributionQueueHealthCheck.bindDistributionAgent(distributionAgent);
 
-        Result result = replicationQueueHealthCheck.execute();
+        Result result = distributionQueueHealthCheck.execute();
         assertNotNull(result);
         assertTrue(result.isOk());
     }
 
     @Test
     public void testWithOneOkItemInTheQueue() throws Exception {
-        ReplicationQueueHealthCheck replicationQueueHealthCheck = new ReplicationQueueHealthCheck();
+        DistributionQueueHealthCheck distributionQueueHealthCheck = new DistributionQueueHealthCheck();
 
-        replicationQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        ReplicationQueueItem item = mock(ReplicationQueueItem.class);
-        ReplicationQueueItemState status = mock(ReplicationQueueItemState.class);
+        distributionQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
+        DistributionQueue queue = mock(DistributionQueue.class);
+        DistributionQueueItem item = mock(DistributionQueueItem.class);
+        DistributionQueueItemState status = mock(DistributionQueueItemState.class);
         when(status.getAttempts()).thenReturn(1);
         when(queue.getStatus(item)).thenReturn(status);
         when(queue.getHead()).thenReturn(item);
-        ReplicationAgent replicationAgent = mock(ReplicationAgent.class);
+        DistributionAgent distributionAgent = mock(DistributionAgent.class);
 
         List<String> queues = new ArrayList<String>();
         queues.add("queueName");
-        when(replicationAgent.getQueueNames()).thenReturn(queues);
-        when(replicationAgent.getQueue(anyString())).thenReturn(queue);
-        replicationQueueHealthCheck.bindReplicationAgent(replicationAgent);
+        when(distributionAgent.getQueueNames()).thenReturn(queues);
+        when(distributionAgent.getQueue(anyString())).thenReturn(queue);
+        distributionQueueHealthCheck.bindDistributionAgent(distributionAgent);
 
 
-        Result result = replicationQueueHealthCheck.execute();
+        Result result = distributionQueueHealthCheck.execute();
         assertNotNull(result);
         assertTrue(result.isOk());
     }
 
     @Test
     public void testWithNotOkItemInTheQueue() throws Exception {
-        ReplicationQueueHealthCheck replicationQueueHealthCheck = new ReplicationQueueHealthCheck();
+        DistributionQueueHealthCheck distributionQueueHealthCheck = new DistributionQueueHealthCheck();
 
-        replicationQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        ReplicationQueueItem item = mock(ReplicationQueueItem.class);
-        ReplicationQueueItemState status = mock(ReplicationQueueItemState.class);
+        distributionQueueHealthCheck.activate(Collections.<String, Object>emptyMap());
+        DistributionQueue queue = mock(DistributionQueue.class);
+        DistributionQueueItem item = mock(DistributionQueueItem.class);
+        DistributionQueueItemState status = mock(DistributionQueueItemState.class);
         when(status.getAttempts()).thenReturn(10);
         when(queue.getStatus(item)).thenReturn(status);
         when(queue.getHead()).thenReturn(item);
-        ReplicationAgent replicationAgent = mock(ReplicationAgent.class);
+        DistributionAgent distributionAgent = mock(DistributionAgent.class);
 
         List<String> queues = new ArrayList<String>();
         queues.add("queueName");
-        when(replicationAgent.getQueueNames()).thenReturn(queues);
-        when(replicationAgent.getQueue(anyString())).thenReturn(queue);
-        replicationQueueHealthCheck.bindReplicationAgent(replicationAgent);
+        when(distributionAgent.getQueueNames()).thenReturn(queues);
+        when(distributionAgent.getQueue(anyString())).thenReturn(queue);
+        distributionQueueHealthCheck.bindDistributionAgent(distributionAgent);
 
-        Result result = replicationQueueHealthCheck.execute();
+        Result result = distributionQueueHealthCheck.execute();
         assertNotNull(result);
         assertFalse(result.isOk());
     }

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/LocalReplicationPackageExporterTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/LocalDistributionPackageExporterTest.java Fri Nov  7 10:28:02 2014
@@ -16,14 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.packaging.impl.exporter;
+package org.apache.sling.distribution.packaging.impl.exporter;
 
 import java.util.List;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
 import org.junit.Test;
 
 import static org.junit.Assert.assertNotNull;
@@ -31,18 +31,18 @@ import static org.junit.Assert.assertTru
 import static org.mockito.Mockito.mock;
 
 /**
- * Testcase for {@link org.apache.sling.replication.packaging.impl.exporter.LocalReplicationPackageExporter}
+ * Testcase for {@link LocalDistributionPackageExporter}
  */
-public class LocalReplicationPackageExporterTest {
+public class LocalDistributionPackageExporterTest {
 
     @Test
     public void testDummyExport() throws Exception {
-        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
-        LocalReplicationPackageExporter localReplicationPackageExporter = new LocalReplicationPackageExporter(packageBuilder);
+        DistributionPackageBuilder packageBuilder = mock(DistributionPackageBuilder.class);
+        LocalDistributionPackageExporter localdistributionPackageExporter = new LocalDistributionPackageExporter(packageBuilder);
         ResourceResolver resourceResolver = mock(ResourceResolver.class);
-        ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
-        List<ReplicationPackage> replicationPackages = localReplicationPackageExporter.exportPackages(resourceResolver, replicationRequest);
-        assertNotNull(replicationPackages);
-        assertTrue(replicationPackages.isEmpty());
+        DistributionRequest distributionRequest = mock(DistributionRequest.class);
+        List<DistributionPackage> distributionPackages = localdistributionPackageExporter.exportPackages(resourceResolver, distributionRequest);
+        assertNotNull(distributionPackages);
+        assertTrue(distributionPackages.isEmpty());
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/exporter/RemoteReplicationPackageExporterTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/exporter/RemoteDistributionPackageExporterTest.java Fri Nov  7 10:28:02 2014
@@ -16,16 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.packaging.impl.exporter;
+package org.apache.sling.distribution.packaging.impl.exporter;
 
 import java.util.List;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.communication.ReplicationRequest;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.transport.impl.TransportEndpointStrategyType;
+import org.apache.sling.distribution.communication.DistributionRequest;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.impl.TransportEndpointStrategyType;
 import org.junit.Test;
 
 import static org.junit.Assert.assertNotNull;
@@ -33,23 +33,23 @@ import static org.junit.Assert.assertTru
 import static org.mockito.Mockito.mock;
 
 /**
- * Testcase for {@link org.apache.sling.replication.packaging.impl.exporter.RemoteReplicationPackageExporter}
+ * Testcase for {@link RemoteDistributionPackageExporter}
  */
-public class RemoteReplicationPackageExporterTest {
+public class RemoteDistributionPackageExporterTest {
 
     @Test
     public void testDummyExport() throws Exception {
-        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
+        DistributionPackageBuilder packageBuilder = mock(DistributionPackageBuilder.class);
         TransportAuthenticationProvider authProvider = mock(TransportAuthenticationProvider.class);
         String[] endpoints = new String[0];
         for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
-            RemoteReplicationPackageExporter remoteReplicationPackageExporter = new RemoteReplicationPackageExporter(
+            RemoteDistributionPackageExporter remotedistributionPackageExporter = new RemoteDistributionPackageExporter(
                     packageBuilder, authProvider, endpoints, strategy.name(), 1);
             ResourceResolver resourceResolver = mock(ResourceResolver.class);
-            ReplicationRequest replicationRequest = mock(ReplicationRequest.class);
-            List<ReplicationPackage> replicationPackages = remoteReplicationPackageExporter.exportPackages(resourceResolver, replicationRequest);
-            assertNotNull(replicationPackages);
-            assertTrue(replicationPackages.isEmpty());
+            DistributionRequest distributionRequest = mock(DistributionRequest.class);
+            List<DistributionPackage> distributionPackages = remotedistributionPackageExporter.exportPackages(resourceResolver, distributionRequest);
+            assertNotNull(distributionPackages);
+            assertTrue(distributionPackages.isEmpty());
         }
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/LocalReplicationPackageImporterTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/LocalDistributionPackageImporterTest.java Fri Nov  7 10:28:02 2014
@@ -16,30 +16,30 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.event.impl.ReplicationEventFactory;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
+import org.apache.sling.distribution.event.impl.DistributionEventFactory;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.serialization.DistributionPackageBuilder;
 import org.junit.Test;
 
 import static org.junit.Assert.assertFalse;
 import static org.mockito.Mockito.mock;
 
 /**
- * Testcase for {@link org.apache.sling.replication.packaging.impl.importer.LocalReplicationPackageImporter}
+ * Testcase for {@link LocalDistributionPackageImporter}
  */
-public class LocalReplicationPackageImporterTest {
+public class LocalDistributionPackageImporterTest {
 
     @Test
     public void testDummyImport() throws Exception {
-        ReplicationPackageBuilder packageBuilder = mock(ReplicationPackageBuilder.class);
-        ReplicationEventFactory eventFactory = mock(ReplicationEventFactory.class);
-        LocalReplicationPackageImporter localReplicationPackageImporter = new LocalReplicationPackageImporter(packageBuilder, eventFactory);
+        DistributionPackageBuilder packageBuilder = mock(DistributionPackageBuilder.class);
+        DistributionEventFactory eventFactory = mock(DistributionEventFactory.class);
+        LocalDistributionPackageImporter localdistributionPackageImporter = new LocalDistributionPackageImporter(packageBuilder, eventFactory);
         ResourceResolver resourceResolver = mock(ResourceResolver.class);
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        boolean success = localReplicationPackageImporter.importPackage(resourceResolver, replicationPackage);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        boolean success = localdistributionPackageImporter.importPackage(resourceResolver, distributionPackage);
         assertFalse(success);
     }
 }

Copied: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterTest.java (from r1637123, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterTest.java?p2=sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterTest.java&r1=1637123&r2=1637333&rev=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/packaging/impl/importer/RemoteReplicationPackageImporterTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporterTest.java Fri Nov  7 10:28:02 2014
@@ -16,32 +16,32 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.packaging.impl.importer;
+package org.apache.sling.distribution.packaging.impl.importer;
 
 import org.apache.sling.api.resource.ResourceResolver;
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
-import org.apache.sling.replication.transport.impl.TransportEndpointStrategyType;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.transport.authentication.TransportAuthenticationProvider;
+import org.apache.sling.distribution.transport.impl.TransportEndpointStrategyType;
 import org.junit.Test;
 
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 
 /**
- * Testcase for {@link org.apache.sling.replication.packaging.impl.importer.RemoteReplicationPackageImporter}
+ * Testcase for {@link RemoteDistributionPackageImporter}
  */
-public class RemoteReplicationPackageImporterTest {
+public class RemoteDistributionPackageImporterTest {
 
     @Test
     public void testDummyImport() throws Exception {
         TransportAuthenticationProvider authenticationProvider = mock(TransportAuthenticationProvider.class);
         String[] endpoints = new String[0];
         for (TransportEndpointStrategyType strategy : TransportEndpointStrategyType.values()) {
-            RemoteReplicationPackageImporter remoteReplicationPackageImporter = new RemoteReplicationPackageImporter(
+            RemoteDistributionPackageImporter remotedistributionPackageImporter = new RemoteDistributionPackageImporter(
                     authenticationProvider, endpoints, strategy.name());
             ResourceResolver resourceResolver = mock(ResourceResolver.class);
-            ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-            boolean success = remoteReplicationPackageImporter.importPackage(resourceResolver, replicationPackage);
+            DistributionPackage distributionPackage = mock(DistributionPackage.class);
+            boolean success = remotedistributionPackageImporter.importPackage(resourceResolver, distributionPackage);
             assertTrue(success);
         }
     }

Modified: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategyTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategyTest.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategyTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/ErrorAwareQueueDistributionStrategyTest.java Fri Nov  7 10:28:02 2014
@@ -16,12 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl;
+package org.apache.sling.distribution.queue.impl;
 
 import java.util.Dictionary;
 
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.queue.*;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.*;
 import org.junit.Test;
 import org.osgi.service.component.ComponentContext;
 
@@ -34,20 +34,20 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link org.apache.sling.replication.queue.impl.ErrorAwareQueueDistributionStrategy}
+ * Testcase for {@link org.apache.sling.distribution.queue.impl.ErrorAwareQueueDistributionStrategy}
  */
 public class ErrorAwareQueueDistributionStrategyTest {
 
     @Test
     public void testPackageAdditionWithSucceedingItemDelivery() throws Exception {
         ErrorAwareQueueDistributionStrategy errorAwareDistributionStrategy = new ErrorAwareQueueDistributionStrategy();
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
 
         assertTrue(returnedState);
     }
@@ -55,17 +55,17 @@ public class ErrorAwareQueueDistribution
     @Test
     public void testPackageAdditionWithFailingItemDelivery() throws Exception {
         ErrorAwareQueueDistributionStrategy errorAwareDistributionStrategy = new ErrorAwareQueueDistributionStrategy();
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        ReplicationQueueItem queueItem = mock(ReplicationQueueItem.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        DistributionQueueItem queueItem = mock(DistributionQueueItem.class);
 
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
         when(queue.add(queueItem)).thenReturn(true);
-        ReplicationQueueItemState state = mock(ReplicationQueueItemState.class);
+        DistributionQueueItemState state = mock(DistributionQueueItemState.class);
         when(state.isSuccessful()).thenReturn(false);
         when(queue.getStatus(queueItem)).thenReturn(state);
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
         assertFalse(returnedState);
     }
 
@@ -78,22 +78,22 @@ public class ErrorAwareQueueDistribution
         when(properties.get("stuck.handling")).thenReturn(new String[]{"ERROR"});
         when(context.getProperties()).thenReturn(properties);
         errorAwareDistributionStrategy.activate(context);
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        ReplicationQueueItem queueItem = mock(ReplicationQueueItem.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        DistributionQueueItem queueItem = mock(DistributionQueueItem.class);
 
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
         when(queue.add(queueItem)).thenReturn(true);
         when(queue.getHead()).thenReturn(queueItem);
-        ReplicationQueue errorQueue = mock(ReplicationQueue.class);
+        DistributionQueue errorQueue = mock(DistributionQueue.class);
         when(errorQueue.add(queueItem)).thenReturn(true);
         when(queueProvider.getQueue(ErrorAwareQueueDistributionStrategy.ERROR_QUEUE_NAME)).thenReturn(errorQueue);
-        ReplicationQueueItemState state = mock(ReplicationQueueItemState.class);
+        DistributionQueueItemState state = mock(DistributionQueueItemState.class);
         when(state.isSuccessful()).thenReturn(false);
         when(state.getAttempts()).thenReturn(2);
-        when(queue.getStatus(any(ReplicationQueueItem.class))).thenReturn(state);
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        when(queue.getStatus(any(DistributionQueueItem.class))).thenReturn(state);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
         assertFalse(returnedState);
     }
 
@@ -106,44 +106,44 @@ public class ErrorAwareQueueDistribution
         when(properties.get("stuck.handling")).thenReturn(new String[]{"DROP"});
         when(context.getProperties()).thenReturn(properties);
         errorAwareDistributionStrategy.activate(context);
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
-        when(queue.getHead()).thenReturn(mock(ReplicationQueueItem.class));
-        ReplicationQueueItemState state = mock(ReplicationQueueItemState.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
+        when(queue.getHead()).thenReturn(mock(DistributionQueueItem.class));
+        DistributionQueueItemState state = mock(DistributionQueueItemState.class);
         when(state.isSuccessful()).thenReturn(false);
         when(state.getAttempts()).thenReturn(2);
-        when(queue.getStatus(any(ReplicationQueueItem.class))).thenReturn(state);
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        when(queue.getStatus(any(DistributionQueueItem.class))).thenReturn(state);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
     @Test
     public void testPackageAdditionWithNullItemStateFromTheQueue() throws Exception {
         ErrorAwareQueueDistributionStrategy errorAwareDistributionStrategy = new ErrorAwareQueueDistributionStrategy();
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
     @Test
     public void testPackageAdditionWithNotNullItemStateFromTheQueue() throws Exception {
         ErrorAwareQueueDistributionStrategy errorAwareDistributionStrategy = new ErrorAwareQueueDistributionStrategy();
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = errorAwareDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = errorAwareDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 }

Modified: sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDistributionStrategyTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDistributionStrategyTest.java?rev=1637333&r1=1637123&r2=1637333&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDistributionStrategyTest.java (original)
+++ sling/trunk/contrib/extensions/distribution/core/src/test/java/org/apache/sling/distribution/queue/impl/PriorityPathQueueDistributionStrategyTest.java Fri Nov  7 10:28:02 2014
@@ -16,14 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.replication.queue.impl;
+package org.apache.sling.distribution.queue.impl;
 
-import java.util.Dictionary;
-
-import org.apache.sling.replication.packaging.ReplicationPackage;
-import org.apache.sling.replication.queue.*;
+import org.apache.sling.distribution.packaging.DistributionPackage;
+import org.apache.sling.distribution.queue.*;
 import org.junit.Test;
-import org.osgi.service.component.ComponentContext;
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -34,7 +31,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 /**
- * Testcase for {@link org.apache.sling.replication.queue.impl.PriorityPathDistributionStrategy}
+ * Testcase for {@link org.apache.sling.distribution.queue.impl.PriorityPathDistributionStrategy}
  */
 public class PriorityPathQueueDistributionStrategyTest {
 
@@ -42,14 +39,14 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithSucceedingItemDelivery() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/etc"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/etc"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -57,14 +54,14 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithSucceedingItemDeliveryOnPriorityPath() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/content/sample1"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/content/sample1"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
         when(queueProvider.getQueue("/content")).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -72,14 +69,14 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithFailingItemDelivery() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/etc"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/etc"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -87,15 +84,15 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithFailingItemDeliveryOnPriorityPath() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/content/sample2"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/content/sample2"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
 
         when(queueProvider.getQueue("/content")).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -103,14 +100,14 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithNullItemStateFromTheQueue() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/etc"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/etc"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -118,14 +115,14 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithNullItemStateFromTheQueueOnPriorityPath() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/apps/some/stuff"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/apps/some/stuff"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
 
         when(queueProvider.getQueue("/apps")).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -133,13 +130,13 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithNotNullItemStateFromTheQueue() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/etc"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
-        when(queueProvider.getQueue(ReplicationQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/etc"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
+        when(queueProvider.getQueue(DistributionQueueDistributionStrategy.DEFAULT_QUEUE_NAME)).thenReturn(queue);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 
@@ -147,15 +144,15 @@ public class PriorityPathQueueDistributi
     public void testPackageAdditionWithNotNullItemStateFromTheQueueOnPriorityPath() throws Exception {
         PriorityPathDistributionStrategy priorityPathDistributionStrategy = new PriorityPathDistributionStrategy(new String[]{"/content", "/apps"});
 
-        ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
-        when(replicationPackage.getPaths()).thenReturn(new String[]{"/apps"});
-        ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
-        ReplicationQueue queue = mock(ReplicationQueue.class);
+        DistributionPackage distributionPackage = mock(DistributionPackage.class);
+        when(distributionPackage.getPaths()).thenReturn(new String[]{"/apps"});
+        DistributionQueueProvider queueProvider = mock(DistributionQueueProvider.class);
+        DistributionQueue queue = mock(DistributionQueue.class);
 
         when(queueProvider.getQueue("/apps")).thenReturn(queue);
-        when(queue.add(any(ReplicationQueueItem.class))).thenReturn(true);
+        when(queue.add(any(DistributionQueueItem.class))).thenReturn(true);
 
-        boolean returnedState = priorityPathDistributionStrategy.add(replicationPackage, queueProvider);
+        boolean returnedState = priorityPathDistributionStrategy.add(distributionPackage, queueProvider);
         assertTrue(returnedState);
     }
 }



Mime
View raw message