Merge "Fix checkstyle warnings in context-test-utils"
authorJorge Hernandez <jh1730@att.com>
Wed, 15 Aug 2018 16:20:14 +0000 (16:20 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 15 Aug 2018 16:20:14 +0000 (16:20 +0000)
21 files changed:
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/AlbumModifier.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/LockType.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/NoLockAlbumModifier.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/ReadLockAlbumModifier.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/SingleValueWriteLockAlbumModifier.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/lock/modifier/WriteLockAlbumModifier.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProvider.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ConfigrationProviderImpl.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/Constants.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/IntegrationThreadFactory.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/NetworkUtils.java
context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/utils/ZooKeeperServerServiceProvider.java
context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java
context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java
context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java
context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java
context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java

index 7f019f5..3afd5c8 100644 (file)
@@ -32,7 +32,7 @@ public class TestContextBooleanItem implements Serializable {
 
     private static final long serialVersionUID = 7241008665286367796L;
 
-    private boolean flag = false;;
+    private boolean flag = false;
 
     /**
      * The Constructor.
index 888394b..b4e9ad3 100644 (file)
@@ -273,9 +273,8 @@ public class ContextInstantiation {
             try {
                 externalContextAlbum.put("TestExternalContextItem00A", null);
             } catch (final ContextRuntimeException e) {
-                assertEquals(
-                        "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()",
-                        e.getMessage());
+                assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key "
+                        + "\"TestExternalContextItem00A\" for put()", e.getMessage());
             }
             assertEquals(tciAA, externalContextItem.getTestExternalContextItem00A());
 
@@ -302,25 +301,24 @@ public class ContextInstantiation {
             try {
                 externalContextAlbum.put("TestExternalContextItem00A", null);
             } catch (final ContextRuntimeException e) {
-                assert (e.getMessage().equals(
-                        "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItem00A\" for put()"));
+                assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key "
+                        + "\"TestExternalContextItem00A\" for put()"));
             }
             assertTrue(externalContextAlbum.get(EXTERNAL_CONTEXT).equals(externalContext));
 
             try {
                 externalContextAlbum.put("TestExternalContextItemFFF", null);
             } catch (final ContextRuntimeException e) {
-                assert (e.getMessage().equals(
-                        "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()"));
+                assert (e.getMessage().equals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key "
+                        + "\"TestExternalContextItemFFF\" for put()"));
             }
             assertEquals(1, externalContextAlbum.size());
 
             try {
                 externalContextAlbum.put("TestExternalContextItemFFF", null);
             } catch (final ContextRuntimeException e) {
-                assertEquals(
-                        "album \"ExternalContextAlbum:0.0.1\" null values are illegal on key \"TestExternalContextItemFFF\" for put()",
-                        e.getMessage());
+                assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key "
+                        + "\"TestExternalContextItemFFF\" for put()", e.getMessage());
             }
             assertEquals(1, externalContextAlbum.size());
 
index 3310016..8f066c8 100644 (file)
@@ -94,9 +94,9 @@ public class ContextUpdate {
             longContextAlbum.put(_0, ZERO);
             fail(EXCEPTION_MESSAGE);
         } catch (final ContextRuntimeException e) {
-            assertEquals(
-                    "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"",
-                    e.getMessage());
+            assertEquals("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\":"
+                    + " LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with"
+                    + " class \"java.lang.Long\"", e.getMessage());
         }
 
         try {
@@ -104,7 +104,8 @@ public class ContextUpdate {
             fail(EXCEPTION_MESSAGE);
         } catch (final ContextRuntimeException e) {
             assertEquals(
-                    "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum:0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"",
+                    "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum"
+                    + ":0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"",
                     e.getMessage());
         }
 
index 24e6331..14ceba4 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.apex.context.test.lock.modifier;
 
 import org.onap.policy.apex.context.ContextAlbum;
index 0dd0e72..c0ac362 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.apex.context.test.lock.modifier;
 
 import org.onap.policy.apex.context.ContextRuntimeException;
index fc1c830..020bc41 100644 (file)
@@ -120,8 +120,8 @@ public final class ConcurrentContextJVM {
         // An even number of arguments greater than 3
         if (args.length < 9) {
             LOGGER.error("invalid arguments: " + Arrays.toString(args));
-            LOGGER.error(
-                    "usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize lockType [parameterKey parameterJson].... ");
+            LOGGER.error("usage: TestConcurrentContextJVM testType jvmNo threadCount threadLoops albumSize "
+                    + "lockType [parameterKey parameterJson].... ");
             return;
         }
 
index 5042909..f04cf5b 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.apex.context.test.utils;
 
 import java.util.HashMap;
@@ -135,7 +136,7 @@ public class ConfigrationProviderImpl implements ConfigrationProvider {
     public Map<String, Object> getContextAlbumInitValues() {
         final Map<String, Object> values = new HashMap<>();
         for (int i = 0; i < albumSize; i++) {
-            values.put(Integer.toString(i), new TestContextLongItem(0l));
+            values.put(Integer.toString(i), new TestContextLongItem(0L));
         }
         return values;
     }
index 933c68b..1185864 100644 (file)
@@ -59,7 +59,7 @@ public class Constants {
     private static final AxArtifactKey KEY3 = new AxArtifactKey("testC-bot", VERSION);
     private static final AxArtifactKey KEY2 = new AxArtifactKey("testC-next", VERSION);
 
-    private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3};;
+    private static final AxArtifactKey[] USED_ARTIFACT_STACK_ARRAY = new AxArtifactKey[] {KEY, KEY2, KEY3};
 
     public static final AxArtifactKey[] getAxArtifactKeyArray() {
         return USED_ARTIFACT_STACK_ARRAY;
index 01331f2..8d2c892 100644 (file)
@@ -17,6 +17,7 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.apex.context.test.utils;
 
 import java.net.InetAddress;
@@ -36,7 +37,7 @@ public class NetworkUtils {
      * function sets the address to be the first non-loopback IPv4 address on a host
      * 
      * @return Set of IPv4 addresses
-     * @throws SocketException
+     * @throws SocketException throw socket exception if error occurs
      */
     public static TreeSet<String> getIPv4NonLoopAddresses() throws SocketException {
         final TreeSet<String> ipAddressSet = new TreeSet<String>();
index c29353c..9d0210e 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.onap.policy.apex.context.test.locking;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -131,7 +130,7 @@ public class TestConcurrentContext {
             @Override
             public Map<String, Object> getContextAlbumInitValues() {
                 final Map<String, Object> initValues = super.getContextAlbumInitValues();
-                initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0l));
+                initValues.put(Constants.TEST_VALUE, new TestContextLongItem(0L));
                 return initValues;
             }
         };
index a059285..5d41eee 100644 (file)
@@ -40,9 +40,9 @@ import org.onap.policy.apex.context.Distributor;
 import org.onap.policy.apex.context.impl.distribution.DistributorFactory;
 import org.onap.policy.apex.context.parameters.ContextParameters;
 import org.onap.policy.apex.context.parameters.PersistorParameters;
-import org.onap.policy.apex.context.test.concepts.TestContextLongItem;
 import org.onap.policy.apex.context.test.concepts.TestContextDateItem;
 import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem;
+import org.onap.policy.apex.context.test.concepts.TestContextLongItem;
 import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem;
 import org.onap.policy.apex.context.test.factory.TestContextAlbumFactory;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
@@ -118,7 +118,8 @@ public class TestPersistentContextInstantiation {
 
         contextAlbumForMap.putAll(valueMap0);
 
-        assertEquals(((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"),
+        assertEquals(
+                ((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"),
                 "This is a policy context string");
 
         contextAlbumForMap.flush();