Checkstyle the services-engine package 27/59827/2
authorDinh Danh Le <dinh.danh.le@ericsson.com>
Thu, 9 Aug 2018 09:51:44 +0000 (10:51 +0100)
committerDinh Danh Le <dinh.danh.le@ericsson.com>
Thu, 9 Aug 2018 16:56:57 +0000 (17:56 +0100)
Change-Id: I0d7fd6f867ba280953eb4fd0dc2a5ad1779fb045
Signed-off-by: Dinh Danh Le <dinh.danh.le@ericsson.com>
Issue-ID: POLICY-1034

46 files changed:
packages/apex-pdp-docker/pom.xml
packages/apex-pdp-package-full/pom.xml
packages/pom.xml
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEvent.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEventException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/ApexEventRuntimeException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/PeeredReference.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/SynchronousEventCache.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorConsumer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/eventrequestor/EventRequestorProducer.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/filecarrierplugin/FILECarrierTechnologyParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/JSONEventProtocolParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexActivatorException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexActivatorRuntimeException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexCommandLineArguments.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/EngineService.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterHandler.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameterRuntimeException.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/ApexParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/carriertechnology/CarrierTechnologyParametersJSONAdapter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/engineservice/EngineServiceParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventhandler/EventHandlerPeeredMode.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolParametersJSONAdapter.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextCharDelimitedParameters.java
services/services-engine/src/main/java/org/onap/policy/apex/service/parameters/eventprotocol/EventProtocolTextTokenDelimitedParameters.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/JSONEventGenerator.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/TestJSONEventHandler.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/TestJSONTaggedEventConsumer.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/event/TestPluginFactories.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/TestApexCommandLineArguments.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ExecutorParameterTests.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ParameterTests.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/SyncParameterTests.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperDistributorParameters.java
services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/dummyclasses/SuperDooperExecutorParameters.java
services/services-engine/src/test/resources/logback-test.xml

index 424ef64..75a8757 100644 (file)
                     <outputFile>${project.build.directory}/version</outputFile>
                 </configuration>
             </plugin>
-
         </plugins>
     </build>
 
-</project>
+    <profiles>
+        <profile>
+            <id>apexSite</id>
+            <activation>
+                <property>
+                    <name>apexSite</name>
+                </property>
+            </activation>
+            <distributionManagement>
+                <site>
+                    <id>${project.artifactId}-site</id>
+                    <url>${apex.adsite.prefix}/modules/${project.artifactId}/</url>
+                </site>
+            </distributionManagement>
+        </profile>
+    </profiles>
+</project>
\ No newline at end of file
index 2ec77f7..ceda3ad 100644 (file)
                 </pluginManagement>
             </build>
         </profile>
+
+        <profile>
+            <id>apexSite</id>
+            <activation>
+                <property>
+                    <name>apexSite</name>
+                </property>
+            </activation>
+            <distributionManagement>
+                <site>
+                    <id>${project.artifactId}-site</id>
+                    <url>${apex.adsite.prefix}/modules/${project.parent.artifactId}/${project.artifactId}/</url>
+                </site>
+            </distributionManagement>
+        </profile>
     </profiles>
 </project>
index f77401e..0c7f919 100644 (file)
         <module>apex-pdp-package-full</module>
         <module>apex-pdp-docker</module>
     </modules>
+
+    <profiles>
+        <profile>
+            <id>apexSite</id>
+            <activation>
+                <property>
+                    <name>apexSite</name>
+                </property>
+            </activation>
+            <distributionManagement>
+                <site>
+                    <id>${project.artifactId}-site</id>
+                    <url>${apex.adsite.prefix}/modules/${project.artifactId}/</url>
+                </site>
+            </distributionManagement>
+        </profile>
+    </profiles>
 </project>
index 5c757c6..1bc88a4 100644 (file)
@@ -57,8 +57,8 @@ import com.google.common.eventbus.Subscribe;
  * processing a engDepMessage event implements this interface, and the object created with that
  * class is registered with a component using the component's <code>addEngDepMessageListener</code>
  * method. When the engDepMessage event occurs, that object's appropriate method is invoked.
- *
- * This class uses a queue to buffer incoming messages. When the listener is called, it places the
+ * 
+ * <p>This class uses a queue to buffer incoming messages. When the listener is called, it places the
  * incoming message on the queue. A thread runs which removes the messages from the queue and
  * forwards them to the Apex engine.
  *
index 99728c0..38762ea 100644 (file)
@@ -30,8 +30,9 @@ import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
 /**
- * The Class ApexEvent is an event class that external systems use to send events to and receive events from Apex engines. The event itself is a hash map of
- * string keys and object values, used to pass data.
+ * The Class ApexEvent is an event class that external systems use to send events to and receive
+ * events from Apex engines. The event itself is a hash map of string keys and object values, used
+ * to pass data.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -43,35 +44,44 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
     // Holds the next identifier for event execution.
     private static AtomicLong nextExecutionID = new AtomicLong(0L);
 
-    /** The name of the Apex event, a mandatory field. All Apex events must have a name so that the event can be looked up in the Apex policy model. */
+    /**
+     * The name of the Apex event, a mandatory field. All Apex events must have a name so that the
+     * event can be looked up in the Apex policy model.
+     */
     public static final String NAME_HEADER_FIELD = "name";
 
     /**
-     * The version of the Apex event, an optional field. If a version is specified on an Apex event, the definition of that version of the event is taken from
-     * the Apex policy model. If no version is specified, the latest version of the event is used.
+     * The version of the Apex event, an optional field. If a version is specified on an Apex event,
+     * the definition of that version of the event is taken from the Apex policy model. If no
+     * version is specified, the latest version of the event is used.
      */
     public static final String VERSION_HEADER_FIELD = "version";
 
     /**
-     * The name space of the Apex event, an optional field. If a name space is specified on an Apex event it must match the name space on the event definition
-     * taken from the Apex policy model. If no name space is specified, the name space from the event definition in the Apex policy model is used.
+     * The name space of the Apex event, an optional field. If a name space is specified on an Apex
+     * event it must match the name space on the event definition taken from the Apex policy model.
+     * If no name space is specified, the name space from the event definition in the Apex policy
+     * model is used.
      */
     public static final String NAMESPACE_HEADER_FIELD = "nameSpace";
 
     /**
-     * The source of the Apex event, an optional field. It specifies where the Apex event has come from and its use is reserved for now. If no source is
-     * specified, the source from the event definition in the Apex policy model is used.
+     * The source of the Apex event, an optional field. It specifies where the Apex event has come
+     * from and its use is reserved for now. If no source is specified, the source from the event
+     * definition in the Apex policy model is used.
      */
     public static final String SOURCE_HEADER_FIELD = "source";
 
     /**
-     * The target of the Apex event, an optional field. It specifies where the Apex event is going to and its use is reserved for now. If no target is
-     * specified, the target from the event definition in the Apex policy model is used.
+     * The target of the Apex event, an optional field. It specifies where the Apex event is going
+     * to and its use is reserved for now. If no target is specified, the target from the event
+     * definition in the Apex policy model is used.
      */
     public static final String TARGET_HEADER_FIELD = "target";
 
     /**
-     * The exception message field of an Apex event is an exception message indicating that an event failed.
+     * The exception message field of an Apex event is an exception message indicating that an event
+     * failed.
      */
     public static final String EXCEPTION_MESSAGE_HEADER_FIELD = "exceptionMessage";
 
@@ -99,14 +109,16 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
     private final String target;
     // @formatter:on
 
-    // An identifier for the current event execution. The default value here will always be unique in a single JVM
+    // An identifier for the current event execution. The default value here will always be unique
+    // in a single JVM
     private long executionID = ApexEvent.getNextExecutionID();
 
     // A string holding a message that indicates why processing of this event threw an exception
     private String exceptionMessage;
 
     /**
-     * Private utility to get the next candidate value for a Execution ID. This value will always be unique in a single JVM
+     * Private utility to get the next candidate value for a Execution ID. This value will always be
+     * unique in a single JVM
      * 
      * @return the next candidate value for a Execution ID
      */
