summaryrefslogtreecommitdiffstats
path: root/context/context-test-utils/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-12 23:29:25 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-12 23:54:51 +0100
commit0e23f7634e1e1fb31454c516974613335fcea1a4 (patch)
treebedf0e52104e62599dd091eb6292de5dc7d57f49 /context/context-test-utils/src
parent3ccc3d9ecd4bcd8960a2da6ecbdc7f3ac806fc67 (diff)
Sonar/Checkstyle in model/context/core
Checkstyle and sonar changes in the model, contexot and core modules. Issue-ID: POLICY-1034 Change-Id: I2d40bc877f3a548844470fc290fc89d63fa465ae Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'context/context-test-utils/src')
-rw-r--r--context/context-test-utils/src/main/java/org/onap/policy/apex/context/test/distribution/ContextInstantiation.java2
-rw-r--r--context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java51
2 files changed, 27 insertions, 26 deletions
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 084220c2f..75c615898 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
@@ -150,7 +150,7 @@ public class ContextInstantiation {
assertDouble(contextItem.getTestPolicyContextItem002().getDoubleValue(), PI_VAL);
assertTrue(contextItem.getTestPolicyContextItem003().getFlag());
assertEquals(contextItem.getTestPolicyContextItem004().getLongValue(), testDate.getTime());
- assertEquals(contextItem.getTestPolicyContextItem005().getMapValue(), TEST_HASH_MAP);
+ assertEquals(TEST_HASH_MAP, contextItem.getTestPolicyContextItem005().getMapValue());
final TestGlobalContextItem globalContext =
getTestGlobalContextItem(contextDistributor, testDate, tci9, tciA);
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 9aad0ad78..290f22794 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
@@ -99,7 +99,7 @@ public class TestPersistentContextInstantiation {
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());
@@ -126,8 +126,9 @@ public class TestPersistentContextInstantiation {
final AxArtifactKey distributorKey = new AxArtifactKey("AbstractDistributor", "0.0.1");
final Distributor contextDistributor = new DistributorFactory().getDistributor(distributorKey);
- final AxArtifactKey[] usedArtifactStackArray = {new AxArtifactKey("testC-top", "0.0.1"),
- new AxArtifactKey("testC-next", "0.0.1"), new AxArtifactKey("testC-bot", "0.0.1")};
+ final AxArtifactKey[] usedArtifactStackArray =
+ { new AxArtifactKey("testC-top", "0.0.1"), new AxArtifactKey("testC-next", "0.0.1"),
+ new AxArtifactKey("testC-bot", "0.0.1") };
final DaoParameters DaoParameters = new DaoParameters();
DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
@@ -138,8 +139,8 @@ public class TestPersistentContextInstantiation {
final AxContextModel someContextModel = TestContextAlbumFactory.createMultiAlbumsContextModel();
// Context for Storing Map values
- final AxContextAlbum axContextAlbumForMap =
- someContextModel.getAlbums().getAlbumsMap().get(new AxArtifactKey("MapContextAlbum", "0.0.1"));
+ final AxContextAlbum axContextAlbumForMap = someContextModel.getAlbums().getAlbumsMap()
+ .get(new AxArtifactKey("MapContextAlbum", "0.0.1"));
apexDao.create(axContextAlbumForMap);
contextDistributor.registerModel(someContextModel);
final ContextAlbum contextAlbumForMap = contextDistributor.createContextAlbum(axContextAlbumForMap.getKey());
@@ -154,15 +155,15 @@ public class TestPersistentContextInstantiation {
contextAlbumForMap.putAll(valueMap0);
- assertEquals(
- ((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue().get("key"),
- "This is a policy context string");
+ assertEquals("This is a policy context string",
+ ((TestContextTreeMapItem) contextAlbumForMap.get("TestPolicyContextItem000")).getMapValue()
+ .get("key"));
contextAlbumForMap.flush();
// Context for Storing Date values
- final AxContextAlbum axContextAlbumForDate =
- someContextModel.getAlbums().getAlbumsMap().get(new AxArtifactKey("DateContextAlbum", "0.0.1"));
+ final AxContextAlbum axContextAlbumForDate = someContextModel.getAlbums().getAlbumsMap()
+ .get(new AxArtifactKey("DateContextAlbum", "0.0.1"));
apexDao.create(axContextAlbumForDate);
contextDistributor.registerModel(someContextModel);
final ContextAlbum contextAlbumForDate = contextDistributor.createContextAlbum(axContextAlbumForDate.getKey());
@@ -180,15 +181,15 @@ public class TestPersistentContextInstantiation {
contextAlbumForDate.putAll(valueMap1);
- assertEquals(((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDateValue(),
- testDate);
- assertEquals(((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDst(), true);
+ assertEquals(testDate, ((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A"))
+ .getDateValue());
+ assertEquals(true, ((TestContextDateLocaleItem) contextAlbumForDate.get("TestPolicyContextItem00A")).getDst());
contextAlbumForDate.flush();
// Context for Storing Long values
- final AxContextAlbum axContextAlbumForLong =
- someContextModel.getAlbums().getAlbumsMap().get(new AxArtifactKey("LTypeContextAlbum", "0.0.1"));
+ final AxContextAlbum axContextAlbumForLong = someContextModel.getAlbums().getAlbumsMap()
+ .get(new AxArtifactKey("LTypeContextAlbum", "0.0.1"));
apexDao.create(axContextAlbumForLong);
contextDistributor.registerModel(someContextModel);
final ContextAlbum contextAlbumForLong = contextDistributor.createContextAlbum(axContextAlbumForLong.getKey());
@@ -204,16 +205,16 @@ public class TestPersistentContextInstantiation {
contextAlbumForLong.putAll(valueMap2);
- assertEquals(((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0031")).getLongValue(),
- 0xFFFFFFFFFFFFFFFFL);
- assertEquals(((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0032")).getLongValue(),
- 0xFFFFFFFFFFFFFFFEL);
- assertEquals(((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0033")).getLongValue(),
- 0xFFFFFFFFFFFFFFFDL);
- assertEquals(((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0034")).getLongValue(),
- 0xFFFFFFFFFFFFFFFCL);
- assertEquals(((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0035")).getLongValue(),
- 0xFFFFFFFFFFFFFFFBL);
+ assertEquals(0xFFFFFFFFFFFFFFFFL,
+ ((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0031")).getLongValue());
+ assertEquals(0xFFFFFFFFFFFFFFFEL,
+ ((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0032")).getLongValue());
+ assertEquals(0xFFFFFFFFFFFFFFFDL,
+ ((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0033")).getLongValue());
+ assertEquals(0xFFFFFFFFFFFFFFFCL,
+ ((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0034")).getLongValue());
+ assertEquals(0xFFFFFFFFFFFFFFFBL,
+ ((TestContextLongItem) contextAlbumForLong.get("TestPolicyContextItem0035")).getLongValue());
contextAlbumForLong.flush();
contextDistributor.clear();