summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-07 15:11:46 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-07 15:11:55 +0100
commit07922e8590597e7a74a2059a1b344c92f04771c5 (patch)
treed7f0c7afc4c2a7830b959727049e1118472e8abb
parenta41c877a6b1980e0e866699633e0289d9a3fdbb5 (diff)
Parameter group fields must have getters
Modifications to apex parameters to include getters that follow naming conventions, and knock on changes. Also checkstyle fixes taken in modifified classes. Issue-ID: POLICY-1095 Change-Id: Iff5ccc7a069a4ec2b2b974ed9f5ed70a88692e00 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java2
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java30
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java12
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java6
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java2
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java18
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java8
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java4
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java4
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java (renamed from plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java)2
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java2
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java6
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java12
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJSONAdapter.java16
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java54
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java3
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java12
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java3
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java162
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java24
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java36
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java49
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java3
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java12
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java1
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java9
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperTokenDelimitedEventProtocolParameters.java2
-rw-r--r--services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json2
31 files changed, 302 insertions, 203 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java
index af712706d..9b2ce9c02 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/ContextParameterConstants.java
@@ -32,7 +32,7 @@ public abstract class ContextParameterConstants {
public static final String PERSISTENCE_GROUP_NAME = "CONTEXT_PERSISTENCE_PARAMETERS";
/**
- * Private default constructor to prevent subclassing
+ * Private default constructor to prevent subclassing.
*/
private ContextParameterConstants() {
// Prevents subclassing
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
index b9348d494..af5d4d861 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
@@ -72,19 +72,19 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable {
@Override
public void init(final String consumerName, final EventHandlerParameters consumerParameters,
- final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
+ final ApexEventReceiver incomingEventReceiver) throws ApexEventException {
this.eventReceiver = incomingEventReceiver;
this.name = consumerName;
// Check and get the REST Properties
if (!(consumerParameters.getCarrierTechnologyParameters() instanceof RESTClientCarrierTechnologyParameters)) {
- final String errorMessage =
- "specified consumer properties are not applicable to REST client consumer (" + this.name + ")";
+ final String errorMessage = "specified consumer properties are not applicable to REST client consumer ("
+ + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
}
- restConsumerProperties =
- (RESTClientCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
+ restConsumerProperties = (RESTClientCarrierTechnologyParameters) consumerParameters
+ .getCarrierTechnologyParameters();
// Check if the HTTP method has been set
if (restConsumerProperties.getHttpMethod() == null) {
@@ -92,10 +92,10 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable {
}
if (!restConsumerProperties.getHttpMethod()
- .equalsIgnoreCase(RESTClientCarrierTechnologyParameters.CONSUMER_HTTP_METHOD)) {
+ .equalsIgnoreCase(RESTClientCarrierTechnologyParameters.CONSUMER_HTTP_METHOD)) {
final String errorMessage = "specified HTTP method of \"" + restConsumerProperties.getHttpMethod()
- + "\" is invalid, only HTTP method \"GET\" is supported for event reception on REST client consumer ("
- + this.name + ")";
+ + "\" is invalid, only HTTP method \"GET\" "
+ + "is supported for event reception on REST client consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
}
@@ -202,14 +202,14 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable {
@Override
public void run() {
try {
- final Response response =
- client.target(restConsumerProperties.getURL()).request("application/json").get();
+ final Response response = client.target(restConsumerProperties.getUrl()).request("application/json")
+ .get();
// Check that the event request worked
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
- final String errorMessage = "reception of event from URL \"" + restConsumerProperties.getURL()
- + "\" failed with status code " + response.getStatus() + " and message \""
- + response.readEntity(String.class) + "\"";
+ final String errorMessage = "reception of event from URL \"" + restConsumerProperties.getUrl()
+ + "\" failed with status code " + response.getStatus() + " and message \""
+ + response.readEntity(String.class) + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
@@ -218,8 +218,8 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable {
// Check there is content
if (eventJSONString == null || eventJSONString.trim().length() == 0) {
- final String errorMessage =
- "received an empty event from URL \"" + restConsumerProperties.getURL() + "\"";
+ final String errorMessage = "received an empty event from URL \"" + restConsumerProperties.getUrl()
+ + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
index 9d838f55e..2765fe9e7 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
@@ -146,11 +146,11 @@ public class ApexRestClientProducer implements ApexEventProducer {
}
// Send the event as a REST request
- final Response response = sendEventAsRESTRequest((String) event);
+ final Response response = sendEventAsRestRequest((String) event);
// Check that the request worked
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
- final String errorMessage = "send of event to URL \"" + restProducerProperties.getURL() + "\" using HTTP \""
+ final String errorMessage = "send of event to URL \"" + restProducerProperties.getUrl() + "\" using HTTP \""
+ restProducerProperties.getHttpMethod() + "\" failed with status code " + response.getStatus()
+ " and message \"" + response.readEntity(String.class) + "\", event:\n" + event;
LOGGER.warn(errorMessage);
@@ -159,7 +159,7 @@ public class ApexRestClientProducer implements ApexEventProducer {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("event sent from engine using {} to URL {} with HTTP {} : {} and response {} ", this.name,
- restProducerProperties.getURL(), restProducerProperties.getHttpMethod(), event, response);
+ restProducerProperties.getUrl(), restProducerProperties.getHttpMethod(), event, response);
}
}
@@ -180,12 +180,12 @@ public class ApexRestClientProducer implements ApexEventProducer {
* @param event the event to send
* @return the response tot he JSON request
*/
- public Response sendEventAsRESTRequest(final String event) {
+ public Response sendEventAsRestRequest(final String event) {
// We have already checked that it is a PUT or POST request
if (restProducerProperties.getHttpMethod().equalsIgnoreCase("POST")) {
- return client.target(restProducerProperties.getURL()).request("application/json").post(Entity.json(event));
+ return client.target(restProducerProperties.getUrl()).request("application/json").post(Entity.json(event));
} else {
- return client.target(restProducerProperties.getURL()).request("application/json").put(Entity.json(event));
+ return client.target(restProducerProperties.getUrl()).request("application/json").put(Entity.json(event));
}
}
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java
index 59d19f76b..d260cbeca 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java
@@ -27,7 +27,7 @@ import org.onap.policy.common.parameters.ValidationStatus;
/**
* Apex parameters for REST as an event carrier technology with Apex as a REST client.
*
- * The parameters for this plugin are:
+ * <p>The parameters for this plugin are:
* <ol>
* <li>url: The URL that the Apex Rest client will connect to over REST for event reception or event sending. This
* parameter is mandatory.
@@ -76,7 +76,7 @@ public class RESTClientCarrierTechnologyParameters extends CarrierTechnologyPara
*
* @return the URL
*/
- public String getURL() {
+ public String getUrl() {
return url;
}
@@ -126,7 +126,7 @@ public class RESTClientCarrierTechnologyParameters extends CarrierTechnologyPara
final GroupValidationResult result = super.validate();
// Check if the URL has been set for event output
- if (getURL() == null) {
+ if (getUrl() == null) {
result.setResult("url", ValidationStatus.INVALID, "no URL has been set for event sending on REST client");
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
index 46e68acda..12b9a695c 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
@@ -21,7 +21,7 @@
package org.onap.policy.apex.plugins.event.carrier.restrequestor;
/**
- * This class holds a record of a REST request for the REST requestor plugin
+ * This class holds a record of a REST request for the REST requestor plugin.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
index a2069a794..9998349db 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
@@ -129,7 +129,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
}
// Check if the HTTP URL has been set
- if (restConsumerProperties.getURL() == null) {
+ if (restConsumerProperties.getUrl() == null) {
final String errorMessage = "no URL has been specified on REST Requestor consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
@@ -137,7 +137,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check if the HTTP URL is valid
try {
- new URL(restConsumerProperties.getURL());
+ new URL(restConsumerProperties.getUrl());
} catch (final Exception e) {
final String errorMessage = "invalid URL has been specified on REST Requestor consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
@@ -154,7 +154,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
}
/**
- * Receive an incoming REST request from the peered REST Requestor producer and queue it
+ * Receive an incoming REST request from the peered REST Requestor producer and queue it.
*
* @param restRequest the incoming rest request to queue
* @throws ApexEventRuntimeException on queueing errors
@@ -346,7 +346,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check that the event request worked
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
final String errorMessage = "reception of response to \"" + request + "\" from URL \""
- + restConsumerProperties.getURL() + "\" failed with status code " + response.getStatus()
+ + restConsumerProperties.getUrl() + "\" failed with status code " + response.getStatus()
+ " and message \"" + response.readEntity(String.class) + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
@@ -357,7 +357,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check there is content
if (eventJSONString == null || eventJSONString.trim().length() == 0) {
final String errorMessage = "received an enpty response to \"" + request + "\" from URL \""
- + restConsumerProperties.getURL() + "\"";
+ + restConsumerProperties.getUrl() + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
@@ -390,18 +390,18 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
public Response sendEventAsRESTRequest() {
switch (restConsumerProperties.getHttpMethod()) {
case GET:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON).get();
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON).get();
case PUT:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON)
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON)
.put(Entity.json(request.getEvent()));
case POST:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON)
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON)
.post(Entity.json(request.getEvent()));
case DELETE:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON).delete();
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON).delete();
}
return null;
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
index 12f194510..721dfb683 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
@@ -86,7 +86,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
}
// Check if the HTTP URL has been set
- if (restProducerProperties.getURL() != null) {
+ if (restProducerProperties.getUrl() != null) {
final String errorMessage = "URL may not be specified on REST Requestor producer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
@@ -112,7 +112,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
}
/**
- * Get the number of events sent to date
+ * Get the number of events sent to date.
*
* @return the number of events received
*/
@@ -163,7 +163,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
// Find the REST Response Consumer that will handle this request
final ApexEventConsumer consumer = peeredRequestorReference.getPeeredConsumer();
if (!(consumer instanceof ApexRestRequestorConsumer)) {
- final String errorMessage = "send of event to URL \"" + restProducerProperties.getURL() + "\" failed,"
+ final String errorMessage = "send of event to URL \"" + restProducerProperties.getUrl() + "\" failed,"
+ " REST response consumer is not an instance of ApexRestRequestorConsumer\n" + event;
LOGGER.warn(errorMessage);
throw new ApexEventRuntimeException(errorMessage);
@@ -176,7 +176,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
eventsSent++;
} else {
// No peered consumer defined
- final String errorMessage = "send of event to URL \"" + restProducerProperties.getURL() + "\" failed,"
+ final String errorMessage = "send of event to URL \"" + restProducerProperties.getUrl() + "\" failed,"
+ " REST response consumer is not defined\n" + event;
LOGGER.warn(errorMessage);
throw new ApexEventRuntimeException(errorMessage);
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
index 9b841d768..65eb731ed 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
@@ -26,7 +26,7 @@ import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnolo
* Apex parameters for REST as an event carrier technology with Apex issuing a REST request and receiving a REST
* response.
*
- * The parameters for this plugin are:
+ * <p>The parameters for this plugin are:
* <ol>
* <li>url: The URL that the Apex Rest Requestor will connect to over REST for REST request sending. This parameter is
* mandatory.
@@ -81,7 +81,7 @@ public class RESTRequestorCarrierTechnologyParameters extends CarrierTechnologyP
*
* @return the URL
*/
- public String getURL() {
+ public String getUrl() {
return url;
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
index 70d567b0d..3db0f1467 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
@@ -60,7 +60,7 @@ public class TestRESTRequestor {
@BeforeClass
public static void setUp() throws Exception {
- final ResourceConfig rc = new ResourceConfig(TestRESTREequestorEndpoint.class);
+ final ResourceConfig rc = new ResourceConfig(TestRestRequestorEndpoint.class);
server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
while (!server.isStarted()) {
@@ -79,7 +79,7 @@ public class TestRESTRequestor {
@Before
public void resetCounters() {
- TestRESTREequestorEndpoint.resetCounters();
+ TestRestRequestorEndpoint.resetCounters();
}
@Test
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java
index d9569b1ed..4977b3efb 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java
@@ -35,7 +35,7 @@ import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
@Path("/apex")
-public class TestRESTREequestorEndpoint {
+public class TestRestRequestorEndpoint {
private static Object counterLock = new Object();
private static int postMessagesReceived = 0;
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java
index 1937fd2bf..4cef1e10b 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterConstants.java
@@ -29,7 +29,7 @@ public abstract class ApexParameterConstants {
public static final String EVENT_HANDLER_GROUP_NAME = "EVENT_HANDLER_PARAMETERS";
/**
- * Private default constructor to prevent subclassing
+ * Private default constructor to prevent subclassing.
*/
private ApexParameterConstants() {
// Prevents subclassing
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java
index c93e52118..2e8e66ae8 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java
@@ -22,6 +22,9 @@ package org.onap.policy.apex.service.parameters;
import java.io.FileReader;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
import org.onap.policy.apex.core.engine.EngineParameters;
import org.onap.policy.apex.service.engine.main.ApexCommandLineArguments;
import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
@@ -35,9 +38,6 @@ import org.onap.policy.common.parameters.ParameterService;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
/**
* This class handles reading, parsing and validating of Apex parameters from JSON files.
*
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java
index 069bcc9a8..87b86a897 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java
@@ -305,7 +305,8 @@ public class ApexParameters implements ParameterGroup {
// Check that the peer reference is OK
if (rightModeParameters == null) {
result.setResult(handlerMapVariableName, leftModeParameterEntry.getKey(), ValidationStatus.INVALID,
- PEER_STRING + '"' + leftModeParameters.getPeer(peeredMode) + FOR_PEERED_MODE_STRING + peeredMode
+ PEER_STRING + '"' + leftModeParameters.getPeer(peeredMode) + FOR_PEERED_MODE_STRING
+ + peeredMode
+ " does not exist or is not defined with the same peered mode");
continue;
}
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java
index 41e30188b..593c6d86f 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java
@@ -29,8 +29,7 @@ import org.onap.policy.common.parameters.ValidationStatus;
* The default carrier technology parameter class that may be specialized by carrier technology plugins that require
* plugin specific parameters.
*
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
* <ol>
* <li>label: The label of the carrier technology.
* <li>eventProducerPluginClass: The name of the plugin class that will be used by Apex to produce and emit output
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java
index e443c1eb0..b4e342f17 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java
@@ -24,12 +24,6 @@ import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
-import org.onap.policy.apex.service.engine.event.impl.eventrequestor.EventRequestorCarrierTechnologyParameters;
-import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FILECarrierTechnologyParameters;
-import org.onap.policy.common.parameters.ParameterRuntimeException;
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
-
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
@@ -38,6 +32,12 @@ import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
+import org.onap.policy.apex.service.engine.event.impl.eventrequestor.EventRequestorCarrierTechnologyParameters;
+import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.FILECarrierTechnologyParameters;
+import org.onap.policy.common.parameters.ParameterRuntimeException;
+import org.slf4j.ext.XLogger;
+import org.slf4j.ext.XLoggerFactory;
+
/**
* This class deserialises various type of carrier technology parameters from JSON.
*
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java
index 70badae93..ba065d3ef 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java
@@ -36,8 +36,7 @@ import org.onap.policy.apex.core.engine.EngineParameters;
/**
* This class holds the parameters for an Apex Engine Service with multiple engine threads running multiple engines.
*
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
* <ol>
* <li>name: The name of the Apex engine service, which can be set to any value that matches the regular expression
* {@link org.onap.policy.apex.model.basicmodel.concepts.AxKey#NAME_REGEXP}.
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJSONAdapter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJSONAdapter.java
index 98e41f6af..50f4925f3 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJSONAdapter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParametersJSONAdapter.java
@@ -23,6 +23,14 @@ package org.onap.policy.apex.service.parameters.engineservice;
import java.lang.reflect.Type;
import java.util.Map.Entry;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameters;
import org.onap.policy.apex.context.parameters.DistributorParameters;
@@ -37,14 +45,6 @@ import org.onap.policy.common.parameters.ParameterRuntimeException;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
-import com.google.gson.JsonSerializationContext;
-import com.google.gson.JsonSerializer;
-
/**
* This class deserializes engine service parameters from JSON format. The class produces an
* {@link EngineServiceParameters} instance from incoming JSON read from a configuration file in JSON format.
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java
index 76ccd683c..996899052 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java
@@ -33,12 +33,10 @@ import org.onap.policy.common.parameters.ValidationStatus;
/**
* The parameters for a single event producer, event consumer or synchronous event handler.
*
- * <p>
- * Event producers, consumers, and synchronous event handlers all use a carrier technology and an event protocol so the
+ * <p>Event producers, consumers, and synchronous event handlers all use a carrier technology and an event protocol so the
* actual parameters for each one are the same. Therefore, we use the same class for the parameters of each one.
*
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
* <ol>
* <li>carrierTechnologyParameters: The carrier technology is the type of messaging infrastructure used to carry events.
* Examples are File, Kafka or REST.
@@ -341,6 +339,54 @@ public class EventHandlerParameters implements ParameterGroup {
return result;
}
+ /**
+ * Check if we're using synchronous mode
+ *
+ * @return true if if we're using synchronous mode
+ */
+ public boolean isSynchronousMode() {
+ return synchronousMode;
+ }
+
+ /**
+ * The synchronous peer for this event handler
+ * @return the synchronous peer for this event handler
+ */
+ public String getSynchronousPeer() {
+ return synchronousPeer;
+ }
+
+ /**
+ * Get the timeout for synchronous operations
+ * @return the timeout for synchronous operations
+ */
+ public long getSynchronousTimeout() {
+ return synchronousTimeout;
+ }
+
+ /**
+ * Check if this event handler will use requestor mode
+ * @return true if this event handler will use requestor mode
+ */
+ public boolean isRequestorMode() {
+ return requestorMode;
+ }
+
+ /**
+ * The requestor peer for this event handler
+ * @return the requestor peer for this event handler
+ */
+ public String getRequestorPeer() {
+ return requestorPeer;
+ }
+
+ /**
+ * @return the requestorTimeout
+ */
+ public long getRequestorTimeout() {
+ return requestorTimeout;
+ }
+
/*
* (non-Javadoc)
*
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java
index 06b5e41f5..29afc4edb 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java
@@ -29,8 +29,7 @@ import org.onap.policy.common.parameters.ValidationStatus;
* A default event protocol parameter class that may be specialized by event protocol plugins that require plugin
* specific parameters.
*
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
* <ol>
* <li>label: The label of the event protocol technology.
* <li>eventProducerPluginClass: The name of the plugin class that will be used by Apex to produce and emit output
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java
index 2f09e0a65..645368509 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java
@@ -24,12 +24,6 @@ import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
-import org.onap.policy.apex.service.engine.event.impl.apexprotocolplugin.ApexEventProtocolParameters;
-import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters;
-import org.onap.policy.common.parameters.ParameterRuntimeException;
-import org.slf4j.ext.XLogger;
-import org.slf4j.ext.XLoggerFactory;
-
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
@@ -38,6 +32,12 @@ import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
+import org.onap.policy.apex.service.engine.event.impl.apexprotocolplugin.ApexEventProtocolParameters;
+import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters;
+import org.onap.policy.common.parameters.ParameterRuntimeException;
+import org.slf4j.ext.XLogger;
+import org.slf4j.ext.XLoggerFactory;
+
/**
* This class serialises and deserialises various type of event protocol parameters to and from
* JSON.
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java
index d10d81ce2..bf8d1a5e1 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java
@@ -27,8 +27,7 @@ import org.onap.policy.common.parameters.ValidationStatus;
* An event protocol parameter class for character delimited textual event protocols that may be specialized by event
* protocol plugins that require plugin specific parameters.
*
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
* <ol>
* <li>startChar: starting character delimiter for text blocks containing an event.
* <li>endChar: ending character delimiter for text blocks containing an event.
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
index 37f15777b..bfda220a5 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
@@ -39,7 +39,8 @@ public class ContextParameterTests {
@Test
public void noParamsTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextNoParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextNoParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -47,14 +48,15 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextNoParams.json\"\n"
- + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
- + "\"contextParameters\" entry", e.getMessage());
+ + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
+ + "\"contextParameters\" entry", e.getMessage());
}
}
@Test
public void badParamsTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -62,15 +64,16 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextBadParams.json\""
- + "\n(ParameterRuntimeException):failed to deserialize the parameters for "
- + "\"contextParameters\" to parameter class \"hello\"\njava.lang.ClassNotFoundException: hello",
- e.getMessage());
+ + "\n(ParameterRuntimeException):failed to deserialize the parameters for "
+ + "\"contextParameters\" to parameter class \"hello\"\njava.lang.ClassNotFoundException: hello",
+ e.getMessage());
}
}
@Test
public void badPluginParamNameTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadPluginNameParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadPluginNameParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -78,33 +81,34 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
- + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
- + "\"contextParameters\" entry", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
+ + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
+ + "\"contextParameters\" entry", e.getMessage());
}
}
@Test
public void badClassParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadClassParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
new ApexParameterHandler().getParameters(arguments);
fail("This test should throw an exception");
} catch (final ParameterException e) {
- assertEquals(
- "error reading parameters from \"src/test/resources/parameters/serviceContextBadClassParams.json\""
- + "\n(ParameterRuntimeException):failed to deserialize the parameters for \"contextParameters\""
- + " to parameter class \"java.lang.Integer\"\ncom.google.gson.JsonSyntaxException: "
- + "java.lang.IllegalStateException: Expected NUMBER but was BEGIN_OBJECT at path $",
- e.getMessage());
+ assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextBadClassParams.json\""
+ + "\n(ParameterRuntimeException):failed to deserialize the parameters for \"contextParameters\""
+ + " to parameter class \"java.lang.Integer\"\ncom.google.gson.JsonSyntaxException: "
+ + "java.lang.IllegalStateException: Expected NUMBER but was BEGIN_OBJECT at path $",
+ e.getMessage());
}
}
@Test
public void badPluginClassTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadPluginClassParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadPluginClassParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -112,24 +116,27 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadPluginClassParams.json\""
- + "\n(ClassCastException):org.onap.policy.apex.service.engine.parameters.dummyclasses."
- + "SuperDooperExecutorParameters"
- + " cannot be cast to org.onap.policy.apex.context.parameters.ContextParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadPluginClassParams.json\""
+ + "\n(ClassCastException):org.onap.policy.apex.service.engine.parameters.dummyclasses."
+ + "SuperDooperExecutorParameters"
+ + " cannot be cast to org.onap.policy.apex.context.parameters.ContextParameters",
+ e.getMessage());
}
}
@Test
public void okFlushParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKFlushParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextOKFlushParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getCanonicalName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getClass().getCanonicalName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
@@ -137,15 +144,17 @@ public class ContextParameterTests {
@Test
public void okDefaultParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKDefaultParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextOKDefaultParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getCanonicalName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getClass().getCanonicalName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
@@ -153,16 +162,18 @@ public class ContextParameterTests {
@Test
public void okDistParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKDistParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextOKDistParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getCanonicalName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getDistributorParameters().getClass().getCanonicalName());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
@@ -170,24 +181,26 @@ public class ContextParameterTests {
@Test
public void okFullDefaultParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/goodParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getCanonicalName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getDistributorParameters().getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getLockManagerParameters().getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getPersistorParameters().getClass().getCanonicalName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
@@ -195,31 +208,33 @@ public class ContextParameterTests {
@Test
public void okFullParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKFullParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextOKFullParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getCanonicalName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getLockManagerParameters().getClass().getCanonicalName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getCanonicalName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getPersistorParameters().getClass().getCanonicalName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
- final SuperDooperDistributorParameters infinispanParameters =
- (SuperDooperDistributorParameters) parameters.getEngineServiceParameters().getEngineParameters()
- .getContextParameters().getDistributorParameters();
+ final SuperDooperDistributorParameters infinispanParameters = (SuperDooperDistributorParameters) parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getDistributorParameters();
assertEquals("org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperDistributorParameters",
- infinispanParameters.getClass().getCanonicalName());
+ infinispanParameters.getClass().getCanonicalName());
assertEquals("my/lovely/configFile.xml", infinispanParameters.getConfigFile());
assertEquals("holy/stone.xml", infinispanParameters.getJgroupsFile());
- assertEquals(false, infinispanParameters.preferIPv4Stack());
- assertEquals("fatherted", infinispanParameters.getjGroupsBindAddress());
+ assertEquals(false, infinispanParameters.isPreferIPv4Stack());
+ assertEquals("fatherted", infinispanParameters.getJgroupsBindAddress());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
@@ -228,7 +243,8 @@ public class ContextParameterTests {
@Test
public void badClassDistParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassDistParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadClassDistParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -236,15 +252,16 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassDistParams.json\"\n"
- + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.DistributorParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassDistParams.json\"\n"
+ + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
+ + " org.onap.policy.apex.context.parameters.DistributorParameters", e.getMessage());
}
}
@Test
public void badClassLockParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassLockParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadClassLockParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -252,15 +269,16 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassLockParams.json\"\n"
- + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.LockManagerParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassLockParams.json\"\n"
+ + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
+ + " org.onap.policy.apex.context.parameters.LockManagerParameters", e.getMessage());
}
}
@Test
public void badClassPersistParamTest() {
- final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassPersistParams.json"};
+ final String[] args =
+ { "-c", "src/test/resources/parameters/serviceContextBadClassPersistParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -268,9 +286,9 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassPersistParams.json\"\n"
- + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.PersistorParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassPersistParams.json\"\n"
+ + "(ClassCastException):org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
+ + " org.onap.policy.apex.context.parameters.PersistorParameters", e.getMessage());
}
}
}
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java
index 31ccd913f..97724becc 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java
@@ -48,7 +48,8 @@ import org.onap.policy.common.parameters.ParameterException;
public class ParameterTests {
@Test
public void invalidParametersNoFileTest() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/invalidNoFile.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/invalidNoFile.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -62,7 +63,8 @@ public class ParameterTests {
@Test
public void invalidParametersEmptyTest() {
- final String[] args = { "-c", "src/test/resources/parameters/empty.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/empty.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -76,7 +78,8 @@ public class ParameterTests {
@Test
public void invalidParametersNoParamsTest() {
- final String[] args = { "-c", "src/test/resources/parameters/noParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/noParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -97,7 +100,8 @@ public class ParameterTests {
@Test
public void invalidParametersBlankParamsTest() {
- final String[] args = { "-c", "src/test/resources/parameters/blankParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/blankParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -123,7 +127,8 @@ public class ParameterTests {
@Test
public void invalidParametersTest() {
- final String[] args = { "-c", "src/test/resources/parameters/badParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/badParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -171,7 +176,8 @@ public class ParameterTests {
@Test
public void goodParametersTest() {
- final String[] args = { "-c", "src/test/resources/parameters/goodParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/goodParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -222,7 +228,8 @@ public class ParameterTests {
@Test
public void superDooperParametersTest() {
- final String[] args = { "-c", "src/test/resources/parameters/superDooperParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/superDooperParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -268,7 +275,8 @@ public class ParameterTests {
assertEquals("some.key.deserailizer", superDooperParameters.getKeyDeserializer());
assertEquals("some.value.deserailizer", superDooperParameters.getValueDeserializer());
- final String[] consumerTopics = { "consumer-out-0", "consumer-out-1", "consumer-out-2" };
+ final String[] consumerTopics =
+ { "consumer-out-0", "consumer-out-1", "consumer-out-2" };
assertEquals(Arrays.asList(consumerTopics), superDooperParameters.getConsumerTopicList());
} catch (final ParameterException e) {
fail("This test should not throw an exception");
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
index 8bcc1bd37..26cf09c38 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
@@ -38,7 +38,8 @@ import org.onap.policy.common.parameters.ParameterException;
public class ProducerConsumerTests {
@Test
public void goodParametersTest() {
- final String[] args = { "-c", "src/test/resources/parameters/goodParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/goodParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -72,7 +73,8 @@ public class ProducerConsumerTests {
@Test
public void noCarrierTechnology() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsNoCT.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsNoCT.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -93,7 +95,8 @@ public class ProducerConsumerTests {
@Test
public void noEventProcol() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsNoEP.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsNoEP.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -124,7 +127,8 @@ public class ProducerConsumerTests {
@Test
public void noCarrierTechnologyParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsNoCTParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsNoCTParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -139,7 +143,8 @@ public class ProducerConsumerTests {
@Test
public void mismatchCarrierTechnologyParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsMismatchCTParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsMismatchCTParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -158,7 +163,8 @@ public class ProducerConsumerTests {
@Test
public void wrongTypeCarrierTechnologyParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsWrongTypeCTParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsWrongTypeCTParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -177,7 +183,8 @@ public class ProducerConsumerTests {
@Test
public void okFileNameCarrierTechnology() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsOKFileName.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsOKFileName.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -195,7 +202,8 @@ public class ProducerConsumerTests {
@Test
public void badFileNameCarrierTechnology() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsBadFileName.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsBadFileName.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -220,7 +228,8 @@ public class ProducerConsumerTests {
@Test
public void badEventProtocolParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsBadEPParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsBadEPParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -237,7 +246,8 @@ public class ProducerConsumerTests {
@Test
public void noEventProtocolParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsNoEPParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsNoEPParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -252,7 +262,8 @@ public class ProducerConsumerTests {
@Test
public void mismatchEventProtocolParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsMismatchEPParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsMismatchEPParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -271,7 +282,8 @@ public class ProducerConsumerTests {
@Test
public void wrongTypeEventProtocolParClass() {
- final String[] args = { "-c", "src/test/resources/parameters/prodConsWrongTypeEPParClass.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/prodConsWrongTypeEPParClass.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java
index 1c291786f..7913af84c 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java
@@ -45,7 +45,8 @@ import org.onap.policy.common.parameters.ParameterException;
public class SyncParameterTests {
@Test
public void syncBadNoSyncWithPeer() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -67,7 +68,8 @@ public class SyncParameterTests {
@Test
public void syncBadNotSyncWithPeer() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -89,7 +91,8 @@ public class SyncParameterTests {
@Test
public void syncBadSyncBadPeers() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsBadPeers.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsBadPeers.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -124,7 +127,8 @@ public class SyncParameterTests {
@Test
public void syncBadSyncInvalidTimeout() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsInvalidTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsInvalidTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -145,8 +149,8 @@ public class SyncParameterTests {
+ "\"org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters\" "
+ "INVALID, specified peered mode \"SYNCHRONOUS\" timeout value \"-3\" is illegal, "
+ "specify a non-negative timeout value in milliseconds\n"
- + " parameter group map \"eventInputParameters\" INVALID, parameter group has status INVALID\n"
- + " parameter group \"SyncConsumer0\" type "
+ + " parameter group map \"eventInputParameters\" INVALID, "
+ + "parameter group has status INVALID\n" + " parameter group \"SyncConsumer0\" type "
+ "\"org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters\" INVALID, "
+ "specified peered mode \"SYNCHRONOUS\" timeout value \"-1\" is illegal, "
+ "specify a non-negative timeout value in milliseconds\n"
@@ -159,7 +163,8 @@ public class SyncParameterTests {
@Test
public void syncBadSyncBadTimeout() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsBadTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsBadTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -181,7 +186,8 @@ public class SyncParameterTests {
@Test
public void syncBadSyncUnpairedTimeout() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncBadParamsUnpairedTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncBadParamsUnpairedTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -217,7 +223,8 @@ public class SyncParameterTests {
@Test
public void syncGoodSyncGoodTimeoutProducer() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncGoodParamsProducerTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncGoodParamsProducerTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -237,7 +244,8 @@ public class SyncParameterTests {
@Test
public void syncGoodSyncGoodTimeoutConsumer() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncGoodParamsConsumerTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncGoodParamsConsumerTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -257,7 +265,8 @@ public class SyncParameterTests {
@Test
public void syncGoodSyncGoodTimeoutBoth() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncGoodParamsBothTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncGoodParamsBothTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -277,7 +286,8 @@ public class SyncParameterTests {
@Test
public void syncUnusedConsumerPeers() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncUnusedConsumerPeers.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncUnusedConsumerPeers.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -306,7 +316,8 @@ public class SyncParameterTests {
@Test
public void syncMismatchedPeers() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncMismatchedPeers.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncMismatchedPeers.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -342,7 +353,8 @@ public class SyncParameterTests {
@Test
public void syncUnusedProducerPeers() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncUnusedProducerPeers.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncUnusedProducerPeers.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -369,7 +381,8 @@ public class SyncParameterTests {
@Test
public void syncMismatchedTimeout() throws ParameterException {
- final String[] args = { "-c", "src/test/resources/parameters/syncMismatchedTimeout.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncMismatchedTimeout.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -399,7 +412,8 @@ public class SyncParameterTests {
@Test
public void syncGoodParametersTest() {
- final String[] args = { "-c", "src/test/resources/parameters/syncGoodParams.json" };
+ final String[] args =
+ { "-c", "src/test/resources/parameters/syncGoodParams.json" };
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -462,7 +476,8 @@ public class SyncParameterTests {
assertEquals("org.apache.superDooper.common.serialization.StringDeserializer",
superDooperParameters.getValueDeserializer());
- final String[] consumerTopics = { "apex-in" };
+ final String[] consumerTopics =
+ { "apex-in" };
assertEquals(Arrays.asList(consumerTopics), superDooperParameters.getConsumerTopicList());
} catch (final ParameterException e) {
fail("This test should not throw an exception");
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java
index 3ec84b150..7eaf4c8e1 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperCarrierTechnologyParameters.java
@@ -545,7 +545,8 @@ public class SuperDooperCarrierTechnologyParameters extends CarrierTechnologyPar
}
if (valueDeserializer == null || valueDeserializer.trim().length() == 0) {
- result.setResult("valueDeserializer", ValidationStatus.INVALID, "not specified, must be specified as a string");
+ result.setResult("valueDeserializer", ValidationStatus.INVALID,
+ "not specified, must be specified as a string");
}
return result;
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java
index 72dbc57a6..a8d099654 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java
@@ -40,7 +40,7 @@ public class SuperDooperDistributorParameters extends DistributorParameters {
private String configFile = DEFAULT_SUPER_DOOPER_DISTRIBUTION_CONFIG_FILE;
private String jgroupsFile = DEFAULT_SUPER_DOOPER_DISTRIBUTION_JGROUPS_FILE;
private boolean preferIPv4Stack = DEFAULT_SUPER_DOOPER_JAVA_NET_PREFER_IPV4_STACK;
- private String jGroupsBindAddress = DEFAULT_INFINSPAN_JGROUPS_BIND_ADDRESS;
+ private String jgroupsBindAddress = DEFAULT_INFINSPAN_JGROUPS_BIND_ADDRESS;
public SuperDooperDistributorParameters() {
super();
@@ -62,7 +62,7 @@ public class SuperDooperDistributorParameters extends DistributorParameters {
this.jgroupsFile = jgroupsFile;
}
- public boolean preferIPv4Stack() {
+ public boolean isPreferIPv4Stack() {
return preferIPv4Stack;
}
@@ -70,17 +70,17 @@ public class SuperDooperDistributorParameters extends DistributorParameters {
this.preferIPv4Stack = preferIPv4Stack;
}
- public String getjGroupsBindAddress() {
- return jGroupsBindAddress;
+ public String getJgroupsBindAddress() {
+ return jgroupsBindAddress;
}
public void setjGroupsBindAddress(final String jGroupsBindAddress) {
- this.jGroupsBindAddress = jGroupsBindAddress;
+ this.jgroupsBindAddress = jGroupsBindAddress;
}
@Override
public String toString() {
return "SuperDooperDistributorParameters [configFile=" + configFile + ", jgroupsFile=" + jgroupsFile
- + ", preferIPv4Stack=" + preferIPv4Stack + ", jGroupsBindAddress=" + jGroupsBindAddress + "]";
+ + ", preferIPv4Stack=" + preferIPv4Stack + ", jGroupsBindAddress=" + jgroupsBindAddress + "]";
}
}
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java
index e405107f0..bfd651025 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperEventProducer.java
@@ -29,6 +29,7 @@ import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
/**
+ * Dummy event producer parameters.
* @author John Keeney (john.keeney@ericsson.com)
*/
public class SuperDooperEventProducer implements ApexEventProducer {
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java
index a7bf4d5c8..270dd9bb6 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java
@@ -23,12 +23,13 @@ package org.onap.policy.apex.service.engine.parameters.dummyclasses;
import org.onap.policy.apex.core.engine.ExecutorParameters;
/**
- * Default Executor parameters for MVEL.
- *
- * @author Liam Fallon (liam.fallon@ericsson.com)
- * @version
+ * Dummy executor parameters.
*/
public class SuperDooperExecutorParameters extends ExecutorParameters {
+
+ /**
+ * Instantiates a new super dooper executor parameters.
+ */
public SuperDooperExecutorParameters() {
this.setTaskExecutorPluginClass(
"org.onap.policy.apex.service.engine.parameters.dummyclasses.DummyTaskExecutor");
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperTokenDelimitedEventProtocolParameters.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperTokenDelimitedEventProtocolParameters.java
index 02d986186..ec4f97d78 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperTokenDelimitedEventProtocolParameters.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperTokenDelimitedEventProtocolParameters.java
@@ -24,7 +24,7 @@ import org.onap.policy.apex.service.engine.event.impl.jsonprotocolplugin.JSONEve
import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolTextTokenDelimitedParameters;
/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
+ * Dummy token delimited parameters.
*/
public class SuperTokenDelimitedEventProtocolParameters extends EventProtocolTextTokenDelimitedParameters {
/** The label of this carrier technology. */
diff --git a/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json b/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json
index 22991054a..edbcb07df 100644
--- a/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json
+++ b/services/services-engine/src/test/resources/parameters/serviceContextOKFullParams.json
@@ -14,7 +14,7 @@
"configFile": "my/lovely/configFile.xml",
"jgroupsFile": "holy/stone.xml",
"preferIPv4Stack": false,
- "jGroupsBindAddress": "fatherted"
+ "jgroupsBindAddress": "fatherted"
},
"lockManagerParameters": {
"parameterClassName": "org.onap.policy.apex.context.parameters.LockManagerParameters"