sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1616781 [2/2] - in /sling/trunk/contrib/extensions/replication: core/src/main/java/org/apache/sling/replication/agent/impl/ core/src/main/java/org/apache/sling/replication/rule/impl/ core/src/main/java/org/apache/sling/replication/serializ...
Date Fri, 08 Aug 2014 14:32:48 GMT
Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/importer/RemoteReplicationPackageImporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/importer/RemoteReplicationPackageImporter.java?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/importer/RemoteReplicationPackageImporter.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/transport/impl/importer/RemoteReplicationPackageImporter.java
Fri Aug  8 14:32:47 2014
@@ -18,42 +18,32 @@
  */
 package org.apache.sling.replication.transport.impl.importer;
 
-import org.apache.commons.io.IOUtils;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.felix.scr.annotations.*;
-import org.apache.http.client.fluent.Content;
 import org.apache.http.client.fluent.Executor;
-import org.apache.http.client.fluent.Request;
-import org.apache.http.client.fluent.Response;
-import org.apache.http.entity.ContentType;
 import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.replication.agent.ReplicationAgentConfiguration;
 import org.apache.sling.replication.communication.ReplicationEndpoint;
-import org.apache.sling.replication.communication.ReplicationHeader;
 import org.apache.sling.replication.event.ReplicationEventFactory;
-import org.apache.sling.replication.event.ReplicationEventType;
 import org.apache.sling.replication.serialization.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuildingException;
 import org.apache.sling.replication.serialization.ReplicationPackageImporter;
 import org.apache.sling.replication.serialization.ReplicationPackageReadingException;
-import org.apache.sling.replication.transport.TransportHandler;
-import org.apache.sling.replication.transport.authentication.TransportAuthenticationContext;
+import org.apache.sling.replication.transport.ReplicationTransportHandler;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProvider;
 import org.apache.sling.replication.transport.authentication.TransportAuthenticationProviderFactory;
-import org.apache.sling.replication.transport.authentication.impl.UserCredentialsTransportAuthenticationProviderFactory;
+import org.apache.sling.replication.transport.impl.MultipleEndpointReplicationTransportHandler;
+import org.apache.sling.replication.transport.impl.SimpleHttpReplicationTransportHandler;
+import org.apache.sling.replication.transport.impl.TransportEndpointStrategyType;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Map;
-
 /**
- * Default implementation of {@link org.apache.sling.replication.serialization.ReplicationPackageImporter}
+ * Remote implementation of {@link org.apache.sling.replication.serialization.ReplicationPackageImporter}
  */
 @Component(label = "Remote Replication Package Importer", configurationFactory = true)
 @Service(value = ReplicationPackageImporter.class)
@@ -61,91 +51,69 @@ public class RemoteReplicationPackageImp
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Property
-    private static final String NAME = "name";
-
     @Property(name = ReplicationAgentConfiguration.TRANSPORT_AUTHENTICATION_FACTORY)
     @Reference(name = "TransportAuthenticationProviderFactory", policy = ReferencePolicy.DYNAMIC)
     private TransportAuthenticationProviderFactory transportAuthenticationProviderFactory;
 
+    @Property(options = {
+            @PropertyOption(name = "All",
+                    value = "all endpoints"
+            ),
+            @PropertyOption(name = "One",
+                    value = "one endpoint"
+            )},
+            value = "One"
+    )
+    private static final String ENDPOINT_STRATEGY = ReplicationAgentConfiguration.ENDPOINT_STRATEGY;
+
     @Reference
     private ReplicationEventFactory replicationEventFactory;
 
