From 2a4848031776982dbefbde5b27442fd20c01d344 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Mon, 11 Mar 2019 16:34:55 -0400 Subject: Improve RA capability processor. Change-Id: I44a8157c9e2a27b49aa8af00a857ebc7b3e845c3 Issue-ID: CCSDK-1137 Signed-off-by: Muthuramalingam, Brinda Santh --- .../processor/CapabilityResourceResolutionProcessorTest.kt | 10 +++++++--- .../mapping/capability/jython-resource-definitions.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt index f779054e9..6da3fd71e 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessorTest.kt @@ -21,6 +21,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.pr import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceAssignmentRuntimeService +import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.ComponentFunctionScriptingService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.BlueprintJythonService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.scripts.PythonExecutorProperty import org.onap.ccsdk.apps.controllerblueprints.core.data.PropertyDefinition @@ -36,7 +37,8 @@ import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [CapabilityResourceResolutionProcessor::class, BluePrintScriptsServiceImpl::class, +@ContextConfiguration(classes = [CapabilityResourceResolutionProcessor::class, ComponentFunctionScriptingService::class, + BluePrintScriptsServiceImpl::class, BlueprintJythonService::class, PythonExecutorProperty::class, MockCapabilityService::class]) @TestPropertySource(properties = ["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints", @@ -62,9 +64,11 @@ class CapabilityResourceResolutionProcessorTest { scriptPropertyInstances["mock-service1"] = MockCapabilityService() scriptPropertyInstances["mock-service2"] = MockCapabilityService() + val instanceDependencies: List = listOf() + val resourceAssignmentProcessor = capabilityResourceResolutionProcessor - .getKotlinResourceAssignmentProcessorInstance( - "ResourceAssignmentProcessor_cba\$ScriptResourceAssignmentProcessor", scriptPropertyInstances) + .scriptInstance("kotlin", + "ResourceAssignmentProcessor_cba\$ScriptResourceAssignmentProcessor", instanceDependencies) assertNotNull(resourceAssignmentProcessor, "couldn't get kotlin script resource assignment processor") 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 fe89291c1..b565eec81 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 @@ -11,7 +11,7 @@ "type": "source-capability", "properties": { "script-type": "jython", - "script-class-reference": "SampleRAProcessor", + "script-class-reference": "Scripts/python/SampleRAProcessor.py", "instance-dependencies": [] } } -- cgit 1.2.3-korg