From 069dbb206cedae6c664972cfb8baf036989d61a0 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 25 Jun 2020 11:12:36 -0400 Subject: Use parent snapshot in drools-apps Fixed checkstyle issues that were subsequently reported. Also fixed a few eclipse warnings. Also fixed some of the sonar issues in the files that were touched: - use "{}" in logger calls - camelcase method names - use "" instead of generics - add serialization ID Issue-ID: POLICY-2188 Change-Id: I5c94a2e26dd74a61a0a919e1c3da17ab02a5bc9d Signed-off-by: Jim Hahn --- .../src/test/java/org/onap/policy/m2/test/AppcLcmTest.java | 2 +- .../test/src/test/java/org/onap/policy/m2/test/SimDmaap.java | 10 ++++------ .../test/src/test/java/org/onap/policy/m2/test/SimGuard.java | 3 --- .../m2/test/src/test/java/org/onap/policy/m2/test/Util.java | 7 ++----- 4 files changed, 7 insertions(+), 15 deletions(-) (limited to 'controlloop/m2/test') diff --git a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/AppcLcmTest.java b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/AppcLcmTest.java index a35e8c6ae..31003cba3 100644 --- a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/AppcLcmTest.java +++ b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/AppcLcmTest.java @@ -87,7 +87,7 @@ public class AppcLcmTest { "${notificationTopic}", "NOTIFICATION-APPCLCM-TOPIC", "${operationTopic}", "APPC-REQUEST-APPCLCM-TOPIC", "${policyName}", "appclcm", - "${policyScope}", "service=vUSP;resource=vCTS;type=operational" , + "${policyScope}", "service=vUSP;resource=vCTS;type=operational", "${policyVersion}", "org.onap.policy.m2.test:appclcm:" + projectVersion, "${unique}", "2"); diff --git a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimDmaap.java b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimDmaap.java index 925e9451f..1c11fccdb 100644 --- a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimDmaap.java +++ b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimDmaap.java @@ -25,7 +25,6 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; - import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; @@ -34,7 +33,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +45,7 @@ public class SimDmaap { private static Logger logger = LoggerFactory.getLogger(SimDmaap.class); // maps topic name to 'Topic' instance - static Map topicTable = new ConcurrentHashMap<>(); + static Map topicTable = new ConcurrentHashMap<>(); /** * Each instance of this class corresponds to a DMAAP or UEB topic. @@ -57,7 +55,7 @@ public class SimDmaap { String topic; // maps group name into group instance - Map groupTable = new ConcurrentHashMap<>(); + Map groupTable = new ConcurrentHashMap<>(); /** * Create or get a Topic. @@ -114,7 +112,7 @@ public class SimDmaap { // no more messages break; } - String[] prefix = data.substring(cur,leftBrace).split("\\."); + String[] prefix = data.substring(cur, leftBrace).split("\\."); if (prefix.length == 3) { try { // determine length of message, and advance current position @@ -216,7 +214,7 @@ public class SimDmaap { builder.append("[\"").append(message); // add up to '-1' more messages - for (int i = 1 ; i < limit ; i += 1) { + for (int i = 1; i < limit; i += 1) { // fetch the next message -- don't wait if it isn't currently there message = messages.poll(); if (message == null) { diff --git a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimGuard.java b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimGuard.java index 578dd6dc3..67df8503a 100644 --- a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimGuard.java +++ b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimGuard.java @@ -21,16 +21,13 @@ package org.onap.policy.m2.test; import com.google.gson.JsonObject; - import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; - import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/Util.java b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/Util.java index 48155fd88..f6740f83b 100644 --- a/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/Util.java +++ b/controlloop/m2/test/src/test/java/org/onap/policy/m2/test/Util.java @@ -28,13 +28,11 @@ import com.att.nsa.cambria.client.CambriaClientBuilders; import com.att.nsa.cambria.client.CambriaClientBuilders.ConsumerBuilder; import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder; import com.att.nsa.cambria.client.CambriaConsumer; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; - import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -47,7 +45,6 @@ import java.util.Properties; import java.util.UUID; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; - import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.ServletContextHandler; @@ -165,7 +162,7 @@ public class Util { public static String openAndReplace(String fileName, String... args) throws IOException, FileNotFoundException { String text = fileToString(new File(fileName)); - for (int i = 0 ; i < args.length ; i += 2) { + for (int i = 0; i < args.length; i += 2) { text = text.replace(args[i], args[i + 1]); } return text; @@ -202,7 +199,7 @@ public class Util { */ public static JsonObject json(Object... data) { JsonObject obj = new JsonObject(); - for (int i = 0 ; i < data.length ; i += 2) { + for (int i = 0; i < data.length; i += 2) { obj.add(data[i].toString(), toJsonElement(data[i + 1])); } return obj; -- cgit 1.2.3-korg