-    TransportAuthenticationProvider<Executor, Executor>  transportAuthenticationProvider;
-    ReplicationEndpoint replicationEndpoint;
+    private ReplicationTransportHandler transportHandler;
 
     @Activate
     protected void activate(BundleContext context, Map<String, ?> config) throws Exception
{
 
         Map<String, String> authenticationProperties = PropertiesUtil.toMap(config.get(ReplicationAgentConfiguration.AUTHENTICATION_PROPERTIES),
new String[0]);
 
-        transportAuthenticationProvider = (TransportAuthenticationProvider<Executor, Executor>)
transportAuthenticationProviderFactory.createAuthenticationProvider(authenticationProperties);
+        TransportAuthenticationProvider<Executor, Executor> transportAuthenticationProvider
= (TransportAuthenticationProvider<Executor, Executor>)
+                transportAuthenticationProviderFactory.createAuthenticationProvider(authenticationProperties);
 
         String[] endpoints = PropertiesUtil.toStringArray(config.get(ReplicationAgentConfiguration.ENDPOINT),
new String[0]);
 
-        replicationEndpoint = new ReplicationEndpoint(endpoints[0]);
+        String endpointStrategyName = PropertiesUtil.toString(config.get(ENDPOINT_STRATEGY),
+                TransportEndpointStrategyType.One.name());
+        TransportEndpointStrategyType transportEndpointStrategyType = TransportEndpointStrategyType.valueOf(endpointStrategyName);
+
+        List<ReplicationTransportHandler> transportHandlers = new ArrayList<ReplicationTransportHandler>();
+
+        for (String endpoint : endpoints) {
+            if (endpoint != null && endpoint.length() > 0) {
+                transportHandlers.add(new SimpleHttpReplicationTransportHandler(transportAuthenticationProvider,
+                        new ReplicationEndpoint(endpoint), null, -1));
+            }
+        }
+        transportHandler = new MultipleEndpointReplicationTransportHandler(transportHandlers,
+                transportEndpointStrategyType);
+
     }
 
 
     public boolean importPackage(ReplicationPackage replicationPackage) {
-
+        boolean result = false;
         try {
-           deliverPackageToEndpoint(replicationPackage, replicationEndpoint);
-
-            return true;
+            transportHandler.deliverPackage(replicationPackage);
+            result = true;
         } catch (Exception e) {
-
+            if (log.isErrorEnabled()) {
+                log.error("failed in importing package {} due to {}", replicationPackage,
e);
+            }
         }
-
-        return false;
+        return result;
     }
 
     public ReplicationPackage readPackage(InputStream stream) throws ReplicationPackageReadingException
{
-
         return null;
     }
 
-
-    public void deliverPackageToEndpoint(ReplicationPackage replicationPackage,
-                                         ReplicationEndpoint replicationEndpoint) throws
Exception {
-        log.info("delivering package {} to {} using auth {}",
-                new Object[]{replicationPackage.getId(),
-                        replicationEndpoint.getUri(), transportAuthenticationProvider});
-
-
-        Executor executor = Executor.newInstance();
-        TransportAuthenticationContext context = new TransportAuthenticationContext();
-        context.addAttribute("endpoint", replicationEndpoint);
-        executor =  transportAuthenticationProvider.authenticate(executor, context);
-
-        Request req = Request.Post(replicationEndpoint.getUri()).useExpectContinue();
-
-
-        InputStream inputStream = null;
-        Response response = null;
-        try{
-
-            inputStream = replicationPackage.createInputStream();
-
-
-            if(inputStream != null) {
-                req = req.bodyStream(inputStream, ContentType.APPLICATION_OCTET_STREAM);
-            }
-
-            response = executor.execute(req);
-        }
-        finally {
-            IOUtils.closeQuietly(inputStream);
-        }
-
-        if (response != null) {
-            Content content = response.returnContent();
-            log.info("Replication content of type {} for {} delivered: {}", new Object[]{
-                    replicationPackage.getType(), Arrays.toString(replicationPackage.getPaths()),
content});
-        }
-        else {
-            throw new IOException("response is empty");
-        }
-    }
-
 }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-cache-flush.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-cache-flush.json?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-cache-flush.json
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-cache-flush.json
Fri Aug  8 14:32:47 2014
@@ -1,10 +1,9 @@
 {
     "jcr:primaryType" : "sling:OsgiConfig",
     "name" : "cache-flush",
-    "TransportHandler.target" : "(name=http-cache-flush)",
+    "ReplicationPackageImporter.target" : "(name=cache-flush)",
     "useAggregatePaths" : false,
     "ReplicationPackageExporter.target" : "(name=void)",
-    "ReplicationQueueProvider.target" : "(name=simple)",
     "ReplicationQueueDistributionStrategy.target" : "(name=single)",
     "rules" : ["trigger on path: /content/usergenerated"],
     "enabled" : false,

Added: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.transport.impl.importer.AdvancedRemoteReplicationPackageImporter-cache-flush.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.transport.impl.importer.AdvancedRemoteReplicationPackageImporter-cache-flush.json?rev=1616781&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.transport.impl.importer.AdvancedRemoteReplicationPackageImporter-cache-flush.json
(added)
+++ sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.transport.impl.importer.AdvancedRemoteReplicationPackageImporter-cache-flush.json
Fri Aug  8 14:32:47 2014
@@ -0,0 +1,13 @@
+{
+    "jcr:primaryType" : "sling:OsgiConfig",
+    "name" : "cache-flush",
+    "useCustomHeaders" : true,
+    "customHeaders" : [
+            "Path: {path}",
+            "add -> Action : REFRESH",
+            "delete -> Change : REMOVE" ],
+    "useCustomBody": true,
+    "customBody" : "",
+    "TransportAuthenticationProviderFactory.target" : "(name=nop)",
+    "endpoints" : [ "http://localhost:8000/invalidatecache" ]
+}
\ No newline at end of file

Modified: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/resourceproviders/configs/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-agentsConfig.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/resourceproviders/configs/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-agentsConfig.json?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/resourceproviders/configs/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-agentsConfig.json
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/resourceproviders/configs/org.apache.sling.replication.resources.impl.OsgiPropertiesResourceProviderFactory-agentsConfig.json
Fri Aug  8 14:32:47 2014
@@ -12,7 +12,6 @@
         "packageExporter={ReplicationPackageExporter.target}",
         "packageImporter={ReplicationPackageImporter.target}",
         "queueStrategy={ReplicationQueueDistributionStrategy.target}",
-        "transportHandler={TransportHandler.target}"
     ]
 
 

