brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/3] incubator-brooklyn git commit: Adds parentDisplayName to location event metadata
Date Mon, 22 Dec 2014 11:55:36 GMT
Adds parentDisplayName to location event metadata


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3beb5151
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3beb5151
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3beb5151

Branch: refs/heads/master
Commit: 3beb51519a5e18b56973043c122f9f7fef6471a2
Parents: 370187c
Author: Martin Harris <github@nakomis.com>
Authored: Mon Dec 22 11:19:33 2014 +0000
Committer: Martin Harris <github@nakomis.com>
Committed: Mon Dec 22 11:19:33 2014 +0000

----------------------------------------------------------------------
 core/src/main/java/brooklyn/location/basic/AbstractLocation.java  | 3 +++
 .../brooklyn/management/usage/ApplicationUsageTrackingTest.java   | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3beb5151/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/basic/AbstractLocation.java b/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
index e81a6fc..7aa523d 100644
--- a/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
+++ b/core/src/main/java/brooklyn/location/basic/AbstractLocation.java
@@ -569,6 +569,9 @@ public abstract class AbstractLocation extends AbstractBrooklynObject
implements
     public Map<String, String> toMetadataRecord() {
         ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
         if (getDisplayName() != null) builder.put("displayName", getDisplayName());
+        if (getParent() != null && getParent().getDisplayName() != null) {
+            builder.put("parentDisplayName", getParent().getDisplayName());
+        }
         return builder.build();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3beb5151/software/base/src/test/java/brooklyn/management/usage/ApplicationUsageTrackingTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/management/usage/ApplicationUsageTrackingTest.java
b/software/base/src/test/java/brooklyn/management/usage/ApplicationUsageTrackingTest.java
index 5208fce..eab3795 100644
--- a/software/base/src/test/java/brooklyn/management/usage/ApplicationUsageTrackingTest.java
+++ b/software/base/src/test/java/brooklyn/management/usage/ApplicationUsageTrackingTest.java
@@ -99,13 +99,12 @@ public class ApplicationUsageTrackingTest {
                 String appName = (String) events.get(0).get(2);
                 String entityType = (String) events.get(0).get(3);
                 String catalogItemId = (String) events.get(0).get(4);
-                System.out.println(catalogItemId);
                 Map<?,?> metadata = (Map<?, ?>) events.get(0).get(5);
                 ApplicationEvent appEvent = (ApplicationEvent) events.get(0).get(6);
                 
                 assertEquals(appId, app.getId(), "events="+events);
                 assertNotNull(appName, "events="+events);
-                assertEquals(app.getCatalogItemId(), "testCatalogItem");
+                assertEquals(catalogItemId, app.getCatalogItemId(), "events="+events);
                 assertNotNull(entityType, "events="+events);
                 assertNotNull(metadata, "events="+events);
                 assertEquals(appEvent.getState(), Lifecycle.STARTING, "events="+events);


Mime
View raw message