From 7af6a923ef993bed14d0fc5f769c3766c94b88b3 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Tue, 20 Nov 2018 12:20:30 -0500 Subject: Add Jython Component model and validation logics. Change-Id: I2bdba0016a41e16198d60be68dff68d1ce7ad13a Issue-ID: CCSDK-696 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../load/model_type/node_type/component-resource-assignment.json | 2 +- .../ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt | 1 + .../onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt | 1 + .../core/service/BluePrintRuntimeServiceTest.kt | 8 ++++---- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'components/core') diff --git a/components/core/load/model_type/node_type/component-resource-assignment.json b/components/core/load/model_type/node_type/component-resource-assignment.json index 1389bc328..2a9035619 100644 --- a/components/core/load/model_type/node_type/component-resource-assignment.json +++ b/components/core/load/model_type/node_type/component-resource-assignment.json @@ -7,7 +7,7 @@ } }, "interfaces": { - "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": { + "ResourceAssignmentComponent": { "operations": { "process": { "inputs": { diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt index 84d2befc5..a41284187 100644 --- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt +++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt @@ -93,6 +93,7 @@ object BluePrintConstants { const val MODEL_TYPE_NODES_COMPONENT_BUNDLE: String = "tosca.nodes.component.Bundle" const val MODEL_TYPE_NODES_COMPONENT_SCRIPT: String = "tosca.nodes.component.Script" const val MODEL_TYPE_NODES_COMPONENT_PYTHON: String = "tosca.nodes.component.Python" + const val MODEL_TYPE_NODES_COMPONENT_JYTHON: String = "tosca.nodes.component.Jython" const val MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT: String = "tosca.nodes.component.JavaScript" const val MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION = "tosca.artifacts.Implementation" diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt index a971898d3..64797ed40 100644 --- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt +++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt @@ -37,6 +37,7 @@ object BluePrintTypes { BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_BUNDLE, BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_SCRIPT, BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_PYTHON, + BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_JYTHON, BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT ) diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index 19c6c2f9d..2f519802d 100644 --- a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt +++ b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -69,7 +69,7 @@ class BluePrintRuntimeServiceTest { "data/default-context.json", executionContext) val inContext: MutableMap = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment", - "DefaultComponentNode", "process") + "ResourceAssignmentComponent", "process") assertNotNull(inContext, "Failed to populate interface input property values") assertEquals(inContext["action-name"], jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name") @@ -86,14 +86,14 @@ class BluePrintRuntimeServiceTest { bluePrintRuntimeService.setNodeTemplateAttributeValue("resource-assignment", "assignment-params", NullNode.getInstance()) bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment", - "DefaultComponentNode", "process") + "ResourceAssignmentComponent", "process") val outputStatus = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment", - "DefaultComponentNode", "process", "status") + "ResourceAssignmentComponent", "process", "status") assertEquals("success".asJsonPrimitive(), outputStatus, "Failed to get operation property status") val outputParams = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment", - "DefaultComponentNode", "process", "resource-assignment-params") + "ResourceAssignmentComponent", "process", "resource-assignment-params") assertEquals(NullNode.getInstance(), outputParams, "Failed to get operation property resource-assignment-params") } -- cgit 1.2.3-korg