Modified: sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/ReplicationAgentServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/ReplicationAgentServiceFactoryTest.java?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/ReplicationAgentServiceFactoryTest.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/ReplicationAgentServiceFactoryTest.java
Fri Aug  8 14:32:47 2014
@@ -24,10 +24,8 @@ import java.util.Map;
 import org.apache.sling.replication.agent.AgentConfigurationException;
 import org.apache.sling.replication.queue.ReplicationQueueDistributionStrategy;
 import org.apache.sling.replication.queue.ReplicationQueueProvider;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
 import org.apache.sling.replication.serialization.ReplicationPackageExporter;
 import org.apache.sling.replication.serialization.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.TransportHandler;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
 

Modified: 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/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/agent/impl/SimpleReplicationAgentTest.java
Fri Aug  8 14:32:47 2014
@@ -29,12 +29,12 @@ import org.apache.sling.replication.queu
 import org.apache.sling.replication.queue.ReplicationQueueProvider;
 import org.apache.sling.replication.queue.impl.simple.SimpleReplicationQueue;
 import org.apache.sling.replication.serialization.ReplicationPackage;
-import org.apache.sling.replication.serialization.ReplicationPackageBuilder;
 import org.apache.sling.replication.serialization.ReplicationPackageExporter;
 import org.apache.sling.replication.serialization.ReplicationPackageImporter;
-import org.apache.sling.replication.transport.TransportHandler;
 import org.junit.Test;
 
+import java.util.Arrays;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -51,7 +51,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testSyncReplicationWithFailingDistributionStrategy() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
 
@@ -64,8 +63,9 @@ public class SimpleReplicationAgentTest 
         ReplicationRequest request = new ReplicationRequest(System.nanoTime(),
                 ReplicationActionType.ADD, "/");
         ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
+
         when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
-        when(packageExporter.exportPackage(request)).thenReturn(replicationPackage);
+        when(packageExporter.exportPackage(request)).thenReturn(Arrays.asList(new ReplicationPackage[]
{ replicationPackage } ));
         when(queueProvider.getDefaultQueue(agent.getName())).thenReturn(
                 new SimpleReplicationQueue(agent.getName(), "name"));
         ReplicationResponse response = agent.execute(request);
