summaryrefslogtreecommitdiffstats
path: root/controlloop/m2/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-25 11:12:36 -0400
committerJim Hahn <jrh3@att.com>2020-06-25 11:57:00 -0400
commit069dbb206cedae6c664972cfb8baf036989d61a0 (patch)
treee0a2f0edd840775000c947811157ac81cb719981 /controlloop/m2/test
parent68cdd3fe41fe7fa101d0d2331bd493a67e16203f (diff)
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 <jrh3@att.com>
Diffstat (limited to 'controlloop/m2/test')
-rw-r--r--controlloop/m2/test/src/test/java/org/onap/policy/m2/test/AppcLcmTest.java2
-rw-r--r--controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimDmaap.java10
-rw-r--r--controlloop/m2/test/src/test/java/org/onap/policy/m2/test/SimGuard.java3
-rw-r--r--controlloop/m2/test/src/test/java/org/onap/policy/m2/test/Util.java7
4 files changed, 7 insertions, 15 deletions
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<String,Topic> topicTable = new ConcurrentHashMap<>();
+ static Map<String, Topic> 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<String,Group> groupTable = new ConcurrentHashMap<>();
+ Map<String, Group> 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 '<limit>-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;