diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-12-13 15:10:35 -0500 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-12-13 15:10:35 -0500 |
commit | 776d17ace2d674f3e9f5685a7a005ce4b7b91ed3 (patch) | |
tree | ab498fbfb7efe2693112f987eb9779b321192751 /components/resource-dict | |
parent | 28c81bf300978b23260ea853afd056da9041ca41 (diff) |
Add blueprint runtime service to validator
Change-Id: I0e4375e422b55002f1666ee9e61a1469482f77d2
Issue-ID: CCSDK-757
Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'components/resource-dict')
4 files changed, 11 insertions, 11 deletions
diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt index fc7f1092..d71fbbf8 100644 --- a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt +++ b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt @@ -18,14 +18,14 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service import com.att.eelf.configuration.EELFLogger +import com.att.eelf.configuration.EELFManager import org.apache.commons.collections.CollectionUtils import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.text.StrBuilder import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException +import org.onap.ccsdk.apps.controllerblueprints.core.format import org.onap.ccsdk.apps.controllerblueprints.core.utils.TopologicalSortingUtils import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment -import com.att.eelf.configuration.EELFManager -import org.onap.ccsdk.apps.controllerblueprints.core.format import org.onap.ccsdk.apps.controllerblueprints.resource.dict.factory.ResourceSourceMappingFactory import java.io.Serializable @@ -41,12 +41,12 @@ interface ResourceAssignmentValidationService : Serializable { } /** - * ResourceAssignmentValidationDefaultService. + * ResourceAssignmentValidationServiceImpl. * * @author Brinda Santh */ -open class ResourceAssignmentValidationDefaultService : ResourceAssignmentValidationService { - private val log: EELFLogger = EELFManager.getInstance().getLogger(ResourceAssignmentValidationDefaultService::class.java) +open class ResourceAssignmentValidationServiceImpl : ResourceAssignmentValidationService { + private val log: EELFLogger = EELFManager.getInstance().getLogger(ResourceAssignmentValidationServiceImpl::class.java) open var resourceAssignmentMap: Map<String, ResourceAssignment> = hashMapOf() open val validationMessage = StrBuilder() diff --git a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationService.kt b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationService.kt index 2c66ff19..9541a7b8 100644 --- a/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationService.kt +++ b/components/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationService.kt @@ -50,7 +50,7 @@ interface ResourceDefinitionValidationService : Serializable { * * @author Brinda Santh */ -open class ResourceDefinitionDefaultValidationService(private val bluePrintRepoService: BluePrintRepoService) : ResourceDefinitionValidationService { +open class ResourceDefinitionValidationServiceImpl(private val bluePrintRepoService: BluePrintRepoService) : ResourceDefinitionValidationService { private val log: EELFLogger = EELFManager.getInstance().getLogger(ResourceDefinitionValidationService::class.java) @@ -58,7 +58,7 @@ open class ResourceDefinitionDefaultValidationService(private val bluePrintRepoS Preconditions.checkNotNull(resourceDefinition, "Failed to get Resource Definition") log.trace("Validating Resource Dictionary Definition {}", resourceDefinition.name) - resourceDefinition.sources.forEach { (name, nodeTemplate) -> + resourceDefinition.sources.forEach { name, nodeTemplate -> val sourceType = nodeTemplate.type val sourceNodeType = bluePrintRepoService.getNodeType(sourceType) diff --git a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationServiceTest.kt b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationServiceTest.kt index 87ebb700..191f568f 100644 --- a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationServiceTest.kt +++ b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationServiceTest.kt @@ -43,7 +43,7 @@ class ResourceAssignmentValidationServiceTest { fun testValidateSuccess() {
log.info("**************** testValidateSuccess *****************")
val assignments = JacksonUtils.getListFromClassPathFile("validation/success.json", ResourceAssignment::class.java)
- val resourceAssignmentValidator = ResourceAssignmentValidationDefaultService()
+ val resourceAssignmentValidator = ResourceAssignmentValidationServiceImpl()
val result = resourceAssignmentValidator.validate(assignments!!)
Assert.assertTrue("Failed to Validate", result)
}
@@ -52,7 +52,7 @@ class ResourceAssignmentValidationServiceTest { fun testValidateDuplicate() {
log.info(" **************** testValidateDuplicate *****************")
val assignments = JacksonUtils.getListFromClassPathFile("validation/duplicate.json", ResourceAssignment::class.java)
- val resourceAssignmentValidator = ResourceAssignmentValidationDefaultService()
+ val resourceAssignmentValidator = ResourceAssignmentValidationServiceImpl()
resourceAssignmentValidator.validate(assignments!!)
}
@@ -60,7 +60,7 @@ class ResourceAssignmentValidationServiceTest { fun testValidateCyclic() {
log.info(" **************** testValidateCyclic *****************")
val assignments = JacksonUtils.getListFromClassPathFile("validation/cyclic.json", ResourceAssignment::class.java)
- val resourceAssignmentValidator = ResourceAssignmentValidationDefaultService()
+ val resourceAssignmentValidator = ResourceAssignmentValidationServiceImpl()
resourceAssignmentValidator.validate(assignments!!)
}
}
\ No newline at end of file diff --git a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java index ef305627..2b68585f 100644 --- a/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java +++ b/components/resource-dict/src/test/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceDefinitionValidationServiceTest.java @@ -49,7 +49,7 @@ public class ResourceDefinitionValidationServiceTest { Assert.assertNotNull("Failed to populate dictionaryDefinition for type", resourceDefinition); ResourceDefinitionValidationService resourceDictionaryValidationService = - new ResourceDefinitionDefaultValidationService(bluePrintRepoFileService); + new ResourceDefinitionValidationServiceImpl(bluePrintRepoFileService); resourceDictionaryValidationService.validate(resourceDefinition); Assert.assertNotNull(String.format("Failed to populate dictionaryDefinition for : %s", fileName), resourceDefinition); } |