@@ -76,7 +76,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testSyncReplicationWithWorkingDistributionStrategy() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
       ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
         ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
@@ -90,7 +89,7 @@ public class SimpleReplicationAgentTest 
         ReplicationQueueItemState state = new ReplicationQueueItemState();
         state.setItemState(ReplicationQueueItemState.ItemState.SUCCEEDED);
         when(distributionHandler.add(any(String.class), any(ReplicationQueueItem.class),
eq(queueProvider))).thenReturn(state);
-        when(packageExporter.exportPackage(any(ReplicationRequest.class))).thenReturn(replicationPackage);
+        when(packageExporter.exportPackage(any(ReplicationRequest.class))).thenReturn(Arrays.asList(new
ReplicationPackage[] { replicationPackage } ));
         when(queueProvider.getDefaultQueue(agent.getName())).thenReturn(
                 new SimpleReplicationQueue(agent.getName(), "name"));
         ReplicationResponse response = agent.execute(request);
@@ -101,7 +100,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testAsyncReplication() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
       ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
         ReplicationQueueDistributionStrategy distributionHandler = mock(ReplicationQueueDistributionStrategy.class);
@@ -112,7 +110,7 @@ public class SimpleReplicationAgentTest 
                 ReplicationActionType.ADD, "/");
         ReplicationPackage replicationPackage = mock(ReplicationPackage.class);
         when(replicationPackage.getPaths()).thenReturn(new String[]{"/"});
-        when(packageExporter.exportPackage(request)).thenReturn(replicationPackage);
+        when(packageExporter.exportPackage(request)).thenReturn(Arrays.asList(new ReplicationPackage[]
{ replicationPackage } ));
         when(queueProvider.getDefaultQueue(agent.getName())).thenReturn(
                 new SimpleReplicationQueue(agent.getName(), "name"));
         agent.send(request);
@@ -121,7 +119,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetDefaultQueue() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
         ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
@@ -136,7 +133,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetExistingNamedQueue() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
         ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);
