From cb8557e068ec89473dcb4d01a68e7dfd0a4644c5 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 15 Feb 2019 12:24:14 -0500 Subject: Test gson in policy-management Added jackson-like Gson annotations to policy-management classes. Also added tests to verify that the classes serialize the same with gson as with jackson. Removed some trailing spaces. Replaced tabs and adjusted spacing in json files. Removed trailing newlines. Updated license data per review comment. Fixed merge conflict. Added files that were inadvertently deleted. Change-Id: Ib546e70f9d9d83187a6a93ff5c634000c4d53da5 Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn --- .../main/java/org/onap/policy/drools/system/PolicyEngine.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java') diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java index e08b3704..959114a2 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * policy-management * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,8 @@ import org.onap.policy.common.endpoints.event.comm.TopicSource; import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactory; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; +import org.onap.policy.common.gson.annotation.GsonJsonIgnore; +import org.onap.policy.common.gson.annotation.GsonJsonProperty; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.core.PolicyContainer; import org.onap.policy.drools.core.jmx.PdpJmxListener; @@ -431,6 +433,7 @@ class PolicyEngineManager implements PolicyEngine { } @JsonIgnore + @GsonJsonIgnore @Override public synchronized Properties getEnvironment() { return this.environment; @@ -1167,12 +1170,14 @@ class PolicyEngineManager implements PolicyEngine { } @JsonIgnore + @GsonJsonIgnore @Override public List getPolicyControllers() { return getControllerFactory().inventory(); } @JsonProperty("controllers") + @GsonJsonProperty("controllers") @Override public List getPolicyControllerIds() { final List controllerNames = new ArrayList<>(); @@ -1184,6 +1189,7 @@ class PolicyEngineManager implements PolicyEngine { @Override @JsonIgnore + @GsonJsonIgnore public Properties getProperties() { return this.properties; } @@ -1216,6 +1222,7 @@ class PolicyEngineManager implements PolicyEngine { } @JsonIgnore + @GsonJsonIgnore @Override public List getFeatureProviders() { return getEngineProviders(); -- cgit 1.2.3-korg