You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ge...@apache.org on 2017/07/10 14:54:04 UTC
[1/2] brooklyn-server git commit: Revert PolicyConfigResource changes
from the REST API response fix.
Repository: brooklyn-server
Updated Branches:
refs/heads/master 9caf201d1 -> 8c328d0ee
Revert PolicyConfigResource changes from the REST API response fix.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e330c73d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e330c73d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e330c73d
Branch: refs/heads/master
Commit: e330c73de52f7dac8d5e7a81f7e54e367bc2cb91
Parents: 9caf201
Author: Ivana Yovcheva <iv...@gmail.com>
Authored: Mon Jul 10 17:21:21 2017 +0300
Committer: Ivana Yovcheva <iv...@gmail.com>
Committed: Mon Jul 10 17:27:58 2017 +0300
----------------------------------------------------------------------
.../org/apache/brooklyn/rest/resources/PolicyConfigResource.java | 4 ++--
.../org/apache/brooklyn/rest/resources/PolicyResourceTest.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e330c73d/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java
index b362223..6dcdf19 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/PolicyConfigResource.java
@@ -66,7 +66,7 @@ public class PolicyConfigResource extends AbstractBrooklynRestResource implement
((BrooklynObjectInternal)policy).config().getInternalConfigMap().getAllConfigInheritedRawValuesIgnoringErrors() ).getAllConfig();
Map<String, Object> result = Maps.newLinkedHashMap();
for (Map.Entry<String, Object> ek : source.entrySet()) {
- result.put(ek.getKey(), WebResourceUtils.getValueForDisplay(mapper(), getStringValueForDisplay(brooklyn(), policy, ek.getValue()), true, true));
+ result.put(ek.getKey(), getStringValueForDisplay(brooklyn(), policy, ek.getValue()));
}
return result;
}
@@ -77,7 +77,7 @@ public class PolicyConfigResource extends AbstractBrooklynRestResource implement
ConfigKey<?> ck = policy.getPolicyType().getConfigKey(configKeyName);
if (ck == null) throw WebResourceUtils.notFound("Cannot find config key '%s' in policy '%s' of entity '%s'", configKeyName, policy, entityToken);
- return (String) WebResourceUtils.getValueForDisplay(mapper(), getStringValueForDisplay(brooklyn(), policy, policy.getConfig(ck)), true, true);
+ return getStringValueForDisplay(brooklyn(), policy, policy.getConfig(ck));
}
@SuppressWarnings({ "unchecked", "rawtypes" })
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e330c73d/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/PolicyResourceTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/PolicyResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/PolicyResourceTest.java
index 61f60c5..1ba41cc 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/PolicyResourceTest.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/PolicyResourceTest.java
@@ -110,7 +110,7 @@ public class PolicyResourceTest extends BrooklynRestResourceTest {
@Test
public void testGetDefaultValue() throws Exception {
String configName = RestMockSimplePolicy.SAMPLE_CONFIG.getName();
- String expectedVal = (String) WebResourceUtils.getValueForDisplay(mapper(), RestMockSimplePolicy.SAMPLE_CONFIG.getDefaultValue(), true, true);
+ String expectedVal = RestMockSimplePolicy.SAMPLE_CONFIG.getDefaultValue();
String configVal = client().path(ENDPOINT + policyId + "/config/" + configName)
.get(String.class);
@@ -130,7 +130,7 @@ public class PolicyResourceTest extends BrooklynRestResourceTest {
@Test(dependsOnMethods = "testReconfigureConfig")
public void testGetConfigValue() throws Exception {
String configName = RestMockSimplePolicy.SAMPLE_CONFIG.getName();
- String expectedVal = (String) WebResourceUtils.getValueForDisplay(mapper(), "newval", true, true);
+ String expectedVal = "newval";
Map<String, Object> allState = client().path(ENDPOINT + policyId + "/config/current-state")
.get(new GenericType<Map<String, Object>>() {});
[2/2] brooklyn-server git commit: Closes #759
Posted by ge...@apache.org.
Closes #759
Revert PolicyConfigResource changes from the REST API response fix.
Those changes require more careful testing and updates.
We need to revert them from master and reopen in a separate PR.
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8c328d0e
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8c328d0e
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8c328d0e
Branch: refs/heads/master
Commit: 8c328d0ee81c72a17f2f742237ad5e39c16a94df
Parents: 9caf201 e330c73
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Mon Jul 10 15:53:55 2017 +0100
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Mon Jul 10 15:53:55 2017 +0100
----------------------------------------------------------------------
.../org/apache/brooklyn/rest/resources/PolicyConfigResource.java | 4 ++--
.../org/apache/brooklyn/rest/resources/PolicyResourceTest.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------