sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1615933 - in /sling/trunk/contrib/extensions/replication: core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/ core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/ it/src/test/java/org/apache/slin...
Date Tue, 05 Aug 2014 14:06:20 GMT
Author: tommaso
Date: Tue Aug  5 14:06:19 2014
New Revision: 1615933

URL: http://svn.apache.org/r1615933
Log:
SLING-3820 - applying Marius Petria's patch for fixing ITs

Modified:
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java
    sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
    sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-reverse.json
    sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationIntegrationTestBase.java

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java?rev=1615933&r1=1615932&r2=1615933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackage.java
Tue Aug  5 14:06:19 2014
@@ -53,7 +53,7 @@ public class FileVaultReplicationPackage
             paths[i] = filterSets.get(i).getRoot();
         }
         this.paths = paths;
-        this.id = pkg.getFile() != null ? pkg.getFile().getAbsolutePath() : String.valueOf(pkg.getId());
+        this.id = pkg.getId() != null ? String.valueOf(pkg.getId()) : pkg.getFile().getAbsolutePath();
         this.action = ReplicationActionType.ADD.toString();
     }
 

Modified: sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java?rev=1615933&r1=1615932&r2=1615933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
(original)
+++ sling/trunk/contrib/extensions/replication/core/src/main/java/org/apache/sling/replication/serialization/impl/vlt/FileVaultReplicationPackageBuilder.java
Tue Aug  5 14:06:19 2014
@@ -109,8 +109,10 @@ public class FileVaultReplicationPackage
             opts.setMetaInf(inf);
             opts.setRootPath("/");
             File tmpFile = File.createTempFile("vlt-rp-" + System.nanoTime(), ".zip");
-            VaultPackage pkg = packaging.getPackageManager().assemble(session, opts, tmpFile);
-            return new FileVaultReplicationPackage(pkg);
+            packaging.getPackageManager().assemble(session, opts, tmpFile);
+            JcrPackage jcrPackage = packaging.getPackageManager(session).upload(tmpFile,
false, true, null);
+
+            return new FileVaultReplicationPackage(jcrPackage.getPackage());
         } catch (Exception e) {
             throw new ReplicationPackageBuildingException(e);
         } finally {
@@ -167,6 +169,10 @@ public class FileVaultReplicationPackage
                 VaultPackage pkg = packaging.getPackageManager().open(file);
                 replicationPackage = new FileVaultReplicationPackage(pkg);
             }
+            else {
+                VaultPackage pkg = packaging.getPackageManager(getSession()).open(PackageId.fromString(id)).getPackage();
+                replicationPackage = new FileVaultReplicationPackage(pkg);
+            }
         } catch (Exception e) {
             log.warn("could not find a package with id : {}", id);
         }

Modified: sling/trunk/contrib/extensions/replication/core/src/main/resources/SLING-CONTENT/libs/sling/replication/config/publish/org.apache.sling.replication.agent.impl.ReplicationAgentServiceFactory-reverse.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-reverse.json?rev=1615933&r1=1615932&r2=1615933&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-reverse.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-reverse.json
Tue Aug  5 14:06:19 2014
@@ -2,6 +2,7 @@
     "jcr:primaryType" : "sling:OsgiConfig",
     "name" : "reverse",
     "ReplicationPackageExporter.target" : "(name=local)",
+    "ReplicationPackageImporter.target" : "(name=local)",
     "ReplicationQueueProvider.target" : "(name=sjh)",
     "ReplicationQueueDistributionStrategy.target" : "(name=error)",
     "rules" : ["trigger on path: /content/usergenerated"],

Modified: sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationIntegrationTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationIntegrationTestBase.java?rev=1615933&r1=1615932&r2=1615933&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationIntegrationTestBase.java
(original)
+++ sling/trunk/contrib/extensions/replication/it/src/test/java/org/apache/sling/replication/it/ReplicationIntegrationTestBase.java
Tue Aug  5 14:06:19 2014
@@ -49,10 +49,16 @@ public abstract class ReplicationIntegra
 
         try {
             // change the url for publish agent and wait for it to start
-            String receiverUrl = "http://localhost:4503/libs/sling/replication/importers/local"
+            String remoteImporterUrl = "http://localhost:4503/libs/sling/replication/importers/local"
                     .replace("http://localhost:4503", publish.getServerBaseUrl());
             authorClient.setProperties("/libs/sling/replication/config/importers/remote/publish",
-                    "endpoints", receiverUrl);
+                    "endpoints", remoteImporterUrl);
+
+            String remoteExporterUrl = "http://localhost:4503/libs/sling/replication/exporters/agent"
+                    .replace("http://localhost:4503", publish.getServerBaseUrl());
+            authorClient.setProperties("/libs/sling/replication/config/exporters/remote/publish",
+                    "endpoints", remoteExporterUrl);
+
             assertExists(authorClient, "/libs/sling/replication/agents/publish");
         }
         catch (Exception ex) {



Mime
View raw message