@@ -124,7 +136,8 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
      * @param target the target of the event
      * @throws ApexEventException thrown on validation errors on event names and versions
      */
-    public ApexEvent(final String name, final String version, final String nameSpace, final String source, final String target) throws ApexEventException {
+    public ApexEvent(final String name, final String version, final String nameSpace, final String source,
+            final String target) throws ApexEventException {
         // @formatter:off
         this.name      = validateField("name",      name,      NAME_REGEXP);
         this.version   = validateField("version",   version,   VERSION_REGEXP);
@@ -143,13 +156,15 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
      * @return the validated field value
      * @throws ApexEventException thrown if the field is invalid
      */
-    private String validateField(final String fieldName, final String fieldValue, final String fieldRegexp) throws ApexEventException {
+    private String validateField(final String fieldName, final String fieldValue, final String fieldRegexp)
+            throws ApexEventException {
         if (fieldValue.matches(fieldRegexp)) {
             return fieldValue;
-        }
-        else {
-            LOGGER.warn("event \"" + name + ": field \"" + fieldName + "=" + fieldValue + "\"  is illegal. It doesn't match regex '" + fieldRegexp + "'");
-            throw new ApexEventException("event \"" + name + ": field \"" + fieldName + "=" + fieldValue + "\"  is illegal");
+        } else {
+            LOGGER.warn("event \"" + name + ": field \"" + fieldName + "=" + fieldValue
+                    + "\"  is illegal. It doesn't match regex '" + fieldRegexp + "'");
+            throw new ApexEventException(
+                    "event \"" + name + ": field \"" + fieldName + "=" + fieldValue + "\"  is illegal");
         }
     }
 
@@ -163,8 +178,7 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
     private String validKey(final String key) throws ApexEventException {
         if (key.matches(AxReferenceKey.LOCAL_NAME_REGEXP)) {
             return key;
-        }
-        else {
+        } else {
             LOGGER.warn("event \"" + name + ": key \"" + key + "\" is illegal");
             throw new ApexEventException("event \"" + name + ": key \"" + key + "\" is illegal");
         }
@@ -225,8 +239,9 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
     }
 
     /**
-     * Sets the pass-thru executionID for this event. The default value for executionID will be be unique in the current JVM. For some applications/deployments
-     * this executionID may need to globally unique
+     * Sets the pass-thru executionID for this event. The default value for executionID will be be
+     * unique in the current JVM. For some applications/deployments this executionID may need to
+     * globally unique
      *
      * @param executionID the executionID
      */
@@ -266,8 +281,7 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
         // Check if the key is valid
         try {
             return super.put(validKey(key), value);
-        }
-        catch (final ApexEventException e) {
+        } catch (final ApexEventException e) {
             return null;
         }
     }
@@ -284,8 +298,7 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
             for (final String key : incomingMap.keySet()) {
                 validKey(key);
             }
-        }
-        catch (final ApexEventException e) {
+        } catch (final ApexEventException e) {
             // One of the keys is invalid
             return;
         }
@@ -327,8 +340,7 @@ public class ApexEvent extends HashMap<String, Object> implements Serializable {
         for (final Map.Entry<String, Object> dataEntry : this.entrySet()) {
             if (firstData) {
                 firstData = false;
-            }
-            else {
+            } else {
                 builder.append(',');
             }
 
index 24f57d7..35e1508 100644 (file)
@@ -43,9 +43,9 @@ public class ApexEventException extends ApexException {
      * Instantiates a new apex event exception.
      *
      * @param message the message
-     * @param e the e
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexEventException(final String message, final Exception e) {
-        super(message, e);
+    public ApexEventException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index 1a624fa..758a5fb 100644 (file)
@@ -43,9 +43,9 @@ public class ApexEventRuntimeException extends ApexRuntimeException {
      * Instantiates a new apex runtime event exception with a message and a caused by exception.
      *
      * @param message the message
-     * @param e the exception that caused this exception to be thrown
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexEventRuntimeException(final String message, final Exception e) {
-        super(message, e);
+    public ApexEventRuntimeException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index 9560a83..14ca3f0 100644 (file)
@@ -35,13 +35,14 @@ public class PeeredReference {
     private final ApexEventProducer peeredProducer;
 
     /**
-     * Create a peered consumer/producer reference
+     * Create a peered consumer/producer reference.
      * 
      * @param peeredMode the peered mode for which to return the reference
      * @param consumer the consumer that is receiving event
      * @param producer the producer that is sending events
      */
-    public PeeredReference(final EventHandlerPeeredMode peeredMode, final ApexEventConsumer consumer, final ApexEventProducer producer) {
+    public PeeredReference(final EventHandlerPeeredMode peeredMode, final ApexEventConsumer consumer,
+            final ApexEventProducer producer) {
         this.peeredConsumer = consumer;
         this.peeredProducer = producer;
 
index 25f92d8..1830fc0 100644 (file)
@@ -33,8 +33,9 @@ import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
 /**
- * This class holds a cache of the synchronous events sent into Apex and that have not yet been replied to. It runs a thread to time out events that have not
- * been replied to in the specified timeout.
+ * This class holds a cache of the synchronous events sent into Apex and that have not yet been
+ * replied to. It runs a thread to time out events that have not been replied to in the specified
+ * timeout.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -45,7 +46,8 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
     // The default amount of time to wait for a synchronous event to be replied to is 1 second
     private static final long DEFAULT_SYNCHRONOUS_EVENT_TIMEOUT = 1000;
 
-    // The timeout to wait between event polls in milliseconds and the time to wait for the thread to stop
+    // The timeout to wait between event polls in milliseconds and the time to wait for the thread
+    // to stop
     private static final long OUTSTANDING_EVENT_POLL_TIMEOUT = 50;
     private static final long CACHE_STOP_WAIT_INTERVAL = 10;
 
@@ -56,7 +58,8 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
     private final Map<Long, SimpleEntry<Long, Object>> toApexEventMap = new HashMap<Long, SimpleEntry<Long, Object>>();
 
     // Map holding reply events
-    private final Map<Long, SimpleEntry<Long, Object>> fromApexEventMap = new HashMap<Long, SimpleEntry<Long, Object>>();
+    private final Map<Long, SimpleEntry<Long, Object>> fromApexEventMap =
+            new HashMap<Long, SimpleEntry<Long, Object>>();
 
     // The message listener thread and stopping flag
     private final Thread synchronousEventCacheThread;
@@ -68,15 +71,16 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
      * @param peeredMode the peered mode for which to return the reference
      * @param consumer the consumer that is populating the cache
      * @param producer the producer that is emptying the cache
-     * @param synchronousEventTimeout the time in milliseconds to wait for the reply to a sent synchronous event
+     * @param synchronousEventTimeout the time in milliseconds to wait for the reply to a sent
+     *        synchronous event
      */
-    public SynchronousEventCache(final EventHandlerPeeredMode peeredMode, final ApexEventConsumer consumer, final ApexEventProducer producer, final long synchronousEventTimeout) {
-               super(peeredMode, consumer, producer);
+    public SynchronousEventCache(final EventHandlerPeeredMode peeredMode, final ApexEventConsumer consumer,
+            final ApexEventProducer producer, final long synchronousEventTimeout) {
+        super(peeredMode, consumer, producer);
 
         if (synchronousEventTimeout != 0) {
             this.synchronousEventTimeout = synchronousEventTimeout;
-        }
-        else {
+        } else {
             this.synchronousEventTimeout = DEFAULT_SYNCHRONOUS_EVENT_TIMEOUT;
         }
 
@@ -216,18 +220,21 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
 
     /**
      * Cache a synchronized event sent in an event cache.
+     * 
      * @param eventCacheMap the map to cache the event on
      * @param executionId the execution ID of the event
      * @param event the event to cache
      */
-    private void cacheSynchronizedEvent(final Map<Long, SimpleEntry<Long, Object>> eventCacheMap, final long executionId, final Object event) {
+    private void cacheSynchronizedEvent(final Map<Long, SimpleEntry<Long, Object>> eventCacheMap,
+            final long executionId, final Object event) {
         LOGGER.entry("Adding event with execution ID: " + executionId);
 
         // Check if the event is already in the cache
         if (eventCacheMap.containsKey(executionId)) {
-            // If there was no sent event then the event timed out or some unexpected event was received
+            // If there was no sent event then the event timed out or some unexpected event was
+            // received
             final String errorMessage = "an event with ID " + executionId
-            + " already exists in the synchronous event cache, execution IDs must be unique in the system";
+                    + " already exists in the synchronous event cache, execution IDs must be unique in the system";
             LOGGER.warn(errorMessage);
             throw new ApexEventRuntimeException(errorMessage);
         }
@@ -249,7 +256,8 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
      * @param executionId the execution ID of the event
      * @return The removed event
      */
-    private Object removeCachedEventIfExists(final Map<Long, SimpleEntry<Long, Object>> eventCacheMap, final long executionId) {
+    private Object removeCachedEventIfExists(final Map<Long, SimpleEntry<Long, Object>> eventCacheMap,
+            final long executionId) {
         LOGGER.entry("Removing: " + executionId);
 
         final SimpleEntry<Long, Object> removedEventEntry = eventCacheMap.remove(executionId);
@@ -257,15 +265,17 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
         if (removedEventEntry != null) {
             LOGGER.exit("Removed: " + executionId);
             return removedEventEntry.getValue();
-        }
-        else {
-            // The event may not be one of the events in our cache, so we just ignore removal failures
+        } else {
+            // The event may not be one of the events in our cache, so we just ignore removal
+            // failures
             return null;
         }
     }
 
     /**
-     * Time out events on an event cache map. Events that have a timeout longer than the configured timeout are timed out.
+     * Time out events on an event cache map. Events that have a timeout longer than the configured
+     * timeout are timed out.
+     * 
      * @param eventCacheMap the event cache to operate on
      */
     private void timeoutEventsOnCache(final Map<Long, SimpleEntry<Long, Object>> eventCacheMap) {
@@ -287,8 +297,8 @@ public class SynchronousEventCache extends PeeredReference implements Runnable {
             // Remove the map entry and issue a warning
             final SimpleEntry<Long, Object> timedOutEventEntry = eventCacheMap.remove(timedoutEventExecutionID);
 
-            LOGGER.warn("synchronous event timed out, reply not received in " + synchronousEventTimeout + " milliseconds on event "
-                    + timedOutEventEntry.getValue());
+            LOGGER.warn("synchronous event timed out, reply not received in " + synchronousEventTimeout
+                    + " milliseconds on event " + timedOutEventEntry.getValue());
         }
     }
 }
index b472cc9..8c135f1 100644 (file)
@@ -98,7 +98,7 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
     }
 
     /**
-     * Receive an incoming event send request from the peered event Requestor producer and queue it
+     * Receive an incoming event send request from the peered event Requestor producer and queue it.
      * 
      * @param eventObject the incoming event to process
      * @throws ApexEventRuntimeException on queueing errors
@@ -140,7 +140,7 @@ public class EventRequestorConsumer implements ApexEventConsumer, Runnable {
     }
 
     /**
-     * Get the number of events received to date
+     * Get the number of events received to date.
      * 
      * @return the number of events received
      */
index 4a972f2..fda48e7 100644 (file)
@@ -94,7 +94,7 @@ public class EventRequestorProducer implements ApexEventProducer {
     }
 
     /**
-     * Get the number of events sent to date
+     * Get the number of events sent to date.
      * 
      * @return the number of events received
      */
index 0081312..76f9b4b 100644 (file)
@@ -29,8 +29,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils;
  * This class holds the parameters that allows transport of events into and out of Apex using files
  * and standard input and output.
  *
- * <p>
- * The following parameters are defined:
+ * <p>The following parameters are defined:
  * <ol>
  * <li>fileName: The full path to the file from which to read events or to which to write events.
  * <li>standardIO: If this flag is set to true, then standard input is used to read events in or
@@ -149,7 +148,7 @@ public class FILECarrierTechnologyParameters extends CarrierTechnologyParameters
     }
 
     /**
-     * Gets the delay in milliseconds before the plugin starts processing
+     * Gets the delay in milliseconds before the plugin starts processing.
      * 
      * @return the delay
      */
@@ -158,7 +157,7 @@ public class FILECarrierTechnologyParameters extends CarrierTechnologyParameters
     }
 
     /**
-     * Sets the delay in milliseconds before the plugin starts processing
+     * Sets the delay in milliseconds before the plugin starts processing.
      * 
      * @param startDelay the delay
      */
index edaf5d5..21e4cd1 100644 (file)
@@ -276,11 +276,16 @@ public class Apex2JSONEventConverter implements ApexEventProtocolConverter {
             throws ApexEventException {
         // Get the event header fields
         // @formatter:off
-        String name      = getJSONStringField(jsonObject, ApexEvent.NAME_HEADER_FIELD,      jsonPars.getNameAlias(),      ApexEvent.NAME_REGEXP,      false);
-        String version   = getJSONStringField(jsonObject, ApexEvent.VERSION_HEADER_FIELD,   jsonPars.getVersionAlias(),   ApexEvent.VERSION_REGEXP,   false);
-        String namespace = getJSONStringField(jsonObject, ApexEvent.NAMESPACE_HEADER_FIELD, jsonPars.getNameSpaceAlias(), ApexEvent.NAMESPACE_REGEXP, false);
-        String source    = getJSONStringField(jsonObject, ApexEvent.SOURCE_HEADER_FIELD,    jsonPars.getSourceAlias(),    ApexEvent.SOURCE_REGEXP,    false);
-        String target    = getJSONStringField(jsonObject, ApexEvent.TARGET_HEADER_FIELD,    jsonPars.getTargetAlias(),    ApexEvent.TARGET_REGEXP,    false);
+        String name      = getJSONStringField(jsonObject, ApexEvent.NAME_HEADER_FIELD,      
+                jsonPars.getNameAlias(), ApexEvent.NAME_REGEXP, false);
+        String version   = getJSONStringField(jsonObject, ApexEvent.VERSION_HEADER_FIELD,   
+                jsonPars.getVersionAlias(), ApexEvent.VERSION_REGEXP, false);
+        String namespace = getJSONStringField(jsonObject, ApexEvent.NAMESPACE_HEADER_FIELD,
+                jsonPars.getNameSpaceAlias(), ApexEvent.NAMESPACE_REGEXP, false);
+        String source    = getJSONStringField(jsonObject, ApexEvent.SOURCE_HEADER_FIELD,
+                jsonPars.getSourceAlias(),    ApexEvent.SOURCE_REGEXP, false);
+        String target    = getJSONStringField(jsonObject, ApexEvent.TARGET_HEADER_FIELD,
+                jsonPars.getTargetAlias(),    ApexEvent.TARGET_REGEXP, false);
         // @formatter:on
 
         // Check that an event name has been specified
@@ -292,9 +297,8 @@ public class Apex2JSONEventConverter implements ApexEventProtocolConverter {
         // Check if an event name was specified on the event parameters
         if (eventName != null) {
             if (name != null && !eventName.equals(name)) {
-                LOGGER.warn(
-                        "The incoming event name \"{}\" does not match the configured event name \"{}\", using configured event name",
-                        name, eventName);
+                LOGGER.warn("The incoming event name \"{}\" does not match the configured event name \"{}\","
+                        + " using configured event name", name, eventName);
             }
             name = eventName;
         }
index 5f2b742..56eaa4a 100644 (file)
@@ -25,7 +25,7 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolTextCh
 /**
  * Event protocol parameters for JSON as an event protocol.
  *
- * The parameters for this plugin are:
+ * <p>The parameters for this plugin are:
  * <ol>
  * <li>nameAlias: The field in a JSON event to use as an alias for the event name. This parameter is
  * optional.
index 371a3a8..d338742 100644 (file)
@@ -43,9 +43,9 @@ public class ApexActivatorException extends ApexException {
      * Instantiates a new apex activator exception with a message and a caused by exception.
      *
      * @param message the message
-     * @param e the exception that caused this exception to be thrown
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexActivatorException(final String message, final Exception e) {
-        super(message, e);
+    public ApexActivatorException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index cf1842d..083536f 100644 (file)
@@ -44,9 +44,9 @@ public class ApexActivatorRuntimeException extends ApexRuntimeException {
      * Instantiates a new apex activator exception with a message and a caused by exception.
      *
      * @param message the message
-     * @param e the exception that caused this exception to be thrown
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexActivatorRuntimeException(final String message, final Exception e) {
-        super(message, e);
+    public ApexActivatorRuntimeException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index 374b384..d6d278e 100644 (file)
@@ -71,14 +71,16 @@ public class ApexCommandLineArguments {
                 .build());
         options.addOption(Option.builder("c")
                 .longOpt("config-file")
-                .desc("the full path to the configuration file to use, the configuration file must be a Json file containing the Apex configuration parameters")
+                .desc("the full path to the configuration file to use, the configuration file must be a Json file "
+                        + "containing the Apex configuration parameters")
                 .hasArg()
                 .argName("CONFIG_FILE")
                 .required(false)
                 .type(String.class)
                 .build());
         options.addOption(Option.builder("m").longOpt("model-file")
-                .desc("the full path to the model file to use, if set it overrides the model file set in the configuration file").hasArg().argName("MODEL_FILE")
+                .desc("the full path to the model file to use, if set it overrides the model file set in the "
+                        + "configuration file").hasArg().argName("MODEL_FILE")
                 .required(false)
                 .type(String.class).build());
         //@formatter:on
index e6fc332..d643135 100644 (file)
@@ -139,8 +139,8 @@ public interface EngineService {
 
     /**
      * This method checks if all Apex engines in the engine service are started.
-     * <p>
-     * Note: an engine can be both not stopped and not started, for example, when it is starting or
+     * 
+     * <p>Note: an engine can be both not stopped and not started, for example, when it is starting or
      * stopping
      *
      * @return true if all Apex engines in the engine service are started.
@@ -149,8 +149,8 @@ public interface EngineService {
 
     /**
      * This method checks if an Apex engine in the engine service is started.
-     * <p>
-     * Note: an engine can be both not stopped and not started, for example, when it is starting or
+     * 
+     * <p>Note: an engine can be both not stopped and not started, for example, when it is starting or
      * stopping
      *
      * @param engineKey The key of the Apex engine to check
@@ -160,8 +160,8 @@ public interface EngineService {
 
     /**
      * This method checks if all Apex engines in the engine service are stopped.
-     * <p>
-     * Note: an engine can be both not stopped and not started, for example, when it is starting or
+     * 
+     * <p>Note: an engine can be both not stopped and not started, for example, when it is starting or
      * stopping
      *
      * @return true if all Apex engines in the engine service are stopped.
@@ -170,8 +170,8 @@ public interface EngineService {
 
     /**
      * This method checks if an Apex engine in the engine service is stopped.
-     * <p>
-     * Note: an engine can be both not stopped and not started, for example, when it is starting or
+     * 
+     * <p>Note: an engine can be both not stopped and not started, for example, when it is starting or
      * stopping
      *
      * @param engineKey The key of the Apex engine to check
index 24d8263..2124b31 100644 (file)
@@ -79,7 +79,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
     private final BlockingQueue<ApexEvent> queue = new LinkedBlockingQueue<>();
 
     // Thread factory for thread management
-    private final ApplicationThreadFactory tFactory = new ApplicationThreadFactory("apex-engine-service", 512);
+    private final ApplicationThreadFactory atFactory = new ApplicationThreadFactory("apex-engine-service", 512);
 
     // Periodic event generator and its period in milliseconds
     private ApexPeriodicEventGenerator periodicEventGenerator = null;
@@ -111,7 +111,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
         for (int engineCounter = 0; engineCounter < threadCount; engineCounter++) {
             final AxArtifactKey engineWorkerKey =
                     new AxArtifactKey(engineServiceKey.getName() + '-' + engineCounter, engineServiceKey.getVersion());
-            engineWorkerMap.put(engineWorkerKey, new EngineWorker(engineWorkerKey, queue, tFactory));
+            engineWorkerMap.put(engineWorkerKey, new EngineWorker(engineWorkerKey, queue, atFactory));
             LOGGER.info("Created apex engine {} .", engineWorkerKey.getID());
         }
 
index cd657d8..f82aae6 100644 (file)
@@ -66,7 +66,7 @@ import com.google.gson.JsonParser;
  * is triggered by an Apex event, and when the policy is triggered it runs through to completion in
  * the ApexEngine.
  *
- * This class acts as a container for an {@link ApexEngine}, running it in a thread, sending it
+ * <p>This class acts as a container for an {@link ApexEngine}, running it in a thread, sending it
  * events, and receiving events from it.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
index 229250b..2bc0645 100644 (file)
@@ -44,9 +44,9 @@ public class ApexParameterException extends ApexException {
      * exception.
      *
      * @param message the message
-     * @param e the exception that caused this exception to be thrown
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexParameterException(final String message, final Exception e) {
-        super(message, e);
+    public ApexParameterException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index 79f10bd..31209bf 100644 (file)
@@ -58,9 +58,12 @@ public class ApexParameterHandler {
             // Register the adapters for our carrier technologies and event protocols with GSON
             // @formatter:off
             final Gson gson = new GsonBuilder()
-                    .registerTypeAdapter(EngineParameters           .class, new EngineServiceParametersJSONAdapter())
-                    .registerTypeAdapter(CarrierTechnologyParameters.class, new CarrierTechnologyParametersJSONAdapter())
-                    .registerTypeAdapter(EventProtocolParameters    .class, new EventProtocolParametersJSONAdapter())
+                    .registerTypeAdapter(EngineParameters           .class, 
+                            new EngineServiceParametersJSONAdapter())
+                    .registerTypeAdapter(CarrierTechnologyParameters.class, 
+                            new CarrierTechnologyParametersJSONAdapter())
+                    .registerTypeAdapter(EventProtocolParameters    .class, 
+                            new EventProtocolParametersJSONAdapter())
                     .create();
             // @formatter:on
             parameters = gson.fromJson(new FileReader(arguments.getFullConfigurationFilePath()), ApexParameters.class);
index 2334a7e..a4917f1 100644 (file)
@@ -44,9 +44,9 @@ public class ApexParameterRuntimeException extends ApexRuntimeException {
      * exception.
      *
      * @param message the message
-     * @param e the exception that caused this exception to be thrown
+     * @param ex the exception that caused this exception to be thrown
      */
-    public ApexParameterRuntimeException(final String message, final Exception e) {
-        super(message, e);
+    public ApexParameterRuntimeException(final String message, final Exception ex) {
+        super(message, ex);
     }
 }
index 52c6f49..9c65c0b 100644 (file)
@@ -36,8 +36,8 @@ import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMo
 
 /**
  * The main container parameter class for an Apex service.
- * <p>
- * The following parameters are defined:
+ * 
+ * <p>The following parameters are defined:
  * <ol>
  * <li>engineServiceParameters: The parameters for the Apex engine service itself, such as the
  * number of engine threads to run and the deployment port number to use.
@@ -215,7 +215,7 @@ public class ApexParameters extends AbstractParameters implements ApexParameterV
     }
 
     /**
-     * Validate parameter values for event handlers in a peered mode
+     * Validate parameter values for event handlers in a peered mode.
      * 
      * @param eventHandlerType The event handler type we are checking
      * @param errorMessageBuilder The builder to which to append any error messages
@@ -251,7 +251,7 @@ public class ApexParameters extends AbstractParameters implements ApexParameterV
     }
 
     /**
-     * This method validates that the settings are valid for the given peered mode
+     * This method validates that the settings are valid for the given peered mode.
      * 
      * @param errorMessageBuilder The builder to which to append any error messages
      * @param peeredMode The peered mode to check
@@ -281,7 +281,7 @@ public class ApexParameters extends AbstractParameters implements ApexParameterV
     }
 
     /**
-     * This method validates that the settings are valid for the event handlers on one
+     * This method validates that the settings are valid for the event handlers on one.
      * 
      * @param messagePreamble the preamble for messages indicating the peered mode side
      * @param errorMessageBuilder The builder to which to append any error messages
index ba0327d..0251833 100644 (file)
@@ -26,8 +26,8 @@ import org.onap.policy.apex.service.parameters.ApexParameterValidator;
 /**
  * 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
index e72a283..38abd3c 100644 (file)
@@ -55,6 +55,7 @@ public class CarrierTechnologyParametersJSONAdapter
 
     // Built in technology parameters
     private static final Map<String, String> BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP = new HashMap<>();
+    
     static {
         BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("FILE",
                 FILECarrierTechnologyParameters.class.getCanonicalName());
index 1db7aeb..3a53b59 100644 (file)
@@ -35,8 +35,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}.
index 34589f3..164544b 100644 (file)
@@ -30,12 +30,12 @@ import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParame
 
 /**
  * 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
+ * 
+ * <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.
index b7ee667..39732f5 100644 (file)
@@ -23,8 +23,7 @@ package org.onap.policy.apex.service.parameters.eventhandler;
 /**
  * This enum specifies the peered mode that an event handler may be in.
  * 
- * <p>
- * The following values are defined:
+ * <p>The following values are defined:
  * <ol>
  * <li>SYNCHRONOUS: The event handler is tied to another event handler for event handling in APEX,
  * used for request-response calls where APEX is the receiver.
index 6e66a18..66b5c0a 100644 (file)
@@ -27,8 +27,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterValidator;
  * 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
index 1f33db6..9d087bf 100644 (file)
@@ -56,6 +56,7 @@ public class EventProtocolParametersJSONAdapter
 
     // Built in event protocol parameters
     private static final Map<String, String> BUILT_IN_EVENT_RPOTOCOL_PARMETER_CLASS_MAP = new HashMap<>();
+    
     static {
         BUILT_IN_EVENT_RPOTOCOL_PARMETER_CLASS_MAP.put("JSON", JSONEventProtocolParameters.class.getCanonicalName());
         BUILT_IN_EVENT_RPOTOCOL_PARMETER_CLASS_MAP.put("APEX", ApexEventProtocolParameters.class.getCanonicalName());
index f8873ad..7094a3d 100644 (file)
@@ -26,8 +26,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterValidator;
  * 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.
index 91a6403..f71ebc6 100644 (file)
@@ -26,8 +26,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterValidator;
  * An event protocol parameter class for token 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>startDelimiterToken: the token string that delimits the start of text blocks that contain events.
  * <li>endDelimiterToken: the token string that delimits the end of text blocks that contain events, this parameter is
@@ -95,7 +94,7 @@ public abstract class EventProtocolTextTokenDelimitedParameters extends EventPro
     }
 
     /**
-     * Does there have to be a delimiter at the start of the first text block?
+     * Check if there must be a delimiter at the start of the first text block.
      * 
      * @return true if there must be a delimiter at the start of the text block
      */
@@ -104,7 +103,7 @@ public abstract class EventProtocolTextTokenDelimitedParameters extends EventPro
     }
 
     /**
-     * Sets if there has to be a delimiter at the start of the first text block?
+     * Sets if there has to be a delimiter at the start of the first text block.
      * 
      * @param delimiterAtStart
      *        true if there must be a delimiter at the start of the text block
index 4da8c42..94210e4 100644 (file)
@@ -23,6 +23,8 @@ package org.onap.policy.apex.service.engine.event;
 import java.util.Random;
 
 /**
+ * This class generates JSON event used for the test cases.
+ * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 public class JSONEventGenerator {
index be61b16..decec76 100644 (file)
@@ -50,6 +50,7 @@ import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
 /**
+ * Test JSON Event Handler.
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 public class TestJSONEventHandler {
@@ -159,7 +160,8 @@ public class TestJSONEventHandler {
                 fail("Test should throw an exception here");
             } catch (final ApexEventException e) {
                 assertTrue(e.getMessage().startsWith(
-                        "Failed to unmarshal JSON event: an event definition for an event named \"Event0000\" with version \"1.2.3\" not found in Apex model"));
+                        "Failed to unmarshal JSON event: an event definition for an event named "
+                        + "\"Event0000\" with version \"1.2.3\" not found in Apex model"));
             }
 
             apexEventJSONStringIn = JSONEventGenerator.jsonEventNoNamespace();
@@ -181,8 +183,8 @@ public class TestJSONEventHandler {
                 fail("Test should throw an exception here");
             } catch (final ApexEventException e) {
                 assertTrue(e.getMessage().startsWith(
-                        "Failed to unmarshal JSON event: namespace \"pie.in.the.sky\" on event \"Event0000\" "
-                                + "does not match namespace \"org.onap.policy.apex.sample.events\" for that event in the Apex model"));
+                        "Failed to unmarshal JSON event: namespace \"pie.in.the.sky\" on event \"Event0000\" does not"
+                        + " match namespace \"org.onap.policy.apex.sample.events\" for that event in the Apex model"));
             }
 
             apexEventJSONStringIn = JSONEventGenerator.jsonEventNoSource();
index b19ccee..49e6f3b 100644 (file)
@@ -34,6 +34,7 @@ import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.consumer
 import org.onap.policy.apex.service.engine.event.impl.filecarrierplugin.consumer.TextBlock;
 
 /**
+ * Test JSON Tagged Event Consumer.
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 public class TestJSONTaggedEventConsumer {
index 5d77bfd..8ecf9b7 100644 (file)
@@ -35,6 +35,7 @@ import org.onap.policy.apex.service.parameters.ApexParameters;
 import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerParameters;
 
 /**
+ * Test Plugin Factories.
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @author John Keeney (john.keeney@ericsson.com)
  */
index 247f9b9..2b8bd67 100644 (file)
@@ -28,6 +28,7 @@ import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 
 /**
+ * Test Apex Command Line Arguments.
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 public class TestApexCommandLineArguments {
@@ -165,7 +166,7 @@ public class TestApexCommandLineArguments {
         }
 
         final String[] args06 = {"-c", "src/test/resources/parameters/goodParams.json", "-m",
-                "src/test/resources/main/DummyModelFile.json"};
+                                 "src/test/resources/main/DummyModelFile.json"};
         try {
             apexArguments.parse(args06);
             apexArguments.validate();
index 33bcd0d..d22d528 100644 (file)
@@ -31,7 +31,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterHandler;
 import org.onap.policy.apex.service.parameters.ApexParameters;
 
 /**
- * Test for an empty parameter file
+ * Test for an empty parameter file.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -46,10 +46,9 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceContextNoParams.json\"\n"
-                            + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in \"contextParameters\" entry",
-                    e.getMessage());
+            assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextNoParams.json\"\n"
+                    + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in "
+                    + "\"contextParameters\" entry", e.getMessage());
         }
     }
 
@@ -62,10 +61,9 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceContextBadParams.json\"\n"
-                            + "(ApexParameterRuntimeException):failed to deserialize the parameters for \"contextParameters\" to parameter class \"hello\"\n"
-                            + "java.lang.ClassNotFoundException: hello",
+            assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextBadParams.json\""
+                    + "\n(ApexParameterRuntimeException):failed to deserialize the parameters for "
+                    + "\"contextParameters\" to parameter class \"hello\"\njava.lang.ClassNotFoundException: hello",
                     e.getMessage());
         }
     }
@@ -79,10 +77,10 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
-                            + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in \"contextParameters\" entry",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
+                    + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in "
+                    + "\"contextParameters\" entry", e.getMessage());
         }
     }
 
@@ -96,9 +94,10 @@ public class ContextParameterTests {
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
             assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceContextBadClassParams.json\"\n"
-                            + "(ApexParameterRuntimeException):failed to deserialize the parameters for \"contextParameters\" to parameter class \"java.lang.Integer\"\n"
-                            + "com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NUMBER but was BEGIN_OBJECT at path $",
+                    "error reading parameters from \"src/test/resources/parameters/serviceContextBadClassParams.json\""
+                    + "\n(ApexParameterRuntimeException):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());
         }
     }
@@ -112,10 +111,11 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException 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());
+            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());
         }
     }
 
@@ -235,10 +235,10 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException 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());
+            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());
         }
     }
 
@@ -251,10 +251,10 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException 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());
+            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());
         }
     }
 
@@ -267,10 +267,10 @@ public class ContextParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException 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());
+            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());
         }
     }
 }
index b14cc22..aa106a6 100644 (file)
@@ -30,7 +30,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterHandler;
 import org.onap.policy.apex.service.parameters.ApexParameters;
 
 /**
- * Test for an empty parameter file
+ * Test for an empty parameter file.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -61,7 +61,8 @@ public class ExecutorParameterTests {
         } catch (final ApexParameterException e) {
             assertEquals(
                     "error reading parameters from \"src/test/resources/parameters/serviceExecutorBadParams.json\"\n"
-                            + "(ApexParameterRuntimeException):value of \"executorParameters:ZOOBY\" entry is not a parameter JSON object",
+                            + "(ApexParameterRuntimeException):value of \"executorParameters:ZOOBY\" entry is not "
+                            + "a parameter JSON object",
                     e.getMessage());
         }
     }
@@ -75,10 +76,10 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorNoExecutorParams.json\"\n"
-                            + "(ApexParameterRuntimeException):no \"executorParameters\" entry found in parameters, at least one executor parameter entry must be specified",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceExecutorNoExecutorParams.json\"\n"
+                    + "(ApexParameterRuntimeException):no \"executorParameters\" entry found in parameters,"
+                    + " at least one executor parameter entry must be specified", e.getMessage());
         }
     }
 
@@ -91,10 +92,10 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorEmptyParams.json\"\n"
-                            + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in \"executorParameters:ZOOBY\" entry",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceExecutorEmptyParams.json\"\n"
+                    + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" "
+                    + "in \"executorParameters:ZOOBY\" entry", e.getMessage());
         }
     }
 
@@ -107,10 +108,10 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorBadPluginNameParams.json\"\n"
-                            + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" in \"executorParameters:ZOOBY\" entry",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceExecutorBadPluginNameParams.json\"\n"
+                    + "(ApexParameterRuntimeException):could not find field \"parameterClassName\" "
+                    + "in \"executorParameters:ZOOBY\" entry", e.getMessage());
         }
     }
 
@@ -123,10 +124,10 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json\"\n"
-                            + "(ApexParameterRuntimeException):value for field \"parameterClassName\" in \"executorParameters:LOOBY\" entry is not a plain string",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceExecutorBadPluginValueObjectParams.json\"\n"
+                    + "(ApexParameterRuntimeException):value for field \"parameterClassName\" "
+                    + "in \"executorParameters:LOOBY\" entry is not a plain string", e.getMessage());
         }
     }
 
@@ -139,10 +140,10 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json\"\n"
-                            + "(ApexParameterRuntimeException):value for field \"parameterClassName\" in \"executorParameters:LOOBY\" entry is not specified or is blank",
-                    e.getMessage());
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/serviceExecutorBadPluginValueBlankParams.json\"\n"
+                    + "(ApexParameterRuntimeException):value for field \"parameterClassName\" "
+                    + "in \"executorParameters:LOOBY\" entry is not specified or is blank", e.getMessage());
         }
     }
 
@@ -156,11 +157,11 @@ public class ExecutorParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/serviceExecutorBadPluginValueParams.json\"\n"
-                            + "(ApexParameterRuntimeException):failed to deserialize the parameters for \"executorParameters:LOOBY\" to parameter class \"helloworld\"\n"
-                            + "java.lang.ClassNotFoundException: helloworld",
-                    e.getMessage());
+            assertEquals("error reading parameters from"
+                    + " \"src/test/resources/parameters/serviceExecutorBadPluginValueParams.json\"\n"
+                    + "(ApexParameterRuntimeException):failed to deserialize the parameters "
+                    + "for \"executorParameters:LOOBY\" to parameter class \"helloworld\"\n"
+                    + "java.lang.ClassNotFoundException: helloworld", e.getMessage());
         }
     }
 
index 6ea8d59..6d3d7ee 100644 (file)
@@ -41,7 +41,7 @@ import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnolo
 import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParameters;
 
 /**
- * Test for an empty parameter file
+ * Test for an empty parameter file.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -115,19 +115,19 @@ public class ParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/badParams.json\"\n"
-                            + "Apex parameters invalid\n" + " engine service parameters invalid\n"
-                            + "  name [hello there] and/or version [PA1] invalid\n"
-                            + "   parameter \"name\": value \"hello there\", does not match regular expression \"[A-Za-z0-9\\-_\\.]+\"\n"
-                            + "  id not specified or specified value [-45] invalid, must be specified as id >= 0\n"
-                            + "  instanceCount [-345] invalid, must be specified as instanceCount >= 1\n"
-                            + "  deploymentPort [65536] invalid, must be specified as 1024 <= port <= 65535\n"
-                            + "  policyModelFileName [/some/file/name.xml] not found or is not a plain file\n"
-                            + " event input (TheFileConsumer1) parameters invalid\n"
-                            + "  fileName not specified or is blank or null, it must be specified as a valid file location\n"
-                            + " event output (FirstProducer) parameters invalid\n"
-                            + "  fileName not specified or is blank or null, it must be specified as a valid file location",
+            assertEquals("validation error(s) on parameters from \"src/test/resources/parameters/badParams.json\"\n"
+                    + "Apex parameters invalid\n" + " engine service parameters invalid\n"
+                    + "  name [hello there] and/or version [PA1] invalid\n"
+                    + "   parameter \"name\": value \"hello there\","
+                    + " does not match regular expression \"[A-Za-z0-9\\-_\\.]+\"\n"
+                    + "  id not specified or specified value [-45] invalid, must be specified as id >= 0\n"
+                    + "  instanceCount [-345] invalid, must be specified as instanceCount >= 1\n"
+                    + "  deploymentPort [65536] invalid, must be specified as 1024 <= port <= 65535\n"
+                    + "  policyModelFileName [/some/file/name.xml] not found or is not a plain file\n"
+                    + " event input (TheFileConsumer1) parameters invalid\n"
+                    + "  fileName not specified or is blank or null, it must be specified as a valid file location\n"
+                    + " event output (FirstProducer) parameters invalid\n"
+                    + "  fileName not specified or is blank or null, it must be specified as a valid file location",
                     e.getMessage());
         }
     }
index dad9899..a476b84 100644 (file)
@@ -31,7 +31,7 @@ import org.onap.policy.apex.service.parameters.ApexParameterHandler;
 import org.onap.policy.apex.service.parameters.ApexParameters;
 
 /**
- * Test for an empty parameter file
+ * Test for an empty parameter file.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -111,11 +111,11 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsNoCTParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):carrier technology \"SUPER_DOOPER\" does not match plugin \"FILE\" in "
-                            + "\"com.ericsson.apex.service.engine.event.impl.filecarrierplugin.FILECarrierTechnologyParameters\", "
-                            + "specify correct carrier technology parameter plugin in parameter \"parameterClassName\"",
+            assertEquals("error reading parameters from \"src/test/resources/parameters/prodConsNoCTParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):carrier technology \"SUPER_DOOPER\" "
+                    + "does not match plugin \"FILE\" in "
+                    + "\"com.ericsson.apex.service.engine.event.impl.filecarrierplugin.FILECarrierTechnologyParameters"
+                    + "\", specify correct carrier technology parameter plugin in parameter \"parameterClassName\"",
                     e.getMessage());
         }
     }
@@ -129,11 +129,12 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsMismatchCTParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):carrier technology \"SUPER_LOOPER\" does not match plugin \"SUPER_DOOPER\" in "
-                            + "\"com.ericsson.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters\", "
-                            + "specify correct carrier technology parameter plugin in parameter \"parameterClassName\"",
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/prodConsMismatchCTParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):carrier technology \"SUPER_LOOPER\" "
+                    + "does not match plugin \"SUPER_DOOPER\" in \""
+                    + "com.ericsson.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters"
+                    + "\", specify correct carrier technology parameter plugin in parameter \"parameterClassName\"",
                     e.getMessage());
         }
     }
@@ -147,11 +148,12 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsWrongTypeCTParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):could not create default parameters for carrier technology \"SUPER_DOOPER\"\n"
-                            + "com.ericsson.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters "
-                            + "cannot be cast to com.ericsson.apex.service.parameters.carriertechnology.CarrierTechnologyParameters",
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/prodConsWrongTypeCTParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):could not create default parameters for carrier technology "
+                    + "\"SUPER_DOOPER\"\ncom.ericsson.apex.service.engine.parameters.dummyclasses."
+                    + "SuperTokenDelimitedEventProtocolParameters cannot be cast to "
+                    + "com.ericsson.apex.service.parameters.carriertechnology.CarrierTechnologyParameters",
                     e.getMessage());
         }
     }
@@ -184,9 +186,9 @@ public class ProducerConsumerTests {
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
             assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/prodConsBadFileName.json\"\n"
-                            + "Apex parameters invalid\n" + " event output (aProducer) parameters invalid\n"
-                            + "  fileName not specified or is blank or null, it must be specified as a valid file location",
+                    "validation error(s) on parameters from \"src/test/resources/parameters/prodConsBadFileName.json\""
+                    + "\nApex parameters invalid\n" + " event output (aProducer) parameters invalid"
+                    + "\n fileName not specified or is blank or null, it must be specified as a valid file location",
                     e.getMessage());
         }
     }
@@ -201,11 +203,10 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsBadEPParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_DEL\" does not match plugin \"JSON\" in "
-                            + "\"com.ericsson.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters\", "
-                            + "specify correct event protocol parameter plugin in parameter \"parameterClassName\"",
+            assertEquals("error reading parameters from \"src/test/resources/parameters/prodConsBadEPParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_DEL\" does not match plugin \"JSON\" "
+                    + "in \"com.ericsson.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters"
+                    + "\", specify correct event protocol parameter plugin in parameter \"parameterClassName\"",
                     e.getMessage());
         }
     }
@@ -219,11 +220,10 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsNoEPParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_DEL\" does not match plugin \"JSON\" in "
-                            + "\"com.ericsson.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters\", "
-                            + "specify correct event protocol parameter plugin in parameter \"parameterClassName\"",
+            assertEquals("error reading parameters from \"src/test/resources/parameters/prodConsNoEPParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_DEL\" does not match plugin \"JSON\" "
+                    + "in \"com.ericsson.apex.service.engine.event.impl.jsonprotocolplugin.JSONEventProtocolParameters"
+                    + "\", specify correct event protocol parameter plugin in parameter \"parameterClassName\"",
                     e.getMessage());
         }
     }
@@ -239,8 +239,10 @@ public class ProducerConsumerTests {
         } catch (final ApexParameterException e) {
             assertEquals(
                     "error reading parameters from \"src/test/resources/parameters/prodConsMismatchEPParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_BEL\" does not match plugin \"SUPER_TOK_DEL\" in "
-                            + "\"com.ericsson.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters\", "
+                            + "(ApexParameterRuntimeException):event protocol \"SUPER_TOK_BEL\" "
+                            + "does not match plugin \"SUPER_TOK_DEL\" in "
+                            + "\"com.ericsson.apex.service.engine.parameters.dummyclasses."
+                            + "SuperTokenDelimitedEventProtocolParameters\", "
                             + "specify correct event protocol parameter plugin in parameter \"parameterClassName\"",
                     e.getMessage());
         }
@@ -255,11 +257,12 @@ public class ProducerConsumerTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "error reading parameters from \"src/test/resources/parameters/prodConsWrongTypeEPParClass.json\"\n"
-                            + "(ApexParameterRuntimeException):could not create default parameters for event protocol \"SUPER_TOK_DEL\"\n"
-                            + "com.ericsson.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters "
-                            + "cannot be cast to com.ericsson.apex.service.parameters.eventprotocol.EventProtocolParameters",
+            assertEquals("error reading parameters from "
+                    + "\"src/test/resources/parameters/prodConsWrongTypeEPParClass.json\"\n"
+                    + "(ApexParameterRuntimeException):could not create default parameters for event protocol "
+                    + "\"SUPER_TOK_DEL\"\n"
+                    + "com.ericsson.apex.service.engine.parameters.dummyclasses.SuperDooperCarrierTechnologyParameters "
+                    + "cannot be cast to com.ericsson.apex.service.parameters.eventprotocol.EventProtocolParameters",
                     e.getMessage());
         }
     }
index 62e27ea..cc1d6d3 100644 (file)
@@ -38,7 +38,7 @@ import org.onap.policy.apex.service.parameters.eventhandler.EventHandlerPeeredMo
 import org.onap.policy.apex.service.parameters.eventprotocol.EventProtocolParameters;
 
 /**
- * Test for an empty parameter file
+ * Test for an empty parameter file.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -52,11 +52,11 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " parameter \\\"synchronousPeer\\\" is illegal on non synchronous event output \"SyncProducer0\"",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsNoSyncWithPeer.json\"\n"
+                    + "Apex parameters invalid\n"
+                    + " parameter \\\"synchronousPeer\\\" is illegal on non synchronous event output "
+                    + "\"SyncProducer0\"", e.getMessage());
         }
     }
 
@@ -69,10 +69,10 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " parameter \\\"synchronousPeer\\\" is illegal on non synchronous event output \"SyncProducer0\"",
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsNotSyncWithPeer.json\"\n"
+                    + "Apex parameters invalid\n"
+                    + " parameter \\\"synchronousPeer\\\" is illegal on non synchronous event output \"SyncProducer0\"",
                     e.getMessage());
         }
     }
@@ -86,14 +86,16 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsBadPeers.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " specified \"synchronousPeer\" parameter value \"SyncConsumer1\" on event input \"SyncConsumer0\" does not exist or is an invalid peer for this event handler\n"
-                            + " specified \"synchronousPeer\" parameter value \"SyncConsumer0\" on event input \"SyncConsumer1\" does not exist or is an invalid peer for this event handler\n"
-                            + " specified \"synchronousPeer\" parameter value \"SyncProducer1\" on event output \"SyncProducer0\" does not exist or is an invalid peer for this event handler\n"
-                            + " specified \"synchronousPeer\" parameter value \"SyncProducer0\" on event output \"SyncProducer1\" does not exist or is an invalid peer for this event handler",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsBadPeers.json\"" + "\nApex parameters invalid\n"
+                    + " specified \"synchronousPeer\" parameter value \"SyncConsumer1\" on event input "
+                    + "\"SyncConsumer0\" does not exist or is an invalid peer for this event handler\n"
+                    + " specified \"synchronousPeer\" parameter value \"SyncConsumer0\" on event input "
+                    + "\"SyncConsumer1\" does not exist or is an invalid peer for this event handler\n"
+                    + " specified \"synchronousPeer\" parameter value \"SyncProducer1\" on event output "
+                    + "\"SyncProducer0\" does not exist or is an invalid peer for this event handler\n"
+                    + " specified \"synchronousPeer\" parameter value \"SyncProducer0\" on event output "
+                    + "\"SyncProducer1\" does not exist or is an invalid peer for this event handler", e.getMessage());
         }
     }
 
@@ -106,16 +108,21 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsInvalidTimeout.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " parameter \\\"synchronousTimeout\\\" value \"-1\" is illegal on synchronous event input \"SyncConsumer0\", specify a non-negative timeout value in milliseconds\n"
-                            + " parameter \\\"synchronousTimeout\\\" value \"-99999999\" is illegal on synchronous event input \"SyncConsumer1\", specify a non-negative timeout value in milliseconds\n"
-                            + " parameter \\\"synchronousTimeout\\\" value \"-10\" is illegal on synchronous event output \"SyncProducer0\", specify a non-negative timeout value in milliseconds\n"
-                            + " parameter \\\"synchronousTimeout\\\" value \"-3\" is illegal on synchronous event output \"SyncProducer1\", specify a non-negative timeout value in milliseconds\n"
-                            + " synchronous timeout of event input \"SyncConsumer0\" and event output \"SyncProducer0\" [-1/-10] do not match\n"
-                            + " synchronous timeout of event input \"SyncConsumer1\" and event output \"SyncProducer1\" [-99999999/-3] do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsInvalidTimeout.json\"\n"
+                    + "Apex parameters invalid\n"
+                    + " parameter \\\"synchronousTimeout\\\" value \"-1\" is illegal on synchronous event input "
+                    + "\"SyncConsumer0\", specify a non-negative timeout value in milliseconds\n"
+                    + " parameter \\\"synchronousTimeout\\\" value \"-99999999\" is illegal on synchronous event input "
+                    + "\"SyncConsumer1\", specify a non-negative timeout value in milliseconds\n"
+                    + " parameter \\\"synchronousTimeout\\\" value \"-10\" is illegal on synchronous event output "
+                    + "\"SyncProducer0\", specify a non-negative timeout value in milliseconds\n"
+                    + " parameter \\\"synchronousTimeout\\\" value \"-3\" is illegal on synchronous event output "
+                    + "\"SyncProducer1\", specify a non-negative timeout value in milliseconds\n"
+                    + " synchronous timeout of event input \"SyncConsumer0\" and event output \"SyncProducer0\" "
+                    + "[-1/-10] do not match\n"
+                    + " synchronous timeout of event input \"SyncConsumer1\" and event output "
+                    + "\"SyncProducer1\" [-99999999/-3] do not match", e.getMessage());
         }
     }
 
@@ -128,11 +135,10 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsBadTimeout.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " parameter \\\"synchronousTimeout\\\" is illegal on non synchronous event output \"MyOtherProducer\"",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsBadTimeout.json\"\n" + "Apex parameters invalid\n"
+                    + " parameter \\\"synchronousTimeout\\\" is illegal on non synchronous event output "
+                    + "\"MyOtherProducer\"", e.getMessage());
         }
     }
 
@@ -145,12 +151,13 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncBadParamsUnpairedTimeout.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " synchronous timeout of event input \"SyncConsumer0\" and event output \"SyncProducer0\" [1/10] do not match\n"
-                            + " synchronous timeout of event input \"SyncConsumer1\" and event output \"SyncProducer1\" [99999999/3] do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncBadParamsUnpairedTimeout.json\"\n"
+                    + "Apex parameters invalid\n"
+                    + " synchronous timeout of event input \"SyncConsumer0\" and event output "
+                    + "\"SyncProducer0\" [1/10] do not match\n"
+                    + " synchronous timeout of event input \"SyncConsumer1\" and event output "
+                    + "\"SyncProducer1\" [99999999/3] do not match", e.getMessage());
         }
     }
 
@@ -223,13 +230,12 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncUnusedConsumerPeers.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " value of parameter \"synchronousPeer\" on event output \"SyncProducer1\" must be unique, it s used on another event output\n"
-                            + ""
-                            + " synchronous peers of event input \"SyncConsumer1\" and event output \"SyncProducer1/SyncConsumer0\" do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncUnusedConsumerPeers.json\"\n" + "Apex parameters invalid\n"
+                    + " value of parameter \"synchronousPeer\" on event output \"SyncProducer1\" must be unique, "
+                    + "it s used on another event output\n"
+                    + " synchronous peers of event input \"SyncConsumer1\" and event output "
+                    + "\"SyncProducer1/SyncConsumer0\" do not match", e.getMessage());
         }
     }
 
@@ -242,12 +248,12 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncMismatchedPeers.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " synchronous peers of event input \"SyncConsumer0\" and event output \"SyncProducer0/SyncConsumer1\" do not match\n"
-                            + " synchronous peers of event input \"SyncConsumer1\" and event output \"SyncProducer1/SyncConsumer0\" do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncMismatchedPeers.json\"\nApex parameters invalid\n"
+                    + " synchronous peers of event input \"SyncConsumer0\" and event output "
+                    + "\"SyncProducer0/SyncConsumer1\" do not match\n"
+                    + " synchronous peers of event input \"SyncConsumer1\" and event output "
+                    + "\"SyncProducer1/SyncConsumer0\" do not match", e.getMessage());
         }
     }
 
@@ -260,12 +266,11 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncUnusedProducerPeers.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " value of parameter \"synchronousPeer\" on event input \"SyncConsumer1\" must be unique, it s used on another event input\n"
-                            + " synchronous peers of event input \"SyncConsumer0\" and event output \"SyncProducer1/SyncConsumer1\" do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncUnusedProducerPeers.json\"\nApex parameters invalid\n"
+                    + " value of parameter \"synchronousPeer\" on event input \"SyncConsumer1\" must be unique, "
+                    + "it is used on another event input\nsynchronous peers of event input \"SyncConsumer0\" and event"
+                    + " output \"SyncProducer1/SyncConsumer1\" do not match", e.getMessage());
         }
     }
 
@@ -278,12 +283,12 @@ public class SyncParameterTests {
             new ApexParameterHandler().getParameters(arguments);
             fail("This test should throw an exception");
         } catch (final ApexParameterException e) {
-            assertEquals(
-                    "validation error(s) on parameters from \"src/test/resources/parameters/syncUnusedProducerPeers.json\"\n"
-                            + "Apex parameters invalid\n"
-                            + " value of parameter \"synchronousPeer\" on event input \"SyncConsumer1\" must be unique, it s used on another event input\n"
-                            + " synchronous peers of event input \"SyncConsumer0\" and event output \"SyncProducer1/SyncConsumer1\" do not match",
-                    e.getMessage());
+            assertEquals("validation error(s) on parameters from "
+                    + "\"src/test/resources/parameters/syncUnusedProducerPeers.json\"\n" + "Apex parameters invalid\n"
+                    + " value of parameter \"synchronousPeer\" on event input \"SyncConsumer1\" "
+                    + "must be unique, it s used on another event input\n"
+                    + " synchronous peers of event input \"SyncConsumer0\" and event output "
+                    + "\"SyncProducer1/SyncConsumer1\" do not match", e.getMessage());
         }
     }
 
index 6d7c6ff..8d7d659 100644 (file)
@@ -24,7 +24,7 @@ import org.onap.policy.apex.context.parameters.DistributorParameters;
 import org.onap.policy.apex.model.basicmodel.service.ParameterService;
 
 /**
- * Distributor parameters for the Super Dooper Distributor
+ * Distributor parameters for the Super Dooper Distributor.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @version
index 3af7729..a7bf4d5 100644 (file)
@@ -23,7 +23,7 @@ package org.onap.policy.apex.service.engine.parameters.dummyclasses;
 import org.onap.policy.apex.core.engine.ExecutorParameters;
 
 /**
- * Default Executor parameters for MVEL
+ * Default Executor parameters for MVEL.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @version
index bb9d0c7..f86ce6a 100644 (file)
@@ -25,7 +25,7 @@
     <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
     <property name="LOG_DIR" value="${java.io.tmpdir}/apex_logging/" />
 
-       <!-- USE FOR STD OUT ONLY -->
+    <!-- USE FOR STD OUT ONLY -->
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <encoder>
             <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern>