summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-02-15 21:25:27 +0000
committerGerrit Code Review <gerrit@onap.org>2019-02-15 21:25:27 +0000
commitb1a59abb5c37f0bf439bfc14fd5bdf27881784f5 (patch)
tree8b2fdfa1ad993f4fc20c746aa2e01eb18fa3316c /ms/blueprintsprocessor
parent01174642f5c1a9b688e4d6713b3950642fc77836 (diff)
parentcfc807955c9cae60bce983e4f4ac951bf37ecc20 (diff)
Merge "Python library for Jython execution"
Diffstat (limited to 'ms/blueprintsprocessor')
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/BlueprintJythonServiceTest.kt4
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt6
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json9
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/python/SampleResourceAssignmentProcessorScript.py13
4 files changed, 10 insertions, 22 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/BlueprintJythonServiceTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/BlueprintJythonServiceTest.kt
index 8e52a9f4..f6103a4d 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/BlueprintJythonServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/BlueprintJythonServiceTest.kt
@@ -44,9 +44,9 @@ class BlueprintJythonServiceTest {
val dependencies: MutableMap<String, Any> = hashMapOf()
- val content = JacksonUtils.getContent("./../../../../components/scripts/python/ccsdk_blueprints/sample_blueprint_component.py")
+ val content = JacksonUtils.getContent("./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/Scripts/python/SamplePythonComponentNode.py")
- val abstractComponentFunction = blueprintJythonService.jythonInstance<AbstractComponentFunction>(bluePrintContext, "SampleBlueprintComponent", content, dependencies)
+ val abstractComponentFunction = blueprintJythonService.jythonInstance<AbstractComponentFunction>(bluePrintContext, "SamplePythonComponentNode", content, dependencies)
assertNotNull(abstractComponentFunction, "failed to get python component")
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt
index f884456e..64281264 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceAssignmentProcessorTest.kt
@@ -86,7 +86,7 @@ class CapabilityResourceAssignmentProcessorTest {
fun `test jython capability`() {
val bluePrintContext = BluePrintMetadataUtils.getBluePrintContext(
- "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration")
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/capability_python")
val resourceAssignmentRuntimeService = ResourceAssignmentRuntimeService("1234", bluePrintContext)
@@ -100,8 +100,8 @@ class CapabilityResourceAssignmentProcessorTest {
capabilityResourceAssignmentProcessor.resourceDictionaries = resourceDefinitions
val resourceAssignment = ResourceAssignment().apply {
- name = "country"
- dictionaryName = "country"
+ name = "service-instance-id"
+ dictionaryName = "service-instance-id"
dictionarySource = "capability"
property = PropertyDefinition().apply {
type = "string"
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
index 9d834433..d3780e0a 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/capability/jython-resource-definitions.json
@@ -1,13 +1,14 @@
{
- "tags": "country",
- "name": "country",
- "updated-by": "brindasanth@onap.com",
+ "tags": "service-instance-id, tosca.datatypes.Root, data_type",
+ "name": "service-instance-id",
"property": {
- "description": "description",
+ "description": "To be provided",
"type": "string"
},
+ "updated-by": "Singal, Kapil <ks220y@att.com>",
"sources": {
"capability": {
+ "type": "source-capability",
"properties": {
"type": "JYTHON-COMPONENT",
"instance-name": "SampleRAProcessor",
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/python/SampleResourceAssignmentProcessorScript.py b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/python/SampleResourceAssignmentProcessorScript.py
deleted file mode 100644
index bcf450e8..00000000
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/python/SampleResourceAssignmentProcessorScript.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from resource_assignment_processor_function import AbstractJythonComponentFunction
-from blueprint_constants import *
-
-
-class SampleJythonComponentNode(AbstractJythonComponentFunction):
-
- def process(self, execution_request):
- print "Processing calling.." + PROPERTY_BLUEPRINT_BASE_PATH
- return None
-
- def recover(self, runtime_exception, execution_request):
- print "Recovering calling.." + PROPERTY_BLUEPRINT_BASE_PATH
- return None