summaryrefslogtreecommitdiffstats
path: root/testsuites/performance/performance-benchmark-test/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-13 23:48:50 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-13 23:49:32 +0100
commitcd68fc9bae7d6258f77ff59c1431e4f925f61a4c (patch)
tree53054a7c8e8738644785039c3a200c6b23d4b3ed /testsuites/performance/performance-benchmark-test/src
parent4cfa2e2d98f6877d54da304ef17f096284430908 (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/performance/performance-benchmark-test/src')
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexBaseBenchMarkTest.java)40
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmark.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexEngineBenchmark.java)82
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/TestApexEventListener.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/TestApexEventListener.java)36
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/BaseTest.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/BaseTest.java)6
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMimo.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMIMO.java)19
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMiso.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMISO.java)6
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSimo.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSIMO.java)19
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSiso.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSISO.java)6
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventMimo.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventMIMO.java)19
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventSiso.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventSISO.java)6
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceModelUpdateTest.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceModelUpdateTest.java)57
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceTest.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceTest.java)9
-rw-r--r--testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/utils/Utils.java (renamed from testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/utils/Utils.java)17
13 files changed, 239 insertions, 83 deletions
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexBaseBenchMarkTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java
index 43211bc73..fdefd5583 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexBaseBenchMarkTest.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexBaseBenchMarkTest.java
@@ -17,7 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.benchmark;
+
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark;
import java.util.List;
import java.util.Map;
@@ -39,14 +40,17 @@ import org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters;
import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
import org.onap.policy.apex.service.engine.event.ApexEvent;
import org.onap.policy.apex.service.engine.runtime.ApexEventListener;
-import org.onap.policy.apex.service.engine.runtime.ApexServiceModelUpdateTest;
import org.onap.policy.apex.service.engine.runtime.EngineService;
import org.onap.policy.apex.service.engine.runtime.EngineServiceEventInterface;
import org.onap.policy.apex.service.engine.runtime.impl.EngineServiceImpl;
import org.onap.policy.apex.service.parameters.engineservice.EngineServiceParameters;
+import org.onap.policy.apex.testsuites.performance.benchmark.engine.runtime.ApexServiceModelUpdateTest;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
+/**
+ * The Class ApexBaseBenchMarkTest.
+ */
public class ApexBaseBenchMarkTest {
private static final long STOP_TIME_OUT = TimeUnit.SECONDS.toMillis(30);
private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexServiceModelUpdateTest.class);
@@ -59,12 +63,24 @@ public class ApexBaseBenchMarkTest {
private EngineServiceEventInterface engineServiceEventInterface;
+ /**
+ * Instantiates a new apex base bench mark test.
+ *
+ * @param model the model
+ * @param threads the threads
+ * @param listener the listener
+ */
public ApexBaseBenchMarkTest(final String model, final int threads, final ApexEventListener listener) {
this.model = model;
this.threads = threads;
this.listener = listener;
}
+ /**
+ * Sets the up.
+ *
+ * @throws Exception the exception
+ */
public void setUp() throws Exception {
final EngineServiceParameters parameters = new EngineServiceParameters();
parameters.setInstanceCount(threads);
@@ -105,21 +121,41 @@ public class ApexBaseBenchMarkTest {
engineServiceEventInterface = service.getEngineServiceEventInterface();
}
+ /**
+ * Send events.
+ *
+ * @param events the events
+ */
public void sendEvents(final List<ApexEvent> events) {
for (final ApexEvent event : events) {
engineServiceEventInterface.sendEvent(event);
}
}
+ /**
+ * Send event.
+ *
+ * @param event the event
+ */
public void sendEvent(final ApexEvent event) {
engineServiceEventInterface.sendEvent(event);
}
+ /**
+ * Gets the service.
+ *
+ * @return the service
+ */
public EngineService getService() {
return service;
}
+ /**
+ * Destroy.
+ *
+ * @throws Exception the exception
+ */
public void destroy() throws Exception {
if (service != null) {
LOGGER.info("Stopping EngineService ... ");
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexEngineBenchmark.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmark.java
index d7a4ef800..fa2a9934c 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/ApexEngineBenchmark.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/ApexEngineBenchmark.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.benchmark;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark;
import static org.junit.Assert.assertEquals;
@@ -28,8 +28,8 @@ import org.junit.Before;
import org.junit.Test;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
import org.onap.policy.apex.service.engine.event.ApexEvent;
-import org.onap.policy.apex.service.engine.utils.Utils;
-import org.onap.policy.apex.test.common.model.EvalDomainModelFactory;
+import org.onap.policy.apex.testsuites.integration.common.model.EvalDomainModelFactory;
+import org.onap.policy.apex.testsuites.performance.benchmark.engine.utils.Utils;
import org.python.icu.impl.Assert;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -49,46 +49,85 @@ public class ApexEngineBenchmark {
private static final long TIME_OUT_IN_MILLISEC = TimeUnit.MINUTES.toMillis(1);
- private String apexECAModelString;
- private String apexOODAModelString;
+ private String apexEcaModelString;
+ private String apexOodaModelString;
+ /**
+ * Sets the up.
+ *
+ * @throws Exception the exception
+ */
@Before
public void setUp() throws Exception {
- apexECAModelString = Utils.getModelString(new EvalDomainModelFactory().getECAPolicyModel());
- apexOODAModelString = Utils.getModelString(new EvalDomainModelFactory().getOODAPolicyModel());
+ apexEcaModelString = Utils.getModelString(new EvalDomainModelFactory().getEcaPolicyModel());
+ apexOodaModelString = Utils.getModelString(new EvalDomainModelFactory().getOodaPolicyModel());
}
+ /**
+ * Test benchmark singleton worker.
+ *
+ * @throws Exception the exception
+ */
@Test
public void testBenchmark_SingletonWorker() throws Exception {
- executeTest(apexECAModelString, 100, 1, 20);
- executeTest(apexOODAModelString, 100, 1, 20);
+ executeTest(apexEcaModelString, 100, 1, 20);
+ executeTest(apexOodaModelString, 100, 1, 20);
}
+ /**
+ * Test benchmark 3 thread worker.
+ *
+ * @throws Exception the exception
+ */
@Test
public void testBenchmark_3ThreadWorker() throws Exception {
- executeTest(apexECAModelString, 1000, 3, 10);
- executeTest(apexOODAModelString, 100, 3, 10);
+ executeTest(apexEcaModelString, 1000, 3, 10);
+ executeTest(apexOodaModelString, 100, 3, 10);
}
+ /**
+ * Test benchmark 10 thread worker.
+ *
+ * @throws Exception the exception
+ */
@Test
public void testBenchmark_10ThreadWorker() throws Exception {
- executeTest(apexECAModelString, 2000, 10, 10);
- executeTest(apexOODAModelString, 2000, 10, 10);
+ executeTest(apexEcaModelString, 2000, 10, 10);
+ executeTest(apexOodaModelString, 2000, 10, 10);
}
+ /**
+ * Test benchmark 50 thread worker.
+ *
+ * @throws Exception the exception
+ */
@Test
public void testBenchmark_50ThreadWorker() throws Exception {
- executeTest(apexECAModelString, 3000, 50, 10);
- executeTest(apexOODAModelString, 3000, 50, 10);
+ executeTest(apexEcaModelString, 3000, 50, 10);
+ executeTest(apexOodaModelString, 3000, 50, 10);
}
+ /**
+ * Test available processors thread worker.
+ *
+ * @throws Exception the exception
+ */
@Test
- public void TestE_AvailableProcessorsThreadWorker() throws Exception {
+ public void testAvailableProcessorsThreadWorker() throws Exception {
final int cores = Runtime.getRuntime().availableProcessors();
- executeTest(apexECAModelString, 3000, cores, 10);
- executeTest(apexOODAModelString, 3000, cores, 10);
+ executeTest(apexEcaModelString, 3000, cores, 10);
+ executeTest(apexOodaModelString, 3000, cores, 10);
}
+ /**
+ * Execute test.
+ *
+ * @param policyModel the policy model
+ * @param eventsCount the events count
+ * @param threads the threads
+ * @param loop the loop
+ * @throws Exception the exception
+ */
private void executeTest(final String policyModel, final int eventsCount, final int threads, final int loop)
throws Exception {
@@ -123,6 +162,13 @@ public class ApexEngineBenchmark {
}
}
+ /**
+ * Send events.
+ *
+ * @param apexBaseBenchMarkTest the apex base bench mark test
+ * @param eventsCount the events count
+ * @throws Exception the exception
+ */
public void sendEvents(final ApexBaseBenchMarkTest apexBaseBenchMarkTest, final int eventsCount) throws Exception {
for (int eventNum = 0; eventNum < eventsCount; eventNum++) {
final long currentTimeMillis = System.currentTimeMillis();
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/TestApexEventListener.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/TestApexEventListener.java
index b2de8f072..2b6c89de7 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/benchmark/TestApexEventListener.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/benchmark/TestApexEventListener.java
@@ -17,7 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.benchmark;
+
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.benchmark;
import static org.junit.Assert.assertNull;
@@ -30,6 +31,17 @@ import org.onap.policy.apex.service.engine.runtime.ApexEventListener;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
+/**
+ * The listener interface for receiving testApexEvent events.
+ * The class that is interested in processing a testApexEvent
+ * event implements this interface, and the object created
+ * with that class is registered with a component using the
+ * component's <code>addTestApexEventListener</code> method. When
+ * the testApexEvent event occurs, that object's appropriate
+ * method is invoked.
+ *
+ * @see TestApexEventEvent
+ */
public class TestApexEventListener implements ApexEventListener {
private static final String SENT_TIMESTAMP = "SentTimestamp";
@@ -39,10 +51,16 @@ public class TestApexEventListener implements ApexEventListener {
private final AtomicLong eventReceived = new AtomicLong();
+ /**
+ * Instantiates a new test apex event listener.
+ */
public TestApexEventListener() {
this.queue = new ConcurrentLinkedQueue<ApexEvent>();
}
+ /* (non-Javadoc)
+ * @see org.onap.policy.apex.service.engine.runtime.ApexEventListener#onApexEventApexEvent)
+ */
@Override
public void onApexEvent(final ApexEvent apexEvent) {
apexEvent.put(RECVD_TIMESTAMP, System.currentTimeMillis());
@@ -50,6 +68,9 @@ public class TestApexEventListener implements ApexEventListener {
queue.add(apexEvent);
}
+ /**
+ * Prints the result.
+ */
public void printResult() {
if (!queue.isEmpty()) {
long maxTimeInMilliSeconds = 0;
@@ -76,15 +97,28 @@ public class TestApexEventListener implements ApexEventListener {
}
}
+ /**
+ * Reset.
+ */
public void reset() {
this.queue = new ConcurrentLinkedQueue<ApexEvent>();
eventReceived.set(0);;
}
+ /**
+ * Gets the queue.
+ *
+ * @return the queue
+ */
public Queue<ApexEvent> getQueue() {
return queue;
}
+ /**
+ * Gets the event received.
+ *
+ * @return the event received
+ */
public long getEventReceived() {
return eventReceived.get();
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/BaseTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/BaseTest.java
index d38107daf..52bdb056b 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/BaseTest.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/BaseTest.java
@@ -17,7 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -29,9 +30,10 @@ import java.util.concurrent.TimeUnit;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
import org.onap.policy.apex.model.utilities.TextFileUtils;
+import org.onap.policy.apex.service.engine.main.ApexMain;
public class BaseTest {
- protected final static long TIME_OUT_IN_MS = TimeUnit.SECONDS.toMillis(10);
+ protected static final long TIME_OUT_IN_MS = TimeUnit.SECONDS.toMillis(10);
protected long getFileLength(final String file, final long expectedFileSize) throws IOException {
return getFileLength(10, file, expectedFileSize);
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMIMO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMimo.java
index 714deba30..195840c6d 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMIMO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMimo.java
@@ -18,17 +18,24 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestAsyncEventMIMO extends BaseTest {
+public class TestAsyncEventMimo extends BaseTest {
@Test
- public void testJsonFileAsyncMIMO() throws Exception {
- final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventAsyncMIMO.json"};
- final String[] outFilePaths = {"src/test/resources/events/EventsOutMulti0.json",
- "src/test/resources/events/EventsOutMulti1.json", "src/test/resources/events/EventsOutMulti2.json"};
+ public void testJsonFileAsyncMimo() throws Exception {
+ final String[] args = {
+ "-c",
+ "src/test/resources/parameters/File2FileJsonEventAsyncMIMO.json"
+ };
+
+ final String[] outFilePaths = {
+ "src/test/resources/events/EventsOutMulti0.json",
+ "src/test/resources/events/EventsOutMulti1.json",
+ "src/test/resources/events/EventsOutMulti2.json"
+ };
testFileEvents(args, outFilePaths, 48956 * 3);
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMISO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMiso.java
index c5e7f4d9c..2e364647b 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventMISO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventMiso.java
@@ -18,14 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestAsyncEventMISO extends BaseTest {
+public class TestAsyncEventMiso extends BaseTest {
@Test
- public void testJsonFileAsyncMISO() throws Exception {
+ public void testJsonFileAsyncMiso() throws Exception {
final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventAsyncMISO.json"};
testFileEvents(args, new String[] {"src/test/resources/events/EventsOutSingle.json"}, 48956 * 3);
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSIMO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSimo.java
index 0f570679a..0fb191c49 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSIMO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSimo.java
@@ -18,17 +18,24 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestAsyncEventSIMO extends BaseTest {
+public class TestAsyncEventSimo extends BaseTest {
@Test
- public void testJsonFileAsyncSIMO() throws Exception {
- final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventAsyncSIMO.json"};
- final String[] outFilePaths = {"src/test/resources/events/EventsOutMulti0.json",
- "src/test/resources/events/EventsOutMulti1.json", "src/test/resources/events/EventsOutMulti2.json"};
+ public void testJsonFileAsyncSimo() throws Exception {
+ final String[] args = {
+ "-c",
+ "src/test/resources/parameters/File2FileJsonEventAsyncSIMO.json"
+ };
+
+ final String[] outFilePaths = {
+ "src/test/resources/events/EventsOutMulti0.json",
+ "src/test/resources/events/EventsOutMulti1.json",
+ "src/test/resources/events/EventsOutMulti2.json"
+ };
testFileEvents(args, outFilePaths, 48956);
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSISO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSiso.java
index 4152e20c9..a89e630bc 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestAsyncEventSISO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestAsyncEventSiso.java
@@ -18,14 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestAsyncEventSISO extends BaseTest {
+public class TestAsyncEventSiso extends BaseTest {
@Test
- public void testJsonFileAsyncSISO() throws Exception {
+ public void testJsonFileAsyncSiso() throws Exception {
final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventAsyncSISO.json"};
testFileEvents(args, new String[] {"src/test/resources/events/EventsOutSingle.json"}, 48956);
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventMIMO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventMimo.java
index ad1a9810a..8b35e5dd8 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventMIMO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventMimo.java
@@ -18,17 +18,24 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestSyncEventMIMO extends BaseTest {
+public class TestSyncEventMimo extends BaseTest {
@Test
- public void testJsonFileAsyncMIMO() throws Exception {
- final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventSyncMIMO.json"};
- final String[] outFilePaths = {"src/test/resources/events/EventsOutMulti0.json",
- "src/test/resources/events/EventsOutMulti1.json", "src/test/resources/events/EventsOutMulti2.json"};
+ public void testJsonFileAsyncMimo() throws Exception {
+ final String[] args = {
+ "-c",
+ "src/test/resources/parameters/File2FileJsonEventSyncMIMO.json"
+ };
+
+ final String[] outFilePaths = {
+ "src/test/resources/events/EventsOutMulti0.json",
+ "src/test/resources/events/EventsOutMulti1.json",
+ "src/test/resources/events/EventsOutMulti2.json"
+ };
testFileEvents(args, outFilePaths, 48956 * 3);
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventSISO.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventSiso.java
index 395c2fe0b..891ad7198 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/main/TestSyncEventSISO.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/main/TestSyncEventSiso.java
@@ -18,14 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.main;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.main;
import org.junit.Test;
-public class TestSyncEventSISO extends BaseTest {
+public class TestSyncEventSiso extends BaseTest {
@Test
- public void testJsonFileAsyncSISO() throws Exception {
+ public void testJsonFileAsyncSiso() throws Exception {
final String[] args = {"-c", "src/test/resources/parameters/File2FileJsonEventSyncSISO.json"};
testFileEvents(args, new String[] {"src/test/resources/events/EventsOutSingle.json"}, 48956);
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceModelUpdateTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceModelUpdateTest.java
index aa95e73b3..cf930150e 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceModelUpdateTest.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceModelUpdateTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.runtime;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.runtime;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -41,14 +41,16 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
import org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters;
import org.onap.policy.apex.service.engine.event.ApexEvent;
import org.onap.policy.apex.service.engine.event.ApexEventException;
+import org.onap.policy.apex.service.engine.runtime.ApexEventListener;
+import org.onap.policy.apex.service.engine.runtime.EngineService;
+import org.onap.policy.apex.service.engine.runtime.EngineServiceEventInterface;
import org.onap.policy.apex.service.engine.runtime.impl.EngineServiceImpl;
-import org.onap.policy.apex.service.engine.utils.Utils;
import org.onap.policy.apex.service.parameters.engineservice.EngineServiceParameters;
-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.performance.benchmark.engine.utils.Utils;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
-
/**
* The Class ApexServiceTest.
*
@@ -70,8 +72,8 @@ public class ApexServiceModelUpdateTest {
/**
* Sets up the test by creating an engine and reading in the test policy.
*
- * @throws ApexException if something goes wron
- * @throws IOException
+ * @throws ApexException if something goes wrong
+ * @throws IOException on IO exceptions
*/
@Before
public void setUp() throws ApexException, IOException {
@@ -119,7 +121,7 @@ public class ApexServiceModelUpdateTest {
} catch (final Exception e) {
e.printStackTrace();
assertEquals("start()<-Machine-1_process-1_engine-1-0:0.0.0,STOPPED, cannot start engine, "
- + "engine has not been initialized, its model is not loaded", e.getMessage());
+ + "engine has not been initialized, its model is not loaded", e.getMessage());
}
}
@@ -186,10 +188,9 @@ public class ApexServiceModelUpdateTest {
fail("model update should fail on incompatible model without force being true");
} catch (final Exception e) {
System.err.println(e.getMessage());
- assertEquals(
- "apex model update failed, supplied model with key \"INCOMPATIBLE:0.0.1\" is not a compatible "
+ assertEquals("apex model update failed, supplied model with key \"INCOMPATIBLE:0.0.1\" is not a compatible "
+ "model update from the existing engine model with key \"SamplePolicyModelMVEL:0.0.1\"",
- e.getMessage());
+ e.getMessage());
}
// Still on old model
@@ -205,10 +206,9 @@ public class ApexServiceModelUpdateTest {
} catch (final Exception e) {
System.err.println(e.getMessage());
e.printStackTrace();
- assertEquals(
- "apex model update failed, supplied model with key \"SamplePolicyModelMVEL:1.0.1\" is not a compatible "
- + "model update from the existing engine model with key \"SamplePolicyModelMVEL:0.0.1\"",
- e.getMessage());
+ assertEquals("apex model update failed, supplied model with key \"SamplePolicyModelMVEL:1.0.1\" is not "
+ + "a compatible model update from the existing engine model with key "
+ + "\"SamplePolicyModelMVEL:0.0.1\"", e.getMessage());
}
// Still on old model
@@ -293,13 +293,13 @@ public class ApexServiceModelUpdateTest {
eventDataMap.put("TestTimestamp", testStartTime.getTime());
eventDataMap.put("TestTemperature", 34.5445667);
- final ApexEvent event =
- new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex");
+ final ApexEvent event = new ApexEvent("Event0000", "0.0.1", "org.onap.policy.apex.domains.sample.events",
+ "test", "apex");
event.putAll(eventDataMap);
engineServiceEventInterface.sendEvent(event);
- final ApexEvent event2 =
- new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events", "test", "apex");
+ final ApexEvent event2 = new ApexEvent("Event0100", "0.0.1", "org.onap.policy.apex.domains.sample.events",
+ "test", "apex");
event2.putAll(eventDataMap);
engineServiceEventInterface.sendEvent(event2);
@@ -311,10 +311,10 @@ public class ApexServiceModelUpdateTest {
}
/**
- * The listener interface for receiving test events. The class that is interested in processing
- * a test event implements this interface, and the object created with that class is registered
- * with a component using the component's <code>addTestListener</code> method. When the test
- * event occurs, that object's appropriate method is invoked.
+ * The listener interface for receiving test events. The class that is interested in processing a test event
+ * implements this interface, and the object created with that class is registered with a component using the
+ * component's <code>addTestListener</code> method. When the test event occurs, that object's appropriate method is
+ * invoked.
*
* @see TestEvent
*/
@@ -323,8 +323,7 @@ public class ApexServiceModelUpdateTest {
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.service.engine.runtime.ApexEventListener#onApexEvent(org.onap.policy
+ * @see org.onap.policy.apex.service.engine.runtime.ApexEventListener#onApexEvent(org.onap.policy
* .apex.service.engine.event.ApexEvent)
*/
@Override
@@ -351,13 +350,13 @@ public class ApexServiceModelUpdateTest {
assertTrue(result.get("TestMatchCase").equals(new Byte((byte) 123)));
assertTrue(result.get("TestTemperature").equals(34.5445667));
assertTrue(((byte) result.get("TestMatchCaseSelected")) >= 0
- && ((byte) result.get("TestMatchCaseSelected") <= 3));
+ && ((byte) result.get("TestMatchCaseSelected") <= 3));
assertTrue(((byte) result.get("TestEstablishCaseSelected")) >= 0
- && ((byte) result.get("TestEstablishCaseSelected") <= 3));
+ && ((byte) result.get("TestEstablishCaseSelected") <= 3));
assertTrue(((byte) result.get("TestDecideCaseSelected")) >= 0
- && ((byte) result.get("TestDecideCaseSelected") <= 3));
- assertTrue(
- ((byte) result.get("TestActCaseSelected")) >= 0 && ((byte) result.get("TestActCaseSelected") <= 3));
+ && ((byte) result.get("TestDecideCaseSelected") <= 3));
+ assertTrue(((byte) result.get("TestActCaseSelected")) >= 0
+ && ((byte) result.get("TestActCaseSelected") <= 3));
}
}
}
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceTest.java
index c178cd9aa..e66d1b791 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/runtime/ApexServiceTest.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/runtime/ApexServiceTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.runtime;
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.runtime;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -38,10 +38,13 @@ 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.service.engine.event.ApexEvent;
+import org.onap.policy.apex.service.engine.runtime.ApexEventListener;
+import org.onap.policy.apex.service.engine.runtime.EngineService;
+import org.onap.policy.apex.service.engine.runtime.EngineServiceEventInterface;
import org.onap.policy.apex.service.engine.runtime.impl.EngineServiceImpl;
-import org.onap.policy.apex.service.engine.utils.Utils;
import org.onap.policy.apex.service.parameters.engineservice.EngineServiceParameters;
-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.performance.benchmark.engine.utils.Utils;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/utils/Utils.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/utils/Utils.java
index cfc787d64..0d239a8ef 100644
--- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/service/engine/utils/Utils.java
+++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/engine/utils/Utils.java
@@ -17,7 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.apex.service.engine.utils;
+
+package org.onap.policy.apex.testsuites.performance.benchmark.engine.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -26,10 +27,24 @@ import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
+/**
+ * The Class Utils.
+ */
public class Utils {
+ /**
+ * Instantiates a new utils.
+ */
private Utils() {}
+ /**
+ * Gets the model string.
+ *
+ * @param ecaPolicyModel the eca policy model
+ * @return the model string
+ * @throws ApexModelException the apex model exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public static String getModelString(final AxPolicyModel ecaPolicyModel) throws ApexModelException, IOException {
try (final ByteArrayOutputStream baOutputStream = new ByteArrayOutputStream()) {
new ApexModelWriter<AxPolicyModel>(AxPolicyModel.class).write(ecaPolicyModel, baOutputStream);