diff options
author | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-06-29 13:57:14 +0100 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-07-02 16:03:51 +0100 |
commit | 5f0ec1c2d95c377fbec428f11464e93fe442b5ef (patch) | |
tree | 4aef07097fa4d64550db116a1b1b4acd1aa42590 /testsuites/integration/integration-common | |
parent | ba55109db1e5eea013dcffd1be29cf06fe2bbcb1 (diff) |
Cleanup input & outputFields from Task definition
1) Remove the usage of inputField and outputField from Task definition.
2) Fix issues around populating events to task in case of State
Finalizer Logic.
Change-Id: Ief17f400729410b83c6b7c665980d443e0cf6f28
Issue-ID: POLICY-3336
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'testsuites/integration/integration-common')
2 files changed, 11 insertions, 41 deletions
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java index d25bea3a4..ec5eb371a 100644 --- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/EvalDomainModelFactory.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -217,8 +218,6 @@ public class EvalDomainModelFactory { .setDefaultLogic("EvalTaskLogic"); final var obTask = new AxTask(new AxArtifactKey("Task_Observe_0", DEFAULT_VERSION)); - obTask.duplicateInputFields(event0000.getParameterMap()); - obTask.duplicateOutputFields(event0001.getParameterMap()); final var obAxLogic = new AxTaskLogic(obTask.getKey(), TASK_LOGIC, (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader); obAxLogic.setLogic(obAxLogic.getLogic().replace(STATE_NAME, OBSERVE) @@ -226,8 +225,6 @@ public class EvalDomainModelFactory { obTask.setTaskLogic(obAxLogic); final var orTask = new AxTask(new AxArtifactKey("Task_Orient_0", DEFAULT_VERSION)); - orTask.duplicateInputFields(event0001.getParameterMap()); - orTask.duplicateOutputFields(event0002.getParameterMap()); final var orAxLogic = new AxTaskLogic(orTask.getKey(), TASK_LOGIC, (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader); orAxLogic.setLogic(orAxLogic.getLogic().replace(STATE_NAME, ORIENT) @@ -235,8 +232,6 @@ public class EvalDomainModelFactory { orTask.setTaskLogic(orAxLogic); final var dTask = new AxTask(new AxArtifactKey("Task_Decide_0", DEFAULT_VERSION)); - dTask.duplicateInputFields(event0002.getParameterMap()); - dTask.duplicateOutputFields(event0003.getParameterMap()); final var dAxLogic = new AxTaskLogic(dTask.getKey(), TASK_LOGIC, (justOneLang == null ? MVEL : justOneLang), logicReader); dAxLogic.setLogic(dAxLogic.getLogic().replace(STATE_NAME, ORIENT) @@ -244,8 +239,6 @@ public class EvalDomainModelFactory { dTask.setTaskLogic(dAxLogic); final var aTask = new AxTask(new AxArtifactKey("Task_Act_0", DEFAULT_VERSION)); - aTask.duplicateInputFields(event0003.getParameterMap()); - aTask.duplicateOutputFields(event0004.getParameterMap()); final var aAxLogic = new AxTaskLogic(aTask.getKey(), TASK_LOGIC, (justOneLang == null ? "JAVA" : justOneLang), logicReader); aAxLogic.setLogic(aAxLogic.getLogic().replace(STATE_NAME, "Act") @@ -460,8 +453,6 @@ public class EvalDomainModelFactory { .setDefaultLogic("EvalTaskLogic"); final var eTask = new AxTask(new AxArtifactKey("Task_Event_0", DEFAULT_VERSION)); - eTask.duplicateInputFields(event0000.getParameterMap()); - eTask.duplicateOutputFields(event0001.getParameterMap()); final var eAxLogic = new AxTaskLogic(eTask.getKey(), TASK_LOGIC, (justOneLang == null ? JYTHON : justOneLang), logicReader); eAxLogic.setLogic(eAxLogic.getLogic().replace(STATE_NAME, EVENT) @@ -469,8 +460,6 @@ public class EvalDomainModelFactory { eTask.setTaskLogic(eAxLogic); final var cTask = new AxTask(new AxArtifactKey("Task_Condition_0", DEFAULT_VERSION)); - cTask.duplicateInputFields(event0001.getParameterMap()); - cTask.duplicateOutputFields(event0002.getParameterMap()); final var cAxLogic = new AxTaskLogic(cTask.getKey(), TASK_LOGIC, (justOneLang == null ? JAVASCRIPT : justOneLang), logicReader); cAxLogic.setLogic(cAxLogic.getLogic().replace(STATE_NAME, CONDITION) @@ -478,8 +467,6 @@ public class EvalDomainModelFactory { cTask.setTaskLogic(cAxLogic); final var aTask = new AxTask(new AxArtifactKey("Task_Action_0", DEFAULT_VERSION)); - aTask.duplicateInputFields(event0002.getParameterMap()); - aTask.duplicateOutputFields(event0003.getParameterMap()); final var aAxLogic = new AxTaskLogic(aTask.getKey(), TASK_LOGIC, (justOneLang == null ? "JAVA" : justOneLang), logicReader); aAxLogic.setLogic(aAxLogic.getLogic().replace(STATE_NAME, ACTION) diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java index c32dbcf4f..596362aec 100644 --- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/testsuites/integration/common/model/SampleDomainModelFactory.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -446,14 +447,10 @@ public class SampleDomainModelFactory { referenceKeySetList.add(referenceKeySet3); var tasks = new AxTasks(new AxArtifactKey("Tasks", DEFAULT_VERSION)); - tasks.getTaskMap().putAll(getTaskMap(MATCH, event0000.getParameterMap(), event0001.getParameterMap(), - referenceKeySetList, axLogicExecutorType)); - tasks.getTaskMap().putAll(getTaskMap(ESTABLISH, event0001.getParameterMap(), event0002.getParameterMap(), - referenceKeySetList, axLogicExecutorType)); - tasks.getTaskMap().putAll(getTaskMap(DECIDE, event0002.getParameterMap(), event0003.getParameterMap(), - referenceKeySetList, axLogicExecutorType)); - tasks.getTaskMap().putAll(getTaskMap("Act", event0003.getParameterMap(), event0004.getParameterMap(), - referenceKeySetList, axLogicExecutorType)); + tasks.getTaskMap().putAll(getTaskMap(MATCH, referenceKeySetList, axLogicExecutorType)); + tasks.getTaskMap().putAll(getTaskMap(ESTABLISH, referenceKeySetList, axLogicExecutorType)); + tasks.getTaskMap().putAll(getTaskMap(DECIDE, referenceKeySetList, axLogicExecutorType)); + tasks.getTaskMap().putAll(getTaskMap("Act", referenceKeySetList, axLogicExecutorType)); Set<AxArtifactKey> matchTasks = new TreeSet<>(); Set<AxArtifactKey> establishTasks = new TreeSet<>(); @@ -685,25 +682,17 @@ public class SampleDomainModelFactory { * Gets the task map. * * @param state the state - * @param inputFields the input fields - * @param outputFields the output fields * @param referenceKeySetList the reference key set list * @param axLogicExecutorType the ax logic executor type * @return the task map */ - private Map<AxArtifactKey, AxTask> getTaskMap(final String state, final Map<String, AxField> inputFields, - final Map<String, AxField> outputFields, final List<Set<AxArtifactKey>> referenceKeySetList, - final String axLogicExecutorType) { + private Map<AxArtifactKey, AxTask> getTaskMap(final String state, + final List<Set<AxArtifactKey>> referenceKeySetList, final String axLogicExecutorType) { var testTask0 = new AxTask(new AxArtifactKey(TASK + state + "0", DEFAULT_VERSION)); - testTask0.duplicateInputFields(inputFields); - testTask0.duplicateOutputFields(outputFields); - var parameter00 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER0), - DEFAULT_VALUE0); - var parameter01 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER1), - DEFAULT_VALUE1); - var parameter02 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER2), - DEFAULT_VALUE2); + var parameter00 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER0), DEFAULT_VALUE0); + var parameter01 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER1), DEFAULT_VALUE1); + var parameter02 = new AxTaskParameter(new AxReferenceKey(testTask0.getKey(), PARAMETER2), DEFAULT_VALUE2); testTask0.getTaskParameters().put(parameter00.getKey().getLocalName(), parameter00); testTask0.getTaskParameters().put(parameter01.getKey().getLocalName(), parameter01); testTask0.getTaskParameters().put(parameter02.getKey().getLocalName(), parameter02); @@ -714,8 +703,6 @@ public class SampleDomainModelFactory { testTask0.setTaskLogic(getTaskLogic(testTask0, logicReader, axLogicExecutorType, state, "2")); var testTask1 = new AxTask(new AxArtifactKey(TASK + state + "1", DEFAULT_VERSION)); - testTask1.duplicateInputFields(inputFields); - testTask1.duplicateOutputFields(outputFields); var parameter10 = new AxTaskParameter(new AxReferenceKey(testTask1.getKey(), PARAMETER0), DEFAULT_VALUE0); var parameter11 = new AxTaskParameter(new AxReferenceKey(testTask1.getKey(), PARAMETER1), @@ -726,8 +713,6 @@ public class SampleDomainModelFactory { testTask1.setTaskLogic(getTaskLogic(testTask1, logicReader, axLogicExecutorType, state, "3")); var testTask2 = new AxTask(new AxArtifactKey(TASK + state + "2", DEFAULT_VERSION)); - testTask2.duplicateInputFields(inputFields); - testTask2.duplicateOutputFields(outputFields); var parameter20 = new AxTaskParameter(new AxReferenceKey(testTask2.getKey(), PARAMETER0), DEFAULT_VALUE0); testTask2.getTaskParameters().put(parameter20.getKey().getLocalName(), parameter20); @@ -735,8 +720,6 @@ public class SampleDomainModelFactory { testTask2.setTaskLogic(getTaskLogic(testTask2, logicReader, axLogicExecutorType, state, "0")); var testTask3 = new AxTask(new AxArtifactKey(TASK + state + "3", DEFAULT_VERSION)); - testTask3.duplicateInputFields(inputFields); - testTask3.duplicateOutputFields(outputFields); var parameter30 = new AxTaskParameter(new AxReferenceKey(testTask3.getKey(), PARAMETER0), DEFAULT_VALUE0); testTask3.getTaskParameters().put(parameter30.getKey().getLocalName(), parameter30); |