@@ -151,7 +147,6 @@ public class SimpleReplicationAgentTest 
     @Test
     public void testGetNonExistingNamedQueue() throws Exception {
         String name = "sample-agent";
-        TransportHandler transportHandler = mock(TransportHandler.class);
         ReplicationPackageImporter packageImporter = mock(ReplicationPackageImporter.class);
         ReplicationPackageExporter packageExporter = mock(ReplicationPackageExporter.class);
         ReplicationQueueProvider queueProvider = mock(ReplicationQueueProvider.class);

Copied: sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandlerTest.java
(from r1616736, sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/HttpTransportHandlerCustomHeadersTest.java)
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandlerTest.java?p2=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandlerTest.java&p1=sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/HttpTransportHandlerCustomHeadersTest.java&r1=1616736&r2=1616781&rev=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/HttpTransportHandlerCustomHeadersTest.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/test/java/org/apache/sling/replication/transport/impl/AdvancedHttpReplicationTransportHandlerTest.java
Fri Aug  8 14:32:47 2014
@@ -16,21 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.sling.replication.transport.impl;
 
+import java.util.Arrays;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import java.util.Arrays;
-
 import static org.junit.Assert.assertArrayEquals;
 
-
+/**
+ * Testcase for {@link AdvancedHttpReplicationTransportHandler}
+ */
 @RunWith(Parameterized.class)
-public class HttpTransportHandlerCustomHeadersTest {
+public class AdvancedHttpReplicationTransportHandlerTest {
 
     private final String[] inputTransportProperties;
     private final String inputSelector;
@@ -42,28 +42,28 @@ public class HttpTransportHandlerCustomH
     @Parameterized.Parameters
     public static Iterable<Object[]> data() {
         return Arrays.asList(new Object[][]{
-                { new String[]{}, "", new String[] {},
+                {new String[]{}, "", new String[]{},
                         new String[]{}},
-                { new String[]{}, "add", new String[] {},
+                {new String[]{}, "add", new String[]{},
                         new String[]{}},
-                { new String[]{"add -> Header: Add" }, "add", new String[] {},
-                        new String[]{ "Header: Add" }},
-                { new String[]{"add -> Header: Add", "Header: Always" }, "add", new String[]
{},
-                        new String[]{ "Header: Add", "Header: Always" }},
-                { new String[]{"add -> Header: Add", "* -> Header: Always", "delete
-> Header:Del" }, "add", new String[] {},
-                        new String[]{"Header: Add", "Header: Always" }},
-                { new String[]{"add -> Header: Add", "Header: Always" }, "delete", new
String[] {},
-                        new String[]{"Header: Always" }},
-                { new String[]{"add -> Header: Add", "Header: Always" }, "add", new String[]
{},
-                        new String[] {"Header: Add", "Header: Always" }},
-                { new String[]{"add -> Header: Add", "Header: Always", "PathHeader: {path}"
}, "add", new String[] { "/content"},
+                {new String[]{"add -> Header: Add"}, "add", new String[]{},
+                        new String[]{"Header: Add"}},
+                {new String[]{"add -> Header: Add", "Header: Always"}, "add", new String[]{},
+                        new String[]{"Header: Add", "Header: Always"}},
+                {new String[]{"add -> Header: Add", "* -> Header: Always", "delete
-> Header:Del"}, "add", new String[]{},
+                        new String[]{"Header: Add", "Header: Always"}},
+                {new String[]{"add -> Header: Add", "Header: Always"}, "delete", new String[]{},
+                        new String[]{"Header: Always"}},
+                {new String[]{"add -> Header: Add", "Header: Always"}, "add", new String[]{},
+                        new String[]{"Header: Add", "Header: Always"}},
+                {new String[]{"add -> Header: Add", "Header: Always", "PathHeader: {path}"},
"add", new String[]{"/content"},
                         new String[]{"Header: Add", "Header: Always", "PathHeader: /content"}},
         });
 
     }
 
-    public HttpTransportHandlerCustomHeadersTest(String[] inputTransportProperties, String
inputSelector, String[] inputPaths,
-                                                 String[] outputHeaders){
+    public AdvancedHttpReplicationTransportHandlerTest(String[] inputTransportProperties,
String inputSelector, String[] inputPaths,
+                                                       String[] outputHeaders) {
         this.inputTransportProperties = inputTransportProperties;
         this.inputSelector = inputSelector;
         this.outputHeaders = outputHeaders;
@@ -71,8 +71,8 @@ public class HttpTransportHandlerCustomH
     }
 
     @Test
-    public void testHttpTransportProperties () {
-        String[] headers = HttpTransportHandler.getCustomizedHeaders (inputTransportProperties,
inputSelector, inputPaths);
+    public void testHttpTransportProperties() {
+        String[] headers = AdvancedHttpReplicationTransportHandler.getCustomizedHeaders(inputTransportProperties,
inputSelector, inputPaths);
 
         assertArrayEquals(outputHeaders, headers);
     }

Modified: sling/trunk/contrib/extensions/replication/it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/it/pom.xml?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/it/pom.xml (original)
+++ sling/trunk/contrib/extensions/replication/it/pom.xml Fri Aug  8 14:32:47 2014
@@ -281,7 +281,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.tools</artifactId>
-            <version>1.0.9-SNAPSHOT</version>
+            <version>1.0.8</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationAgentResourcesIntegrationTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationAgentResourcesIntegrationTest.java?rev=1616781&r1=1616780&r2=1616781&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationAgentResourcesIntegrationTest.java
(original)
+++ sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationAgentResourcesIntegrationTest.java
Fri Aug  8 14:32:47 2014
@@ -131,11 +131,11 @@ public class ReplicationAgentResourcesIn
 
         authorClient.createNode(newConfigResource, "name", agentName, "transportHandler",
"(name=author)");
         assertExists(authorClient, newConfigResource);
-        authorClient.setProperties(newConfigResource, "transportHandler", "(name=updated)");
+        authorClient.setProperties(newConfigResource, "packageExporter", "(name=updated)");
         assertResponseContains(author, newConfigResource,
                 "sling:resourceType", "replication/config/agent",
                 "name", agentName,
-                "transportHandler", "(name=updated)");
+                "packageExporter", "(name=updated)");
     }
 
 }
\ No newline at end of file



Mime
View raw message