diff options
author | Brinda Santh <bs2796@att.com> | 2019-12-27 15:43:53 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2019-12-30 18:18:57 +0000 |
commit | 1fdaf4953daf15970afe6ee10491dfa2d0a76753 (patch) | |
tree | a820366a5de5ac7f44492a11f88de7f4f24350f7 /ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin | |
parent | 41712e142c8d2b2bff9bc9e094f45306a60d7cb9 (diff) |
Runtime services for Relationship Type and Templates
Added and improved blueprint runtime service property resolution api.
Relationship template CBA sample
Performance improvement on Artifact resolutions.
Added connection config DSL for DB, GRPC connections.
Added starter relationship connection config models.
Issue-ID: CCSDK-1054
Signed-off-by: Brinda Santh <bs2796@att.com>
Change-Id: I73e1deed708dc924352867ddd1d1b2271c8ea106
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt new file mode 100644 index 000000000..b0c7d8b3c --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/DatabasePropertiesDSLTest.kt @@ -0,0 +1,70 @@ +/* + * Copyright © 2018-2019 AT&T Intellectual Property. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.ccsdk.cds.blueprintsprocessor.db + +import org.junit.Test +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes +import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo +import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate +import kotlin.test.assertEquals +import kotlin.test.assertNotNull + +class DatabasePropertiesDSLTest { + + @Test + fun testDatabasePropertiesDSL() { + val serviceTemplate = serviceTemplate("database-properties-test", "1.0.0", "xxx.@xx.com", "database") { + topologyTemplate { + relationshipTemplateDb("sample-maria-db", "Database Server") { + mariaDb { + url("jdbc://mariadb:3600") + username("user") + password("credential") + hibernateDDLAuto("hibernateDDLAuto") + hibernateHbm2ddlAuto("hibernateHbm2ddlAuto") + hibernateDDLAuto("hibernateDDLAuto") + hibernateNamingStrategy("hibernateNamingStrategy") + } + } + relationshipTemplateDb("sample-mysql-db", "Database Server") { + mySqlDb { + url("jdbc://mysql:3600") + username("user") + password("credential") + hibernateDDLAuto("hibernateDDLAuto") + hibernateHbm2ddlAuto("hibernateHbm2ddlAuto") + hibernateDDLAuto("hibernateDDLAuto") + hibernateNamingStrategy("hibernateNamingStrategy") + } + } + } + relationshipTypes( + arrayListOf( + BluePrintTypes.relationshipTypeConnectsToDb(), + BluePrintTypes.relationshipTypeConnectsTo() + ) + ) + } + assertNotNull(serviceTemplate, "failed to create service template") + val relationshipTemplates = serviceTemplate.topologyTemplate?.relationshipTemplates + assertNotNull(relationshipTemplates, "failed to get relationship templates") + assertEquals(2, relationshipTemplates.size, "relationshipTemplates doesn't match") + assertNotNull(relationshipTemplates["sample-maria-db"], "failed to get sample-maria-db") + assertNotNull(relationshipTemplates["sample-mysql-db"], "failed to get sample-mysql-db") + // println(serviceTemplate.asJsonString(true)) + } +} |