From 54426584a02e6fbfec5f7685c92e1a3fde62309f Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Thu, 15 Aug 2019 16:41:17 -0400 Subject: Make source-db consistent across samples Issue-Id: CCSDK-1623 Signed-off-by: Oleg Mitsura Change-Id: Iec7c6909c39c34894be11bfdac45f6394010d9cf --- .../src/test/resources/application-test.properties | 18 +++++------ .../src/test/resources/application-test.properties | 18 +++++------ .../src/test/resources/application-test.properties | 18 +++++------ .../DatabaseResourceAssignmentProcessor.kt | 10 +++++-- .../RestResourceResolutionProcessorTest.kt | 8 ++--- .../src/test/resources/application-test.properties | 32 ++++++++++---------- .../resources/mapping/primary-db/dt-location.json | 15 ---------- .../mapping/primary-db/primary-db-array.json | 35 ---------------------- .../mapping/primary-db/primary-db-complex.json | 27 ----------------- .../mapping/primary-db/primary-db-simple.json | 26 ---------------- .../primary-db/resource-assignments-simple.json | 22 -------------- .../mapping/processor-db/dt-location.json | 15 ++++++++++ .../mapping/processor-db/processor-db-array.json | 35 ++++++++++++++++++++++ .../mapping/processor-db/processor-db-complex.json | 27 +++++++++++++++++ .../mapping/processor-db/processor-db-simple.json | 26 ++++++++++++++++ .../processor-db/resource-assignments-simple.json | 22 ++++++++++++++ .../src/test/resources/application-test.properties | 16 +++++----- 17 files changed, 187 insertions(+), 183 deletions(-) delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/dt-location.json delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-array.json delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-complex.json delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-simple.json delete mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/resource-assignments-simple.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/dt-location.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-array.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-complex.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-simple.json create mode 100644 ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/resource-assignments-simple.json (limited to 'ms/blueprintsprocessor/functions') diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties index 527eb8a26..2bbe31b3c 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties @@ -15,14 +15,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 -blueprintsprocessor.db.primary.username=sa -blueprintsprocessor.db.primary.password= -blueprintsprocessor.db.primary.driverClassName=org.h2.Driver -blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop -blueprintsprocessor.db.primary.hibernateDDLAuto=update -blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.username=sa +blueprintsprocessor.db.password= +blueprintsprocessor.db.driverClassName=org.h2.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect # Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive @@ -32,4 +32,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true \ No newline at end of file +blueprintprocessor.netconfExecutor.enabled=true diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties index ce5b4e39f..74c478a2a 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 -blueprintsprocessor.db.primary.username=sa -blueprintsprocessor.db.primary.password= -blueprintsprocessor.db.primary.driverClassName=org.h2.Driver -blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop -blueprintsprocessor.db.primary.hibernateDDLAuto=update -blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.username=sa +blueprintsprocessor.db.password= +blueprintsprocessor.db.driverClassName=org.h2.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect # Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive @@ -29,4 +29,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true \ No newline at end of file +blueprintprocessor.netconfExecutor.enabled=true diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties index 527eb8a26..2bbe31b3c 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties @@ -15,14 +15,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 -blueprintsprocessor.db.primary.username=sa -blueprintsprocessor.db.primary.password= -blueprintsprocessor.db.primary.driverClassName=org.h2.Driver -blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop -blueprintsprocessor.db.primary.hibernateDDLAuto=update -blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.username=sa +blueprintsprocessor.db.password= +blueprintsprocessor.db.driverClassName=org.h2.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect # Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive @@ -32,4 +32,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true \ No newline at end of file +blueprintprocessor.netconfExecutor.enabled=true diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt index f8193b7f9..6645a631a 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt @@ -123,12 +123,16 @@ open class DatabaseResourceAssignmentProcessor(private val bluePrintDBLibPropert checkNotEmpty(resourceAssignment.dictionaryName) { "resource assignment dictionary name is not defined for template key (${resourceAssignment.name})" } - check(resourceAssignment.dictionarySource in arrayOf(ResourceDictionaryConstants.SOURCE_PROCESSOR_DB, ResourceDictionaryConstants.SOURCE_PRIMARY_DB)) + check(resourceAssignment.dictionarySource in getListOfDBSources()) { - "resource assignment source is not ${ResourceDictionaryConstants.SOURCE_PROCESSOR_DB} but it is ${resourceAssignment.dictionarySource}" + "resource assignment source is not ${ResourceDictionaryConstants.PROCESSOR_DB} but it is ${resourceAssignment.dictionarySource}" } } + //placeholder to get the list of DB sources. + //TODO: This will be replaced with a DB + private fun getListOfDBSources(): Array = arrayOf(ResourceDictionaryConstants.PROCESSOR_DB) + private fun populateNamedParameter(inputKeyMapping: Map): Map { val namedParameters = HashMap() inputKeyMapping.forEach { @@ -163,4 +167,4 @@ open class DatabaseResourceAssignmentProcessor(private val bluePrintDBLibPropert override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) { raRuntimeService.getBluePrintError().addError(runtimeException.message!!) } -} \ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt index 7e7e65635..9c6aae250 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt @@ -73,7 +73,7 @@ class RestResourceResolutionProcessorTest { val resourceAssignment = ResourceAssignment().apply { name = "rr-name" dictionaryName = "vnf_name" - dictionarySource = "primary-config-data" + dictionarySource = "config-data" property = PropertyDefinition().apply { type = "string" } @@ -106,7 +106,7 @@ class RestResourceResolutionProcessorTest { val resourceAssignment = ResourceAssignment().apply { name = "rr-aai" dictionaryName = "aai-get-resource" - dictionarySource = "primary-aai-data" + dictionarySource = "aai-data" property = PropertyDefinition().apply { type = "string" } @@ -139,7 +139,7 @@ class RestResourceResolutionProcessorTest { val resourceAssignment = ResourceAssignment().apply { name = "rr-aai" dictionaryName = "aai-put-resource" - dictionarySource = "primary-aai-data" + dictionarySource = "aai-data" property = PropertyDefinition().apply { type = "string" } @@ -150,4 +150,4 @@ class RestResourceResolutionProcessorTest { println(processorName) } } -} \ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/application-test.properties index 5deea31e1..3218a585d 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/application-test.properties @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 -blueprintsprocessor.db.primary.username=sa -blueprintsprocessor.db.primary.password= -blueprintsprocessor.db.primary.driverClassName=org.h2.Driver -blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop -blueprintsprocessor.db.primary.hibernateDDLAuto=update -blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.username=sa +blueprintsprocessor.db.password= +blueprintsprocessor.db.driverClassName=org.h2.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect # Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive @@ -30,12 +30,12 @@ blueprintsprocessor.blueprintWorkingPath=./target/blueprints/work blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints -blueprintsprocessor.restclient.primary-config-data.type=basic-auth -blueprintsprocessor.restclient.primary-config-data.url=http://127.0.0.1:9911 -blueprintsprocessor.restclient.primary-config-data.username=sampleuser -blueprintsprocessor.restclient.primary-config-data.password=sampletoken +blueprintsprocessor.restclient.config-data.type=basic-auth +blueprintsprocessor.restclient.config-data.url=http://127.0.0.1:9911 +blueprintsprocessor.restclient.config-data.username=sampleuser +blueprintsprocessor.restclient.config-data.password=sampletoken -blueprintsprocessor.restclient.primary-aai-data.type=basic-auth -blueprintsprocessor.restclient.primary-aai-data.url=http://127.0.0.1:30800 -blueprintsprocessor.restclient.primary-aai-data.username=admin -blueprintsprocessor.restclient.primary-aai-data.password=aaiTest \ No newline at end of file +blueprintsprocessor.restclient.aai-data.type=basic-auth +blueprintsprocessor.restclient.aai-data.url=http://127.0.0.1:30800 +blueprintsprocessor.restclient.aai-data.username=admin +blueprintsprocessor.restclient.aai-data.password=aaiTest diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/dt-location.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/dt-location.json deleted file mode 100644 index 52e0a7967..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/dt-location.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0", - "description": "test Data Type", - "properties": { - "country": { - "required": true, - "type": "string" - }, - "state": { - "required": false, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Root" -} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-array.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-array.json deleted file mode 100644 index 7082a4341..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-array.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "locations": { - "name": "locations", - "data-type": "list", - "entry-schema": "dt-location", - "source": { - "primary-db": { - "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "db-country": "country", - "db-state": "state" - } - } - }, - "candidate-dependency": { - "primary-db": { - "names": [ - "profile_name" - ] - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-complex.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-complex.json deleted file mode 100644 index 53e2a11c3..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-complex.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "location": { - "name": "location", - "data-type": "dt-location", - "source": { - "primary-db": { - "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "db-country": "country", - "db-state": "state" - } - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-simple.json deleted file mode 100644 index fad088877..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/primary-db-simple.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "country": { - "name": "country", - "data-type": "string", - "source": { - "primary-db": { - "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name", - "input-key-mapping": { - "profile_name": "profile_name" - }, - "output-key-mapping": { - "country": "country" - } - } - } - }, - "profile_name": { - "name": "profile_name", - "data-type": "string", - "source": { - "input": { - - } - } - } -} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/resource-assignments-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/resource-assignments-simple.json deleted file mode 100644 index bb392d7be..000000000 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/primary-db/resource-assignments-simple.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "country", - "input-param": true, - "property": { - "type": "string" - }, - "dictionary-name": "country", - "dictionary-source": "primary-db", - "dependencies": ["state"] - }, - { - "name": "state", - "input-param": true, - "property": { - "type": "string" - }, - "dictionary-name": "state", - "dictionary-source": "input", - "dependencies": [] - } -] diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/dt-location.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/dt-location.json new file mode 100644 index 000000000..256830ef9 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/dt-location.json @@ -0,0 +1,15 @@ +{ + "version": "1.0.0", + "description": "test Data Type", + "properties": { + "country": { + "required": true, + "type": "string" + }, + "state": { + "required": false, + "type": "string" + } + }, + "derived_from": "tosca.datatypes.Root" +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-array.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-array.json new file mode 100644 index 000000000..16788c3ba --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-array.json @@ -0,0 +1,35 @@ +{ + "locations": { + "name": "locations", + "data-type": "list", + "entry-schema": "dt-location", + "source": { + "processor-db": { + "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "db-country": "country", + "db-state": "state" + } + } + }, + "candidate-dependency": { + "processor-db": { + "names": [ + "profile_name" + ] + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-complex.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-complex.json new file mode 100644 index 000000000..bccf250f1 --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-complex.json @@ -0,0 +1,27 @@ +{ + "location": { + "name": "location", + "data-type": "dt-location", + "source": { + "processor-db": { + "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "db-country": "country", + "db-state": "state" + } + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-simple.json new file mode 100644 index 000000000..843adc1fa --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/processor-db-simple.json @@ -0,0 +1,26 @@ +{ + "country": { + "name": "country", + "data-type": "string", + "source": { + "processor-db": { + "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name", + "input-key-mapping": { + "profile_name": "profile_name" + }, + "output-key-mapping": { + "country": "country" + } + } + } + }, + "profile_name": { + "name": "profile_name", + "data-type": "string", + "source": { + "input": { + + } + } + } +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/resource-assignments-simple.json b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/resource-assignments-simple.json new file mode 100644 index 000000000..9d7d44c9c --- /dev/null +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/mapping/processor-db/resource-assignments-simple.json @@ -0,0 +1,22 @@ +[ + { + "name": "country", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "country", + "dictionary-source": "processor-db", + "dependencies": ["state"] + }, + { + "name": "state", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "state", + "dictionary-source": "input", + "dependencies": [] + } +] diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/restconf-executor/src/test/resources/application-test.properties index 6d8b62ff9..60c6fef50 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/test/resources/application-test.properties @@ -15,14 +15,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 -blueprintsprocessor.db.primary.username=sa -blueprintsprocessor.db.primary.password= -blueprintsprocessor.db.primary.driverClassName=org.h2.Driver -blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop -blueprintsprocessor.db.primary.hibernateDDLAuto=update -blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.username=sa +blueprintsprocessor.db.password= +blueprintsprocessor.db.driverClassName=org.h2.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect # Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive -- cgit 1.2.3-korg