aboutsummaryrefslogtreecommitdiffstats
path: root/context
diff options
context:
space:
mode:
Diffstat (limited to 'context')
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java (renamed from context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java)6
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java4
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java (renamed from context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java)2
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java6
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java35
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java23
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java4
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java4
-rw-r--r--context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java15
-rw-r--r--context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java2
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java12
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java8
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java22
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java6
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/SequentialContextInstantiation.java14
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java2
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvm.java (renamed from context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java)10
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvmThread.java (renamed from context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java)8
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java16
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java14
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextUpdate.java14
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java24
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java22
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java12
26 files changed, 164 insertions, 125 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
index 305f14c8d..0f991ba36 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
@@ -424,7 +424,7 @@ public final class ContextAlbumImpl implements ContextAlbum {
}
// Sanity check on incoming context
- Assertions.argumentNotNull(incomingContextAlbum, ContextRuntimeException.class,
+ Assertions.argumentOfClassNotNull(incomingContextAlbum, ContextRuntimeException.class,
"cannot update context, context album is null");
// Iterate over the incoming context
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
index dba81d321..55df01b40 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFactory.java
@@ -49,7 +49,7 @@ public class DistributorFactory {
public Distributor getDistributor(final AxArtifactKey key) throws ContextException {
LOGGER.entry("Distributor factory, key=" + key);
- Assertions.argumentNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
+ Assertions.argumentOfClassNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
// Get the class for the distributor using reflection
final DistributorParameters distributorParameters = ParameterService
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java
index cb9a77883..701c59342 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JvmLocalDistributor.java
@@ -34,14 +34,14 @@ import org.slf4j.ext.XLoggerFactory;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class JVMLocalDistributor extends AbstractDistributor {
+public class JvmLocalDistributor extends AbstractDistributor {
// Logger for this class
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(JVMLocalDistributor.class);
+ private static final XLogger LOGGER = XLoggerFactory.getXLogger(JvmLocalDistributor.class);
/**
* Create an instance of a JVM Local Context Distributor.
*/
- public JVMLocalDistributor() {
+ public JvmLocalDistributor() {
super();
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
index c45e3bd27..3e9120672 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/LockManagerFactory.java
@@ -66,8 +66,8 @@ public class LockManagerFactory {
// Check the class is a lock manager
if (!(lockManagerObject instanceof LockManager)) {
- LOGGER.error("Specified Apex context lock manager plugin class \"{}\" does not implement the LockManager interface",
- pluginClass);
+ LOGGER.error("Specified Apex context lock manager plugin class \"{}\" "
+ + "does not implement the LockManager interface", pluginClass);
throw new ContextException("Specified Apex context lock manager plugin class \"" + pluginClass
+ "\" does not implement the LockManager interface");
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java
index 5e71557b8..721aa7f3c 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JVMLocalLockManager.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/locking/jvmlocal/JvmLocalLockManager.java
@@ -32,7 +32,7 @@ import org.onap.policy.apex.context.impl.locking.AbstractLockManager;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class JVMLocalLockManager extends AbstractLockManager {
+public class JvmLocalLockManager extends AbstractLockManager {
/*
* (non-Javadoc)
*
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
index 34fa15dcb..60de80a7f 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/persistence/PersistorFactory.java
@@ -48,7 +48,7 @@ public class PersistorFactory {
*/
public Persistor createPersistor(final AxArtifactKey key) throws ContextException {
LOGGER.entry("persistor factory, key=" + key);
- Assertions.argumentNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
+ Assertions.argumentOfClassNotNull(key, ContextException.class, "Parameter \"key\" may not be null");
final PersistorParameters persistorParameters = ParameterService
.get(ContextParameterConstants.PERSISTENCE_GROUP_NAME);
@@ -67,8 +67,8 @@ public class PersistorFactory {
// Check the class is a persistor
if (!(persistorObject instanceof Persistor)) {
- LOGGER.error("Specified Apex context persistor plugin class \"{}\" does not implement the ContextDistributor interface",
- pluginClass);
+ LOGGER.error("Specified Apex context persistor plugin class \"{}\" "
+ + "does not implement the ContextDistributor interface", pluginClass);
throw new ContextException("Specified Apex context persistor plugin class \"" + pluginClass
+ "\" does not implement the ContextDistributor interface");
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
index 5513cc7e6..bb22827cd 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
@@ -32,8 +32,8 @@ import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
/**
- * This class implements the {@link SchemaHelper} functionality that is common across all
- * implementations. Schema helpers for specific schema mechanisms specialize this class.
+ * This class implements the {@link SchemaHelper} functionality that is common across all implementations. Schema
+ * helpers for specific schema mechanisms specialize this class.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
@@ -62,14 +62,15 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.context.SchemaHelper#init(org.onap.policy.apex.model.basicmodel.concepts
- * .AxKey, org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema)
+ * @see org.onap.policy.apex.context.SchemaHelper#init(org.onap.policy.apex.model.basicmodel.concepts .AxKey,
+ * org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema)
*/
@Override
public void init(final AxKey incomingUserKey, final AxContextSchema incomingSchema) throws ContextRuntimeException {
- Assertions.argumentNotNull(incomingUserKey, ContextRuntimeException.class, "incomingUserKey may not be null");
- Assertions.argumentNotNull(incomingSchema, ContextRuntimeException.class, "incomingSchema may not be null");
+ Assertions.argumentOfClassNotNull(incomingUserKey, ContextRuntimeException.class,
+ "incomingUserKey may not be null");
+ Assertions.argumentOfClassNotNull(incomingSchema, ContextRuntimeException.class,
+ "incomingSchema may not be null");
this.userKey = incomingUserKey;
this.schema = incomingSchema;
@@ -123,8 +124,8 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
@Override
public Object createNewInstance() {
if (schemaClass == null) {
- final String returnString =
- userKey.getId() + ": could not create an instance, schema class for the schema is null";
+ final String returnString = userKey.getId()
+ + ": could not create an instance, schema class for the schema is null";
LOGGER.warn(returnString);
throw new ContextRuntimeException(returnString);
}
@@ -132,9 +133,9 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
try {
return schemaClass.newInstance();
} catch (final Exception e) {
- final String returnString =
- userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
- + "\" using the default constructor \"" + schemaClass.getSimpleName() + "()\"";
+ final String returnString = userKey.getId() + ": could not create an instance of class \""
+ + schemaClass.getCanonicalName() + "\" using the default constructor \""
+ + schemaClass.getSimpleName() + "()\"";
LOGGER.warn(returnString, e);
throw new ContextRuntimeException(returnString, e);
}
@@ -148,8 +149,8 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
@Override
public Object createNewInstance(final String stringValue) {
if (schemaClass == null) {
- final String returnString =
- userKey.getId() + ": could not create an instance, schema class for the schema is null";
+ final String returnString = userKey.getId()
+ + ": could not create an instance, schema class for the schema is null";
LOGGER.warn(returnString);
throw new ContextRuntimeException(returnString);
}
@@ -161,9 +162,9 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
// Invoke the constructor
return stringConstructor.newInstance(stringValue);
} catch (final Exception e) {
- final String returnString =
- userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
- + "\" using the string constructor \"" + schemaClass.getSimpleName() + "(String)\"";
+ final String returnString = userKey.getId() + ": could not create an instance of class \""
+ + schemaClass.getCanonicalName() + "\" using the string constructor \""
+ + schemaClass.getSimpleName() + "(String)\"";
LOGGER.warn(returnString, e);
throw new ContextRuntimeException(returnString);
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
index c6120c783..efc89b50d 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
@@ -54,15 +54,16 @@ public class SchemaHelperFactory {
*/
public SchemaHelper createSchemaHelper(final AxKey owningEntityKey, final AxArtifactKey schemaKey) {
LOGGER.entry("schema helper factory, owningEntityKey=" + owningEntityKey);
- Assertions.argumentNotNull(owningEntityKey, ContextRuntimeException.class,
- "Parameter \"owningEntityKey\" may not be null");
- Assertions.argumentNotNull(schemaKey, ContextRuntimeException.class, "Parameter \"schemaKey\" may not be null");
+ Assertions.argumentOfClassNotNull(owningEntityKey, ContextRuntimeException.class,
+ "Parameter \"owningEntityKey\" may not be null");
+ Assertions.argumentOfClassNotNull(schemaKey, ContextRuntimeException.class,
+ "Parameter \"schemaKey\" may not be null");
// Get the schema for items in the album
final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(schemaKey);
if (schema == null) {
- final String resultString =
- "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId() + " does not exist";
+ final String resultString = "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId()
+ + " does not exist";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -71,11 +72,11 @@ public class SchemaHelperFactory {
final SchemaParameters schemaParameters = ParameterService.get(ContextParameterConstants.SCHEMA_GROUP_NAME);
// Get the class for the schema helper from the schema parameters
- final SchemaHelperParameters schemaHelperParameters =
- schemaParameters.getSchemaHelperParameters(schema.getSchemaFlavour());
+ final SchemaHelperParameters schemaHelperParameters = schemaParameters
+ .getSchemaHelperParameters(schema.getSchemaFlavour());
if (schemaHelperParameters == null) {
final String resultString = "context schema helper parameters not found for context schema \""
- + schema.getSchemaFlavour() + "\"";
+ + schema.getSchemaFlavour() + "\"";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -87,7 +88,7 @@ public class SchemaHelperFactory {
schemaHelperObject = Class.forName(pluginClass).newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
final String resultString = "Apex context schema helper class not found for context schema helper plugin \""
- + pluginClass + "\"";
+ + pluginClass + "\"";
LOGGER.warn(resultString, e);
throw new ContextRuntimeException(resultString, e);
}
@@ -95,7 +96,7 @@ public class SchemaHelperFactory {
// Check the class is a schema helper
if (!(schemaHelperObject instanceof SchemaHelper)) {
final String resultString = "Specified Apex context schema helper plugin class \"" + pluginClass
- + "\" does not implement the SchemaHelper interface";
+ + "\" does not implement the SchemaHelper interface";
LOGGER.warn(resultString);
throw new ContextRuntimeException(resultString);
}
@@ -107,7 +108,7 @@ public class SchemaHelperFactory {
schemaHelper.init(owningEntityKey.getKey(), schema);
LOGGER.exit("Schema Helper factory, owningEntityKey=" + owningEntityKey + ", selected schema helper of class "
- + schemaHelper.getClass());
+ + schemaHelper.getClass());
return schemaHelper;
}
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
index e3f58cae4..79310a0e2 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/DistributorParameters.java
@@ -20,7 +20,7 @@
package org.onap.policy.apex.context.parameters;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
@@ -33,7 +33,7 @@ import org.onap.policy.common.parameters.ParameterGroup;
*/
public class DistributorParameters implements ParameterGroup {
/** The default distributor makes context albums available to all threads in a single JVM. */
- public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JVMLocalDistributor.class.getCanonicalName();
+ public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JvmLocalDistributor.class.getCanonicalName();
private String name;
private String pluginClass = DEFAULT_DISTRIBUTOR_PLUGIN_CLASS;
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
index 27fc05a0b..ed23af1b6 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/parameters/LockManagerParameters.java
@@ -20,7 +20,7 @@
package org.onap.policy.apex.context.parameters;
-import org.onap.policy.apex.context.impl.locking.jvmlocal.JVMLocalLockManager;
+import org.onap.policy.apex.context.impl.locking.jvmlocal.JvmLocalLockManager;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.common.parameters.ParameterGroup;
@@ -35,7 +35,7 @@ public class LockManagerParameters implements ParameterGroup {
/**
* The default lock manager can lock context album instance across all threads in a single JVM.
*/
- public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JVMLocalLockManager.class.getCanonicalName();
+ public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JvmLocalLockManager.class.getCanonicalName();
private String name;
private String pluginClass = DEFAULT_LOCK_MANAGER_PLUGIN_CLASS;
diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
index 0208b7a9c..25928716e 100644
--- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
+++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
@@ -34,7 +34,7 @@ import org.onap.policy.apex.context.ContextAlbum;
import org.onap.policy.apex.context.ContextException;
import org.onap.policy.apex.context.ContextRuntimeException;
import org.onap.policy.apex.context.Distributor;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -57,7 +57,7 @@ public class ContextAlbumImplTest {
public static void prepareForTest() {
final ContextParameters contextParameters = new ContextParameters();
contextParameters.getLockManagerParameters()
- .setPluginClass("org.onap.policy.apex.context.impl.locking.jvmlocal.JVMLocalLockManager");
+ .setPluginClass("org.onap.policy.apex.context.impl.locking.jvmlocal.JvmLocalLockManager");
contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME);
contextParameters.getDistributorParameters().setName(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME);
@@ -76,6 +76,9 @@ public class ContextAlbumImplTest {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down the test data.
+ */
@AfterClass
public static void cleanUpAfterTest() {
ParameterService.deregister(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME);
@@ -107,7 +110,7 @@ public class ContextAlbumImplTest {
}
try {
- new ContextAlbumImpl(new AxContextAlbum(), new JVMLocalDistributor(), null);
+ new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), null);
fail("this test should throw an exception");
} catch (IllegalArgumentException e) {
assertEquals("Album map may not be null", e.getMessage());
@@ -116,7 +119,7 @@ public class ContextAlbumImplTest {
}
try {
- new ContextAlbumImpl(new AxContextAlbum(), new JVMLocalDistributor(), new LinkedHashMap<String, Object>());
+ new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), new LinkedHashMap<String, Object>());
fail("this test should throw an exception");
} catch (ApexRuntimeException e) {
assertEquals("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas "
@@ -138,7 +141,7 @@ public class ContextAlbumImplTest {
true, AxArtifactKey.getNullKey());
try {
- new ContextAlbumImpl(axContextAlbum, new JVMLocalDistributor(), new LinkedHashMap<String, Object>());
+ new ContextAlbumImpl(axContextAlbum, new JvmLocalDistributor(), new LinkedHashMap<String, Object>());
fail("this test should throw an exception");
} catch (ContextException e) {
assertEquals("could not initiate schema management for context album AxContextAlbum",
@@ -146,7 +149,7 @@ public class ContextAlbumImplTest {
}
axContextAlbum.setItemSchema(simpleStringSchema.getKey());
- Distributor distributor = new JVMLocalDistributor();
+ Distributor distributor = new JvmLocalDistributor();
distributor.init(axContextAlbum.getKey());
ContextAlbum album = new ContextAlbumImpl(axContextAlbum, distributor, new LinkedHashMap<String, Object>());
diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java
index a71ba3675..800a7011d 100644
--- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java
+++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelperInstanceCreationTest.java
@@ -25,12 +25,10 @@ import static org.junit.Assert.fail;
import org.junit.AfterClass;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.apex.context.SchemaHelper;
import org.onap.policy.apex.context.impl.schema.SchemaHelperFactory;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
-import org.onap.policy.apex.context.parameters.ContextParameters;
import org.onap.policy.apex.context.parameters.SchemaParameters;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java
index 0c94bcb1d..efad26052 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java
@@ -107,7 +107,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @return the TZ value
*/
- public String getTZValue() {
+ public String getTzValue() {
return timeZoneString;
}
@@ -116,7 +116,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @param tzValue the TZ value
*/
- public void setTZValue(final String tzValue) {
+ public void setTzValue(final String tzValue) {
this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName();
}
@@ -125,7 +125,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @return the dst
*/
- public boolean getDST() {
+ public boolean getDst() {
return dst;
}
@@ -134,7 +134,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @param newDst the dst
*/
- public void setDST(final boolean newDst) {
+ public void setDst(final boolean newDst) {
this.dst = newDst;
}
@@ -143,7 +143,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @return the UTC offset
*/
- public int getUTCOffset() {
+ public int getUtcOffset() {
return utcOffset;
}
@@ -152,7 +152,7 @@ public class TestContextDateLocaleItem implements Serializable {
*
* @param newUtcOffset the UTC offset
*/
- public void setUTCOffset(final int newUtcOffset) {
+ public void setUtcOffset(final int newUtcOffset) {
this.utcOffset = newUtcOffset;
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java
index 7d3ed80d5..7e1e32924 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java
@@ -91,7 +91,7 @@ public class TestContextDateTzItem implements Serializable {
*
* @return the TZ value
*/
- public String getTZValue() {
+ public String getTzValue() {
return timeZoneString;
}
@@ -100,7 +100,7 @@ public class TestContextDateTzItem implements Serializable {
*
* @param tzValue the TZ value
*/
- public void setTZValue(final String tzValue) {
+ public void setTzValue(final String tzValue) {
this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName();
}
@@ -109,7 +109,7 @@ public class TestContextDateTzItem implements Serializable {
*
* @return the dst
*/
- public boolean getDST() {
+ public boolean getDst() {
return dst;
}
@@ -118,7 +118,7 @@ public class TestContextDateTzItem implements Serializable {
*
* @param newDst the dst
*/
- public void setDST(final boolean newDst) {
+ public void setDst(final boolean newDst) {
this.dst = newDst;
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java
index 0fd013da7..084220c2f 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java
@@ -190,8 +190,8 @@ public class ContextInstantiation {
final AxContextModel externalContextModel = TestContextAlbumFactory.createExternalContextModel();
final TestContextDateTzItem tci9A = new TestContextDateTzItem(tci9);
- final TestContextDateLocaleItem tciAA = new TestContextDateLocaleItem(tciA);
- final TestExternalContextItem externalContext = getTestExternalContextItem(testDate, tci9A, tciAA);
+ final TestContextDateLocaleItem tciA_A = new TestContextDateLocaleItem(tciA);
+ final TestExternalContextItem externalContext = getTestExternalContextItem(testDate, tci9A, tciA_A);
final Map<String, Object> valueMap2 = new HashMap<>();
valueMap2.put(EXTERNAL_CONTEXT, externalContext);
@@ -226,7 +226,7 @@ public class ContextInstantiation {
assertEquals(tci9A.getDateValue().getTime(),
externalContextItem.getTestExternalContextItem009().getDateValue().getTime());
- assertEquals(tciAA.getDateValue().getTime(),
+ assertEquals(tciA_A.getDateValue().getTime(),
externalContextItem.getTestExternalContextItem00A().getDateValue().getTime());
assertEquals(TEST_TREE_SET, externalContextItem.getTestExternalContextItem00B().getSetValue());
assertEquals(TEST_HASH_MAP, externalContextItem.getTestExternalContextItem00C().getMapValue());
@@ -275,7 +275,7 @@ public class ContextInstantiation {
assertEquals("album \"ExternalContextAlbum:0.0.1\" null values are illegal on key "
+ "\"TestExternalContextItem00A\" for put()", e.getMessage());
}
- assertEquals(tciAA, externalContextItem.getTestExternalContextItem00A());
+ assertEquals(tciA_A, externalContextItem.getTestExternalContextItem00A());
// Should return the hash set
assertEquals(TEST_TREE_SET, externalContextItem.getTestExternalContextItem00B().getSetValue());
@@ -471,9 +471,9 @@ public class ContextInstantiation {
private TestContextDateLocaleItem getTestContextDateLocaleItem(final Date testDate) {
final TestContextDateLocaleItem tciA = new TestContextDateLocaleItem();
tciA.setDateValue(new TestContextDateItem(testDate));
- tciA.setTZValue(TIME_ZONE.getDisplayName());
- tciA.setDST(true);
- tciA.setUTCOffset(-600);
+ tciA.setTzValue(TIME_ZONE.getDisplayName());
+ tciA.setDst(true);
+ tciA.setUtcOffset(-600);
tciA.setLocale(Locale.ENGLISH);
return tciA;
}
@@ -481,13 +481,13 @@ public class ContextInstantiation {
private TestContextDateTzItem getTestContextDateTzItem(final Date testDate) {
final TestContextDateTzItem tci9 = new TestContextDateTzItem();
tci9.setDateValue(new TestContextDateItem(testDate));
- tci9.setTZValue(TIME_ZONE.getDisplayName());
- tci9.setDST(true);
+ tci9.setTzValue(TIME_ZONE.getDisplayName());
+ tci9.setDst(true);
return tci9;
}
private TestExternalContextItem getTestExternalContextItem(final Date testDate, final TestContextDateTzItem tci9A,
- final TestContextDateLocaleItem tciAA) {
+ final TestContextDateLocaleItem tciAa) {
final TestExternalContextItem externalContext = new TestExternalContextItem();
final TestContextBooleanItem testExternalContextItem000 = new TestContextBooleanItem(false);
@@ -513,7 +513,7 @@ public class ContextInstantiation {
externalContext.setTestExternalContextItem007(testExternalContextItem007);
externalContext.setTestExternalContextItem008(testExternalContextItem008);
externalContext.setTestExternalContextItem009(tci9A);
- externalContext.setTestExternalContextItem00A(tciAA);
+ externalContext.setTestExternalContextItem00A(tciAa);
externalContext.setTestExternalContextItem00B(testExternalContextItem00B);
externalContext.setTestExternalContextItem00C(testExternalContextItem00C);
return externalContext;
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java
index 8f066c8e3..95d14324c 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextUpdate.java
@@ -149,9 +149,9 @@ public class ContextUpdate {
private TestContextDateLocaleItem getTestContextDateLocaleItem() {
final TestContextDateLocaleItem tciA = new TestContextDateLocaleItem();
tciA.setDateValue(new TestContextDateItem(new Date()));
- tciA.setTZValue(TIME_ZONE.getDisplayName());
- tciA.setDST(true);
- tciA.setUTCOffset(-600);
+ tciA.setTzValue(TIME_ZONE.getDisplayName());
+ tciA.setDst(true);
+ tciA.setUtcOffset(-600);
tciA.setLocale(Locale.ENGLISH);
return tciA;
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/SequentialContextInstantiation.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/SequentialContextInstantiation.java
index 4041c079d..244bd7d24 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/SequentialContextInstantiation.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/SequentialContextInstantiation.java
@@ -253,9 +253,9 @@ public class SequentialContextInstantiation {
// Should return null
assertNull(dateAlbum.get("ItemNull"));
// Put should return the previous contextItem
- tciA00.setDST(false);
+ tciA00.setDst(false);
final TestContextDateLocaleItem tciA03_clone = new TestContextDateLocaleItem(tciA03);
- tciA03_clone.setDST(true);
+ tciA03_clone.setDst(true);
TestContextDateLocaleItem retItem = (TestContextDateLocaleItem) dateAlbum.put("Item03", tciA03_clone);
assertEquals(tciA03, retItem);
retItem = (TestContextDateLocaleItem) dateAlbum.put("Item03", tciA03);
@@ -332,17 +332,17 @@ public class SequentialContextInstantiation {
private TestContextDateTzItem getTestContextDateTzItem(final Date testDate) {
final TestContextDateTzItem tci9 = new TestContextDateTzItem();
tci9.setDateValue(new TestContextDateItem(testDate));
- tci9.setTZValue(TimeZone.getTimeZone("Europe/Dublin").getDisplayName());
- tci9.setDST(true);
+ tci9.setTzValue(TimeZone.getTimeZone("Europe/Dublin").getDisplayName());
+ tci9.setDst(true);
return tci9;
}
private TestContextDateLocaleItem getTestContextDateLocaleItem() {
final TestContextDateLocaleItem tciA00 = new TestContextDateLocaleItem();
tciA00.setDateValue(new TestContextDateItem(new Date()));
- tciA00.setTZValue(TIME_ZONE.getDisplayName());
- tciA00.setDST(true);
- tciA00.setUTCOffset(-600);
+ tciA00.setTzValue(TIME_ZONE.getDisplayName());
+ tciA00.setDst(true);
+ tciA00.setUtcOffset(-600);
tciA00.setLocale(Locale.ENGLISH);
return tciA00;
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java
index 4f6dd9b1f..88cdccc88 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContext.java
@@ -96,7 +96,7 @@ public class ConcurrentContext {
} else {
// Spawn JVMs to run the tests
for (int j = 0; j < configrationProvider.getJvmCount(); j++) {
- final ConcurrentContextJVMThread task = new ConcurrentContextJVMThread(j, configrationProvider);
+ final ConcurrentContextJvmThread task = new ConcurrentContextJvmThread(j, configrationProvider);
tasks.add(task);
executorService.execute(task);
}
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvm.java
index 0f6900dbb..7d7548569 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVM.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvm.java
@@ -54,9 +54,9 @@ import org.slf4j.ext.XLoggerFactory;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public final class ConcurrentContextJVM {
+public final class ConcurrentContextJvm {
// Logger for this class
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(ConcurrentContextJVM.class);
+ private static final XLogger LOGGER = XLoggerFactory.getXLogger(ConcurrentContextJvm.class);
private static final int IPV4_ADDRESS_LENGTH = 4;
@@ -66,7 +66,7 @@ public final class ConcurrentContextJVM {
private final ConfigrationProvider configrationProvider;
- private ConcurrentContextJVM(final int jvmNo, final ConfigrationProvider configrationProvider) {
+ private ConcurrentContextJvm(final int jvmNo, final ConfigrationProvider configrationProvider) {
this.jvmNo = jvmNo;
this.configrationProvider = configrationProvider;
final String name = configrationProvider.getTestName() + ":ConcurrentContextThread_" + jvmNo;
@@ -157,8 +157,8 @@ public final class ConcurrentContextJVM {
try {
final ConfigrationProvider configrationProvider =
new ConfigrationProviderImpl(testName, 1, threadCount, threadLoops, albumSize, lockType);
- final ConcurrentContextJVM concurrentContextJVM = new ConcurrentContextJVM(jvmNo, configrationProvider);
- concurrentContextJVM.execute();
+ final ConcurrentContextJvm concurrentContextJvm = new ConcurrentContextJvm(jvmNo, configrationProvider);
+ concurrentContextJvm.execute();
} catch (final Exception e) {
LOGGER.error("error running test in JVM", e);
diff --git a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvmThread.java
index 0c2aa7a90..339c95d26 100644
--- a/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJVMThread.java
+++ b/context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/locking/ConcurrentContextJvmThread.java
@@ -43,15 +43,15 @@ import org.slf4j.ext.XLoggerFactory;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class ConcurrentContextJVMThread implements Runnable, Closeable {
+public class ConcurrentContextJvmThread implements Runnable, Closeable {
// Logger for this class
- private static final XLogger LOGGER = XLoggerFactory.getXLogger(ConcurrentContextJVMThread.class);
+ private static final XLogger LOGGER = XLoggerFactory.getXLogger(ConcurrentContextJvmThread.class);
private final int jvm;
private final ConfigrationProvider configrationProvider;
private Process process = null;
- public ConcurrentContextJVMThread(final int jvm, final ConfigrationProvider configrationProvider) {
+ public ConcurrentContextJvmThread(final int jvm, final ConfigrationProvider configrationProvider) {
this.jvm = jvm;
this.configrationProvider = configrationProvider;
}
@@ -70,7 +70,7 @@ public class ConcurrentContextJVMThread implements Runnable, Closeable {
commandList.add("-Xmx512m");
commandList.add("-cp");
commandList.add(System.getProperty("java.class.path"));
- commandList.add(ConcurrentContextJVM.class.getCanonicalName());
+ commandList.add(ConcurrentContextJvm.class.getCanonicalName());
commandList.add(configrationProvider.getTestName());
commandList.add(new Integer(jvm).toString());
commandList.add(new Integer(configrationProvider.getThreadCount()).toString());
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java
index 6b9ba15ad..54440370c 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextAlbumUpdate.java
@@ -24,7 +24,7 @@ import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -42,6 +42,9 @@ public class TestContextAlbumUpdate {
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
+ /**
+ * Set up context data.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -55,7 +58,7 @@ public class TestContextAlbumUpdate {
ParameterService.register(contextParameters.getDistributorParameters());
ParameterService.register(contextParameters.getLockManagerParameters());
ParameterService.register(contextParameters.getPersistorParameters());
-
+
schemaParameters = new SchemaParameters();
schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters());
@@ -63,6 +66,9 @@ public class TestContextAlbumUpdate {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context data.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -74,17 +80,17 @@ public class TestContextAlbumUpdate {
}
@Test
- public void testContextAlbumUpdateJVMLocalVarSet() throws ApexModelException, IOException, ApexException {
+ public void testContextAlbumUpdateJvmLocalVarSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextAlbumUpdateJVMLocalVarSet test . . .");
- contextParameters.getDistributorParameters().setPluginClass(JVMLocalDistributor.class.getCanonicalName());
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
new ContextAlbumUpdate().testContextAlbumUpdate();
logger.debug("Ran testContextAlbumUpdateJVMLocalVarSet test");
}
@Test
- public void testContextAlbumUpdateJVMLocalVarNotSet() throws ApexModelException, IOException, ApexException {
+ public void testContextAlbumUpdateJvmLocalVarNotSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextAlbumUpdateJVMLocalVarNotSet test . . .");
new ContextAlbumUpdate().testContextAlbumUpdate();
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java
index b10bc685c..ba402da24 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextInstantiation.java
@@ -24,7 +24,7 @@ import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -47,6 +47,9 @@ public class TestContextInstantiation {
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
+ /**
+ * Set up context for tests.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -68,6 +71,9 @@ public class TestContextInstantiation {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context for tests.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -79,17 +85,17 @@ public class TestContextInstantiation {
}
@Test
- public void testContextInstantiationJVMLocalVarSet() throws ApexModelException, IOException, ApexException {
+ public void testContextInstantiationJvmLocalVarSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextInstantiationJVMLocalVarSet test . . .");
- contextParameters.getDistributorParameters().setPluginClass(JVMLocalDistributor.class.getCanonicalName());
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
new ContextInstantiation().testContextInstantiation();
logger.debug("Ran testContextInstantiationJVMLocalVarSet test");
}
@Test
- public void testContextInstantiationJVMLocalVarNotSet() throws ApexModelException, IOException, ApexException {
+ public void testContextInstantiationJvmLocalVarNotSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextInstantiationJVMLocalVarNotSet test . . .");
new ContextInstantiation().testContextInstantiation();
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextUpdate.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextUpdate.java
index 07a0cbe47..8ef8bf005 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextUpdate.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestContextUpdate.java
@@ -25,7 +25,7 @@ import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -48,6 +48,9 @@ public class TestContextUpdate {
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
+ /**
+ * Set up context for tests.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -69,6 +72,9 @@ public class TestContextUpdate {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context for tests.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -80,17 +86,17 @@ public class TestContextUpdate {
}
@Test
- public void testContextUpdateJVMLocalVarSet() throws ApexModelException, IOException, ApexException {
+ public void testContextUpdateJvmLocalVarSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextUpdateJVMLocalVarSet test . . .");
- contextParameters.getDistributorParameters().setPluginClass(JVMLocalDistributor.class.getCanonicalName());
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
new ContextUpdate().testContextUpdate();
logger.debug("Ran testContextUpdateJVMLocalVarSet test");
}
@Test
- public void testContextUpdateJVMLocalVarNotSet() throws ApexModelException, IOException, ApexException {
+ public void testContextUpdateJvmLocalVarNotSet() throws ApexModelException, IOException, ApexException {
logger.debug("Running testContextUpdateJVMLocalVarNotSet test . . .");
new ContextUpdate().testContextUpdate();
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java
index b37c8eafa..d1cdc6d97 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/distribution/TestSequentialContextInstantiation.java
@@ -24,7 +24,7 @@ import java.io.IOException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -43,10 +43,13 @@ import org.slf4j.ext.XLoggerFactory;
public class TestSequentialContextInstantiation {
// Logger for this class
private static final XLogger logger = XLoggerFactory.getXLogger(TestSequentialContextInstantiation.class);
-
+
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
+ /**
+ * Set up context for tests.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -60,7 +63,7 @@ public class TestSequentialContextInstantiation {
ParameterService.register(contextParameters.getDistributorParameters());
ParameterService.register(contextParameters.getLockManagerParameters());
ParameterService.register(contextParameters.getPersistorParameters());
-
+
schemaParameters = new SchemaParameters();
schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters());
@@ -68,6 +71,9 @@ public class TestSequentialContextInstantiation {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context for tests.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -79,20 +85,20 @@ public class TestSequentialContextInstantiation {
}
@Test
- public void testSequentialContextInstantiationJVMLocalVarSet()
- throws ApexModelException, IOException, ApexException {
+ public void testSequentialContextInstantiationJvmLocalVarSet()
+ throws ApexModelException, IOException, ApexException {
logger.debug("Running testSequentialContextInstantiationJVMLocalVarSet test . . .");
- contextParameters.getDistributorParameters().setPluginClass(JVMLocalDistributor.class.getCanonicalName());
-
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
+
new SequentialContextInstantiation().testSequentialContextInstantiation();
logger.debug("Ran testSequentialContextInstantiationJVMLocalVarSet test");
}
@Test
- public void testSequentialContextInstantiationJVMLocalVarNotSet()
- throws ApexModelException, IOException, ApexException {
+ public void testSequentialContextInstantiationJvmLocalVarNotSet()
+ throws ApexModelException, IOException, ApexException {
logger.debug("Running testSequentialContextInstantiationJVMLocalVarNotSet test . . .");
new ContextParameters();
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java
index 8fca90b07..ed9aff0c1 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/locking/TestConcurrentContext.java
@@ -31,8 +31,8 @@ import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.apex.context.impl.distribution.jvmlocal.JVMLocalDistributor;
-import org.onap.policy.apex.context.impl.locking.jvmlocal.JVMLocalLockManager;
+import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor;
+import org.onap.policy.apex.context.impl.locking.jvmlocal.JvmLocalLockManager;
import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters;
import org.onap.policy.apex.context.parameters.ContextParameterConstants;
import org.onap.policy.apex.context.parameters.ContextParameters;
@@ -66,6 +66,9 @@ public class TestConcurrentContext {
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
+ /**
+ * Set up context for tests.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -87,6 +90,9 @@ public class TestConcurrentContext {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context for tests.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -98,10 +104,10 @@ public class TestConcurrentContext {
}
@Test
- public void testConcurrentContextJVMLocalVarSet() throws Exception {
+ public void testConcurrentContextJvmLocalVarSet() throws Exception {
logger.debug("Running testConcurrentContextJVMLocalVarSet test . . .");
- contextParameters.getLockManagerParameters().setPluginClass(JVMLocalLockManager.class.getCanonicalName());
+ contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getCanonicalName());
final ConfigrationProvider configrationProvider = getConfigrationProvider("JVMLocalVarSet",
TEST_JVM_COUNT_SINGLE_JVM, TEST_THREAD_COUNT_SINGLE_JVM, TEST_THREAD_LOOPS);
@@ -120,7 +126,7 @@ public class TestConcurrentContext {
}
@Test
- public void testConcurrentContextJVMLocalNoVarSet() throws Exception {
+ public void testConcurrentContextJvmLocalNoVarSet() throws Exception {
logger.debug("Running testConcurrentContextJVMLocalNoVarSet test . . .");
final ConfigrationProvider configrationProvider = getConfigrationProvider("JVMLocalNoVarSet",
@@ -139,11 +145,11 @@ public class TestConcurrentContext {
}
@Test
- public void testConcurrentContextMultiJVMNoLock() throws Exception {
+ public void testConcurrentContextMultiJvmNoLock() throws Exception {
logger.debug("Running testConcurrentContextMultiJVMNoLock test . . .");
- contextParameters.getDistributorParameters().setPluginClass(JVMLocalDistributor.class.getCanonicalName());
- contextParameters.getLockManagerParameters().setPluginClass(JVMLocalLockManager.class.getCanonicalName());
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
+ contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getCanonicalName());
final ConfigrationProvider configrationProvider = getConfigrationProvider("testConcurrentContextMultiJVMNoLock",
TEST_JVM_COUNT_MULTI_JVM, TEST_THREAD_COUNT_MULTI_JVM, TEST_THREAD_LOOPS);
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
index c8628935c..9aad0ad78 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
@@ -83,6 +83,9 @@ public class TestPersistentContextInstantiation {
new File("derby.log").delete();
}
+ /**
+ * Set up context for tests.
+ */
@Before
public void beforeTest() {
contextParameters = new ContextParameters();
@@ -104,6 +107,9 @@ public class TestPersistentContextInstantiation {
ParameterService.register(schemaParameters);
}
+ /**
+ * Clear down context for tests.
+ */
@After
public void afterTest() {
ParameterService.deregister(schemaParameters);
@@ -166,8 +172,8 @@ public class TestPersistentContextInstantiation {
final TestContextDateItem testDate = new TestContextDateItem(new Date());
final TestContextDateLocaleItem tci00A = new TestContextDateLocaleItem();
tci00A.setDateValue(testDate);
- tci00A.setTZValue(TimeZone.getTimeZone("Europe/Dublin").toString());
- tci00A.setDST(true);
+ tci00A.setTzValue(TimeZone.getTimeZone("Europe/Dublin").toString());
+ tci00A.setDst(true);
final Map<String, Object> valueMap1 = new HashMap<String, Object>();
valueMap1.put("TestPolicyContextItem00A", tci00A);
@@ -176,7 +182,7 @@ public class TestPersistentContextInstantiation {
assertEquals(((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDateValue(),
testDate);
- assertEquals(((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDST(), true);
+ assertEquals(((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDst(), true);
contextAlbumForDate.flush();