summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-core/src/test
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-06-25 13:18:35 -0400
committerBrinda Santh <brindasanth@in.ibm.com>2019-06-25 14:34:30 -0400
commit1aacdb023fc2f05cc30e7308ab02a2fd874b53b1 (patch)
treeb0499a0b78da205386d33bb8683af0c5f9d995f7 /ms/controllerblueprints/modules/blueprint-core/src/test
parent5c04d574527c41c241361d44bcd58983065ac0c3 (diff)
DSL to service template generator
Change-Id: I179bb3bf83d6c1688a13dce965a3d4388f011fcd Issue-ID: CCSDK-1421 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt31
1 files changed, 27 insertions, 4 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt
index e7f24d629..020edc78e 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt
@@ -17,6 +17,7 @@
package org.onap.ccsdk.cds.controllerblueprints.core.dsl
import org.junit.Test
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType
import kotlin.test.assertNotNull
@@ -28,9 +29,11 @@ class BluePrintDSLTest {
val blueprint = blueprint("sample-bp", "1.0.0",
"brindasanth@onap.com", "sample, blueprints") {
+ artifactType(BluePrintTypes.artifactTypeTemplateVelocity())
+
// For New Component Definition
- component("resource-resolution", "component-resource-resolution", "1.0.0",
- "Resource Resolution Call") {
+ component("resource-resolution", "component-script-executor", "1.0.0",
+ "Resource Resolution component.") {
implementation(180)
// Attributes ( Properties which will be set during execution)
attribute("template1-data", "string", true, "")
@@ -44,10 +47,25 @@ class BluePrintDSLTest {
// Outputs
output("self-attribute-expression", "json", true, getAttribute("template1-data"))
// Artifacts
- artifacts("template1", "artifact-velocity", "Templates/template1.vtl")
+ artifact("template1", "artifact-template-velocity", "Templates/template1.vtl")
}
- workflow("resource-resolution-process", "") {
+ // Already definitions Registered Components
+ registryComponent("activate-restconf", "component-resource-resolution", "1.0.0",
+ "RestconfExecutor", "Resource Resolution component.") {
+ implementation(180)
+ // Properties
+ property("string-value1", "data")
+ // Inputs
+ input("json-content", """{ "name" : "cds"}""")
+ // Outputs
+ output("self-attribute-expression", getAttribute("template1-data"))
+ // Artifacts
+ artifact("template2", "artifact-template-velocity", "Templates/template1.vtl")
+
+ }
+
+ workflow("resource-resolution-process", "Resource Resolution wf") {
input("json-content", "json", true, "")
input("key-1", "string", true, "")
output("status", "string", true, "success")
@@ -57,6 +75,11 @@ class BluePrintDSLTest {
assertNotNull(blueprint.components, "failed to get components")
assertNotNull(blueprint.workflows, "failed to get workflows")
//println(blueprint.asJsonString(true))
+
+ val serviceTemplateGenerator = BluePrintServiceTemplateGenerator(blueprint)
+ val serviceTemplate = serviceTemplateGenerator.serviceTemplate()
+ assertNotNull(serviceTemplate.topologyTemplate, "failed to get service topology template")
+ //println(serviceTemplate.asJsonString(true))
}
@Test