brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [36/39] brooklyn-server git commit: Correct testRebindWithCatalogAndAppRebindCatalogItemIds
Date Fri, 21 Apr 2017 22:55:55 GMT
Correct testRebindWithCatalogAndAppRebindCatalogItemIds


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/51b0b754
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/51b0b754
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/51b0b754

Branch: refs/heads/master
Commit: 51b0b754e0640a6403b11359ecb4467d052c505a
Parents: 81815f9
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Authored: Sat Mar 18 20:04:43 2017 +0000
Committer: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Committed: Thu Apr 20 11:20:36 2017 +0100

----------------------------------------------------------------------
 .../camp/brooklyn/catalog/CatalogYamlRebindTest.java     |  3 ++-
 .../brooklyn/core/mgmt/rebind/dto/AbstractMemento.java   | 11 +++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/51b0b754/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
index 874e301..8daf21c 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
@@ -176,7 +176,8 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest {
     public void testRebindWithCatalogAndAppRebindCatalogItemIds(RebindWithCatalogTestMode
mode, OsgiMode osgiMode) throws Exception {
         final RebindOptions rebindOptions = RebindOptions.create();
         applyCompoundStateTransformer(rebindOptions, CompoundTransformer.builder()
-            .xmlDeleteItem("//catalogItemIdSearchPath")
+            .xmlDeleteItem("//searchPath") // delete searchPath element
+            .xmlDeleteItem("//@*[contains(., 'searchPath')]") // delete any attributes that
reference searchPath
             .build());
         testRebindWithCatalogAndAppUsingOptions(mode, osgiMode, rebindOptions);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/51b0b754/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
index 6e2a0f2..c5e9c9c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
@@ -94,7 +94,7 @@ public abstract class AbstractMemento implements Memento, Serializable {
     private String id;
     private String displayName;
     protected String catalogItemId;
-    private List<String> searchPath;
+    private List<String> searchPath = Lists.newArrayList();
     private List<Object> tags;
     private Map<String,Set<String>> relations;
     
@@ -107,7 +107,14 @@ public abstract class AbstractMemento implements Memento, Serializable
{
     protected AbstractMemento() {
     }
 
-    // Trusts the builder to not mess around with mutability after calling build()
+    protected AbstractMemento readResolve() {
+        if (searchPath == null) {
+            searchPath = Lists.newArrayList();
+        }
+        return this;
+    }
+
+        // Trusts the builder to not mess around with mutability after calling build()
     protected AbstractMemento(Builder<?> builder) {
         brooklynVersion = builder.brooklynVersion;
         id = builder.id;


Mime
View raw message