aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorBrinda Santh <brindasanth@in.ibm.com>2019-08-02 12:08:54 -0400
committerDan Timoney <dtimoney@att.com>2019-08-09 20:04:11 +0000
commit54c3633cadf1cd087efa7af6acdf54ae47a4759a (patch)
tree3bb93418bf4ca553c04816a5380662079b36a086 /ms/blueprintsprocessor/functions/resource-resolution/src/test
parent6972452ec5f9cab7a8031d670843dd54c0c0a708 (diff)
Add resource assignment DSL.
Change-Id: I44a3596c05b02faa171f90b9207f774ce34976a6 Issue-ID: CCSDK-1577 Signed-off-by: Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt (renamed from ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionSDLTest.kt)41
1 files changed, 37 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionSDLTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt
index 340b2b324..f8f0e991e 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionSDLTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceDefinitionDSLTest.kt
@@ -18,16 +18,18 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import kotlin.test.Test
+import kotlin.test.assertEquals
import kotlin.test.assertNotNull
-class ResourceDefinitionSDLTest {
+class ResourceDefinitionDSLTest {
@Test
fun testResourceDefinitionDSL() {
- val resourceDefinition = BluePrintTypes.resourceDefinition("service-instance-id") {
+ val testResourceDefinition = BluePrintTypes.resourceDefinition("service-instance-id",
+ "VFW Service Instance Name") {
tags("service-instance-name, vfw, resources")
updatedBy("brindasanth@onap.com")
- property("service-instance-name", "string", true, "VFW Service Instance Name")
+ property("string", true)
sources {
sourceInput("input", "") {}
sourceDefault("default", "") {}
@@ -73,6 +75,37 @@ class ResourceDefinitionSDLTest {
}
}
//println(resourceDefinition.asJsonString(true))
- assertNotNull(resourceDefinition, "failed to generate resourceDefinition")
+ assertNotNull(testResourceDefinition, "failed to generate testResourceDefinition")
+
+ val testResourceDefinitions = BluePrintTypes.resourceDefinitions {
+ resourceDefinition(testResourceDefinition)
+ }
+ assertNotNull(testResourceDefinitions, "failed to generate testResourceDefinitions")
+ assertEquals(1, testResourceDefinitions.size, "testResourceDefinitions size doesn't match")
+ }
+
+ @Test
+ fun testResourceAssignment() {
+ val testResourceAssignment = BluePrintTypes.resourceAssignment("instance-name",
+ "service-instance-name", "odl-mdsal") {
+ inputParameter(true)
+ property("string", true)
+ dependencies(arrayListOf("service-instance-id"))
+ }
+ //println(resourceAssignment.asJsonString(true))
+ assertNotNull(testResourceAssignment, "failed to generate resourceAssignment")
+
+ val testResourceAssignments = BluePrintTypes.resourceAssignments {
+ resourceAssignment(testResourceAssignment)
+ resourceAssignment("instance-name1",
+ "service-instance-name", "odl-mdsal") {
+ inputParameter(true)
+ property("string", true)
+ dependencies(arrayListOf("service-instance-id"))
+ }
+ }
+ //println(testResourceAssignments.asJsonString(true))
+ assertNotNull(testResourceAssignments, "failed to generate testResourceAssignments")
+ assertEquals(2, testResourceAssignments.size, "testResourceAssignments size doesn't match")
}
} \ No newline at end of file