From cb768ce12516415276ee370112a837014cb8c37c Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Thu, 12 Jul 2018 12:47:09 +0100 Subject: Adding Benchmark module Change-Id: I4817580bf53bbf46b6890b70d49c8a2edabca749 Issue-ID: POLICY-865 Signed-off-by: waqas.ikram --- .../onap/policy/apex/test/common/model/EvalDomainModelFactory.java | 2 +- .../onap/policy/apex/test/common/model/java/EvalTask_Logic.java | 7 +------ .../policy/apex/test/common/model/jython/EvalTask_Logic.jython | 6 +----- 3 files changed, 3 insertions(+), 12 deletions(-) (limited to 'testsuites/integration/integration-common/src/main') diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java index 65d49f026..83a4ccc76 100644 --- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java @@ -354,7 +354,7 @@ public class EvalDomainModelFactory { final AxTask eTask = new AxTask(new AxArtifactKey("Task_Event_0", "0.0.1")); eTask.duplicateInputFields(event0000.getParameterMap()); eTask.duplicateOutputFields(event0001.getParameterMap()); - final AxTaskLogic eAxLogic = new AxTaskLogic(eTask.getKey(), "TaskLogic", (justOneLang == null ? "JRUBY" : justOneLang), logicReader); + final AxTaskLogic eAxLogic = new AxTaskLogic(eTask.getKey(), "TaskLogic", (justOneLang == null ? "JYTHON" : justOneLang), logicReader); eAxLogic.setLogic( eAxLogic.getLogic().replaceAll("", "Event").replaceAll("", eTask.getKey().getName()).replaceAll("", "1")); eTask.setTaskLogic(eAxLogic); diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/java/EvalTask_Logic.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/java/EvalTask_Logic.java index f86107186..f4fa533f8 100644 --- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/java/EvalTask_Logic.java +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/java/EvalTask_Logic.java @@ -28,10 +28,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; /** * The Class EvalTask_Logic is default evaluation task logic in Java. */ -//CHECKSTYLE:OFF: checkstyle:typeNames public class EvalTask_Logic { - // CHECKSTYLE:ON: checkstyle:typeNames - private static int stateNo = 0; /** * Gets the event. @@ -43,13 +40,11 @@ public class EvalTask_Logic { public boolean getEvent(final TaskExecutionContext executor) throws ApexException { executor.logger.debug(executor.subject.getId()); executor.logger.debug(executor.inFields.toString()); - System.err.println(executor.inFields); executor.outFields.putAll(executor.inFields); final Date timeNow = new Date(); - executor.outFields.put("State" + (stateNo + 1) + "Timestamp", timeNow.getTime()); + executor.outFields.put("State3Timestamp", timeNow.getTime()); executor.logger.debug(executor.outFields.toString()); - stateNo++; return true; } } diff --git a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython index bc803ebf2..aa6525673 100644 --- a/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython +++ b/testsuites/integration/integration-common/src/main/resources/org/onap/policy/apex/test/common/model/jython/EvalTask_Logic.jython @@ -19,18 +19,14 @@ #------------------------------------------------------------------------------- from java.lang import Boolean -from java.lang import Byte from java.lang import Long from java.util import Date executor.logger.debug('id: ' + executor.subject.id) executor.logger.debug('inFields: ' + executor.inFields.toString()) - -executor.outFields = executor.createOutgoingEvent(outEvent) executor.outFields.putAll(executor.inFields) -timeValue = Long(Date().getTime()); -executor.outFields["StateTimestamp"] = timeValue +executor.outFields["StateTimestamp"] = Long(Date().getTime()) executor.logger.debug('outFields: ' + executor.outFields.toString()) returnValue = Boolean.TRUE -- cgit 1.2.3-korg