diff options
author | 2018-09-13 23:48:50 +0100 | |
---|---|---|
committer | 2018-09-13 23:49:32 +0100 | |
commit | cd68fc9bae7d6258f77ff59c1431e4f925f61a4c (patch) | |
tree | 53054a7c8e8738644785039c3a200c6b23d4b3ed /testsuites/integration/integration-executor-test/src/test/java/org/onap | |
parent | 4cfa2e2d98f6877d54da304ef17f096284430908 (diff) |
Address sonar/Checkstyle Issues
Sweep through Apex codebase to fix most ceheckstyle and
straightforward sonar issues.
Issue-ID: POLICY-1034
Change-Id: I149d9a94ad893affc93573e8de5e3304b6bdde2d
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'testsuites/integration/integration-executor-test/src/test/java/org/onap')
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexActionListener.java) | 2 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngine.java) | 4 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJRuby.java) | 11 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJava.java) | 8 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJavascript.java) | 11 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJython.java) | 11 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineMvel.java) | 13 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/event/TestEventInstantiation.java) | 28 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexModelExport.java) | 2 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexPolicyModelAnalysis.java) | 2 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java) | 2 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java) | 24 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java) | 41 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModelCreator.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModelCreator.java) | 26 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateDifferentModels.java) | 19 | ||||
-rw-r--r-- | testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java (renamed from testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateModel.java) | 37 |
16 files changed, 202 insertions, 39 deletions
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexActionListener.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java index fa79843e9..2860f1736 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexActionListener.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexActionListener.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.util.ArrayList; import java.util.List; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngine.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java index b087552eb..cb51a8e9e 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngine.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngine.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -37,7 +37,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.eventmodel.concepts.AxEvent; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; -import org.onap.policy.apex.test.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJRuby.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java index 916795deb..108e73ac1 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJRuby.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.io.IOException; @@ -35,11 +35,17 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.plugins.executor.jruby.JrubyExecutorParameters; import org.onap.policy.common.parameters.ParameterService; +/** + * The Class TestApexEngineJRuby. + */ public class TestApexEngineJRuby { private SchemaParameters schemaParameters; private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -66,6 +72,9 @@ public class TestApexEngineJRuby { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJava.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java index c1d68760d..b551a061e 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJava.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJava.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.io.IOException; @@ -44,6 +44,9 @@ public class TestApexEngineJava { private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -70,6 +73,9 @@ public class TestApexEngineJava { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJavascript.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java index 1f5c1d4b8..51e39cfe1 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJavascript.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJavascript.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.io.IOException; @@ -34,11 +34,17 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters; import org.onap.policy.common.parameters.ParameterService; +/** + * The Class TestApexEngineJavascript. + */ public class TestApexEngineJavascript { private SchemaParameters schemaParameters; private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -65,6 +71,9 @@ public class TestApexEngineJavascript { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJython.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java index b5b0f9a78..163a60d20 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineJython.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.io.IOException; @@ -34,11 +34,17 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters; import org.onap.policy.common.parameters.ParameterService; +/** + * The Class TestApexEngineJython. + */ public class TestApexEngineJython { private SchemaParameters schemaParameters; private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -65,6 +71,9 @@ public class TestApexEngineJython { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineMvel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java index 4aab859ca..604105a03 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/engine/TestApexEngineMvel.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineMvel.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.engine; +package org.onap.policy.apex.testsuites.integration.executor.engine; import java.io.IOException; @@ -34,11 +34,17 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters; import org.onap.policy.common.parameters.ParameterService; +/** + * The Class TestApexEngineMvel. + */ public class TestApexEngineMvel { private SchemaParameters schemaParameters; private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -65,6 +71,9 @@ public class TestApexEngineMvel { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); @@ -85,7 +94,7 @@ public class TestApexEngineMvel { * @throws IOException Signals that an I/O exception has occurred. */ @Test - public void testApexEngineMVEL() throws ApexException, InterruptedException, IOException { + public void testApexEngineMvel() throws ApexException, InterruptedException, IOException { new TestApexEngine("MVEL", engineParameters); new TestApexEngine("MVEL", engineParameters); } diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/event/TestEventInstantiation.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java index b1542def0..1ae258b01 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/event/TestEventInstantiation.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.event; +package org.onap.policy.apex.testsuites.integration.executor.event; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -46,7 +46,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters; -import org.onap.policy.apex.test.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory; import org.onap.policy.common.parameters.ParameterService; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -64,15 +64,18 @@ public class TestEventInstantiation { private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); - + schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME); schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters()); ParameterService.register(schemaParameters); - + contextParameters = new ContextParameters(); contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME); @@ -84,16 +87,19 @@ public class TestEventInstantiation { ParameterService.register(contextParameters.getDistributorParameters()); ParameterService.register(contextParameters.getLockManagerParameters()); ParameterService.register(contextParameters.getPersistorParameters()); - + engineParameters = new EngineParameters(); engineParameters.getExecutorParameterMap().put("MVEL", new MvelExecutorParameters()); ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); - + ParameterService.deregister(contextParameters.getDistributorParameters()); ParameterService.deregister(contextParameters.getLockManagerParameters()); ParameterService.deregister(contextParameters.getPersistorParameters()); @@ -165,17 +171,15 @@ public class TestEventInstantiation { try { event.put("TestMatchCase", "Hello"); } catch (final Exception e) { - assertEquals( - "Event0000:0.0.1:NULL:TestMatchCase: object \"Hello\" of class \"java.lang.String\" not compatible with class \"java.lang.Byte\"", - e.getMessage()); + assertEquals("Event0000:0.0.1:NULL:TestMatchCase: object \"Hello\" of class \"java.lang.String\" " + + "not compatible with class \"java.lang.Byte\"", e.getMessage()); } try { event.put("TestMatchCase", 123.45); } catch (final Exception e) { - assertEquals( - "Event0000:0.0.1:NULL:TestMatchCase: object \"123.45\" of class \"java.lang.Double\" not compatible with class \"java.lang.Byte\"", - e.getMessage()); + assertEquals("Event0000:0.0.1:NULL:TestMatchCase: object \"123.45\" of class \"java.lang.Double\" " + + "not compatible with class \"java.lang.Byte\"", e.getMessage()); } event.put("TestMatchCase", new Byte("16")); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexModelExport.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java index 6b72faa8f..1e419521f 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexModelExport.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexPolicyModelAnalysis.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java index 91153d698..abcd22a47 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexPolicyModelAnalysis.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexPolicyModelAnalysis.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertNotNull; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java index 384ad5114..a00729268 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyCreateModelFiles.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.test.TestApexModel; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java index 45314672e..e863a990a 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import java.sql.Connection; import java.sql.DriverManager; @@ -31,10 +31,18 @@ import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao; import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; -public class TestApexSamplePolicyDBWrite { +/** + * The Class TestApexSamplePolicyDbWrite. + */ +public class TestApexSamplePolicyDbWrite { private Connection connection; TestApexModel<AxPolicyModel> testApexModel; + /** + * Setup. + * + * @throws Exception the exception + */ @Before public void setup() throws Exception { connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); @@ -43,13 +51,23 @@ public class TestApexSamplePolicyDBWrite { testApexModel = new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator); } + /** + * Teardown. + * + * @throws Exception the exception + */ @After public void teardown() throws Exception { connection.close(); } + /** + * Test model write read jpa. + * + * @throws Exception the exception + */ @Test - public void testModelWriteReadJPA() throws Exception { + public void testModelWriteReadJpa() throws Exception { final DaoParameters DaoParameters = new DaoParameters(); DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName()); DaoParameters.setPersistenceUnit("SampleModelTest"); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java index 36810b44b..1e7daad03 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertTrue; @@ -34,11 +34,19 @@ import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao; import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; +/** + * The Class TestApexSamplePolicyModel. + */ public class TestApexSamplePolicyModel { private static final String VALID_MODEL_STRING = "***validation of model successful***"; private Connection connection; private TestApexModel<AxPolicyModel> testApexModel; + /** + * Setup. + * + * @throws Exception the exception + */ @Before public void setup() throws Exception { connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); @@ -47,29 +55,54 @@ public class TestApexSamplePolicyModel { new TestApexModel<AxPolicyModel>(AxPolicyModel.class, new TestApexSamplePolicyModelCreator("MVEL")); } + /** + * Teardown. + * + * @throws Exception the exception + */ @After public void teardown() throws Exception { connection.close(); } + /** + * Test model valid. + * + * @throws Exception the exception + */ @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); assertTrue(result.toString().equals(VALID_MODEL_STRING)); } + /** + * Test model write read xml. + * + * @throws Exception the exception + */ @Test - public void testModelWriteReadXML() throws Exception { + public void testModelWriteReadXml() throws Exception { testApexModel.testApexModelWriteReadXml(); } + /** + * Test model write read json. + * + * @throws Exception the exception + */ @Test - public void testModelWriteReadJSON() throws Exception { + public void testModelWriteReadJson() throws Exception { testApexModel.testApexModelWriteReadJson(); } + /** + * Test model write read jpa. + * + * @throws Exception the exception + */ @Test - public void testModelWriteReadJPA() throws Exception { + public void testModelWriteReadJpa() throws Exception { final DaoParameters DaoParameters = new DaoParameters(); DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName()); DaoParameters.setPersistenceUnit("SampleModelTest"); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModelCreator.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModelCreator.java index d5ba53699..7e44dd32e 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModelCreator.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModelCreator.java @@ -18,42 +18,64 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; -import org.onap.policy.apex.test.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory; /** + * The Class TestApexSamplePolicyModelCreator. + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TestApexSamplePolicyModelCreator implements TestApexModelCreator<AxPolicyModel> { private String logicExecutorType; + /** + * Instantiates a new test apex sample policy model creator. + * + * @param logicExecutorType the logic executor type + */ public TestApexSamplePolicyModelCreator(final String logicExecutorType) { this.logicExecutorType = logicExecutorType; } + /* (non-Javadoc) + * @see org.onap.policy.apex.model.basicmodel.handling.ApexModelCreator#getModel() + */ @Override public AxPolicyModel getModel() { return new SampleDomainModelFactory().getSamplePolicyModel(logicExecutorType); } + /* (non-Javadoc) + * @see org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator#getMalstructuredModel() + */ @Override public AxPolicyModel getMalstructuredModel() { return null; } + /* (non-Javadoc) + * @see org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator#getObservationModel() + */ @Override public AxPolicyModel getObservationModel() { return null; } + /* (non-Javadoc) + * @see org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator#getWarningModel() + */ @Override public AxPolicyModel getWarningModel() { return getModel(); } + /* (non-Javadoc) + * @see org.onap.policy.apex.model.basicmodel.test.TestApexModelCreator#getInvalidModel() + */ @Override public AxPolicyModel getInvalidModel() { return null; diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateDifferentModels.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java index 20159a3bf..e8c45b201 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateDifferentModels.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateDifferentModels.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -42,8 +42,8 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters; -import org.onap.policy.apex.plugins.executor.test.script.engine.TestApexActionListener; -import org.onap.policy.apex.test.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.executor.engine.TestApexActionListener; import org.onap.policy.common.parameters.ParameterService; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -61,6 +61,9 @@ public class TestContextUpdateDifferentModels { private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -87,6 +90,9 @@ public class TestContextUpdateDifferentModels { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); @@ -99,6 +105,13 @@ public class TestContextUpdateDifferentModels { ParameterService.deregister(schemaParameters); } + /** + * Test context update different models. + * + * @throws ApexException the apex exception + * @throws InterruptedException the interrupted exception + * @throws IOException Signals that an I/O exception has occurred. + */ @Test public void testContextUpdateDifferentModels() throws ApexException, InterruptedException, IOException { logger.debug("Running test testContextUpdateDifferentModels . . ."); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java index d5605ea4c..615781ab3 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestContextUpdateModel.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestContextUpdateModel.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.apex.plugins.executor.test.script.handling; +package org.onap.policy.apex.testsuites.integration.executor.handling; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -45,8 +45,8 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters; -import org.onap.policy.apex.plugins.executor.test.script.engine.TestApexActionListener; -import org.onap.policy.apex.test.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.common.model.SampleDomainModelFactory; +import org.onap.policy.apex.testsuites.integration.executor.engine.TestApexActionListener; import org.onap.policy.common.parameters.ParameterService; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; @@ -64,6 +64,9 @@ public class TestContextUpdateModel { private ContextParameters contextParameters; private EngineParameters engineParameters; + /** + * Before test. + */ @Before public void beforeTest() { schemaParameters = new SchemaParameters(); @@ -90,6 +93,9 @@ public class TestContextUpdateModel { ParameterService.register(engineParameters); } + /** + * After test. + */ @After public void afterTest() { ParameterService.deregister(engineParameters); @@ -102,6 +108,13 @@ public class TestContextUpdateModel { ParameterService.deregister(schemaParameters); } + /** + * Test context update model. + * + * @throws ApexException the apex exception + * @throws InterruptedException the interrupted exception + * @throws IOException Signals that an I/O exception has occurred. + */ @Test public void testContextUpdateModel() throws ApexException, InterruptedException, IOException { final AxArtifactKey key = new AxArtifactKey("TestApexEngine", "0.0.1"); @@ -152,9 +165,21 @@ public class TestContextUpdateModel { apexEngine.clear(); } + /** + * Test context update model after. + */ @After public void testContextUpdateModelAfter() {} + /** + * Send event. + * + * @param apexEngine the apex engine + * @param listener the listener + * @param eventName the event name + * @param shouldWork the should work + * @throws ContextException the context exception + */ private void sendEvent(final ApexEngine apexEngine, final TestApexActionListener listener, final String eventName, final boolean shouldWork) throws ContextException { final Date aDate = new Date(1433453067123L); @@ -173,6 +198,12 @@ public class TestContextUpdateModel { checkResult(result, shouldWork); } + /** + * Check result. + * + * @param result the result + * @param shouldWork the should work + */ private void checkResult(final EnEvent result, final boolean shouldWork) { if (!shouldWork) { assertNotNull(result.getExceptionMessage()); |