diff options
author | Brinda Santh <brindasanth@in.ibm.com> | 2019-06-10 15:50:23 -0400 |
---|---|---|
committer | Brinda Santh <brindasanth@in.ibm.com> | 2019-06-25 14:07:03 -0400 |
commit | 5c04d574527c41c241361d44bcd58983065ac0c3 (patch) | |
tree | 7de5aab73837e8425609f9f4f5995a7f2e84036c /ms/controllerblueprints/modules/blueprint-core/src/test/kotlin | |
parent | b3eb3fc950e6cda05d85d8422863b81bd0e766dd (diff) |
Add blueprint domain DSL
Change-Id: Id9f64605fa74f54d43af55357a521cf347fa8677
Issue-ID: CCSDK-1380
Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test/kotlin')
-rw-r--r-- | ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BluePrintDSLTest.kt | 42 |
1 files changed, 40 insertions, 2 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 dff0f943f..e7f24d629 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 @@ -21,6 +21,44 @@ import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType import kotlin.test.assertNotNull class BluePrintDSLTest { + + @Test + fun testOperationDSLWorkflow() { + + val blueprint = blueprint("sample-bp", "1.0.0", + "brindasanth@onap.com", "sample, blueprints") { + + // For New Component Definition + component("resource-resolution", "component-resource-resolution", "1.0.0", + "Resource Resolution Call") { + implementation(180) + // Attributes ( Properties which will be set during execution) + attribute("template1-data", "string", true, "") + + // Properties + property("string-value1", "string", true, "sample") + property("string-value2", "string", true, getInput("key-1")) + // Inputs + input("json-content", "json", true, """{ "name" : "cds"}""") + input("template-content", "string", true, getArtifact("template1")) + // Outputs + output("self-attribute-expression", "json", true, getAttribute("template1-data")) + // Artifacts + artifacts("template1", "artifact-velocity", "Templates/template1.vtl") + } + + workflow("resource-resolution-process", "") { + input("json-content", "json", true, "") + input("key-1", "string", true, "") + output("status", "string", true, "success") + step("resource-resolution-call", "resource-resolution", "Resource Resolution component invoke") + } + } + assertNotNull(blueprint.components, "failed to get components") + assertNotNull(blueprint.workflows, "failed to get workflows") + //println(blueprint.asJsonString(true)) + } + @Test fun testServiceTemplate() { val serviceTemplate = serviceTemplate("sample-bp", "1.0.0", @@ -88,7 +126,7 @@ class BluePrintDSLTest { assertNotNull(serviceTemplate.topologyTemplate, "failed to get topology template") assertNotNull(serviceTemplate.topologyTemplate?.nodeTemplates, "failed to get nodeTypes") assertNotNull(serviceTemplate.topologyTemplate?.nodeTemplates!!["activate"], "failed to get nodeTypes(activate)") - //println(JacksonUtils.getJson(serviceTemplate, true)) + //println(serviceTemplate.asJsonString(true)) } @Test @@ -107,7 +145,7 @@ class BluePrintDSLTest { } assertNotNull(serviceTemplate.topologyTemplate, "failed to get topology template") assertNotNull(serviceTemplate.topologyTemplate?.workflows?.get("activate"), "failed to get workflow(activate)") - //println(JacksonUtils.getJson(serviceTemplate, true)) + //println(serviceTemplate.asJsonString(true)) } } |