From fa5e73e47a1bf8c1c18bba7ac421e5692ba21b8e Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 29 Mar 2019 09:42:26 -0400 Subject: Update vFW CBA for Dublin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2308aa6b86a44c05240c0ac54050423a99a14128 Issue-ID: CCSDK-1149 Signed-off-by: Alexis de Talhouët --- .../service/load/ModelTypeLoadService.kt | 2 +- .../service/load/ResourceDictionaryLoadService.kt | 11 ++++++++--- .../enhancer/BluePrintEnhancerServiceImplTest.kt | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) (limited to 'ms/controllerblueprints') diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ModelTypeLoadService.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ModelTypeLoadService.kt index f7875efde..0fd30f206 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ModelTypeLoadService.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ModelTypeLoadService.kt @@ -50,7 +50,7 @@ open class ModelTypeLoadService(private val modelTypeHandler: ModelTypeHandler) * Load the Model Type file content from the defined path, Load of sequencing should be maintained. */ open suspend fun loadPathModelType(modelTypePath: String) { - log.info(" *************************** loadModelType **********************") + log.info(" ****** loadModelType($modelTypePath) ********") try { val errorBuilder = StrBuilder() diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ResourceDictionaryLoadService.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ResourceDictionaryLoadService.kt index ce979f60e..25db333a0 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ResourceDictionaryLoadService.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ResourceDictionaryLoadService.kt @@ -39,13 +39,18 @@ open class ResourceDictionaryLoadService(private val resourceDictionaryHandler: private val log = LoggerFactory.getLogger(ResourceDictionaryLoadService::class.java) open suspend fun loadPathsResourceDictionary(paths: List) { - paths.forEach { - loadPathResourceDictionary(it) + coroutineScope { + val deferred = paths.map { + async { + loadPathResourceDictionary(it) + } + } + deferred.awaitAll() } } open suspend fun loadPathResourceDictionary(path: String) { - log.info(" *************************** loadResourceDictionary **********************") + log.info(" ******* loadResourceDictionary($path) ********") val files = normalizedFile(path).listFiles() val errorBuilder = StrBuilder() diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt index 23c541d76..e82ffc458 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt +++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt @@ -55,19 +55,28 @@ class BluePrintEnhancerServiceImplTest { fun init() { runBlocking { modelTypeLoadService.loadPathModelType("./../../../../components/model-catalog/definition-type/starter-type") - resourceDictionaryLoadService.loadPathResourceDictionary("./../../../../components/model-catalog/resource-dictionary/starter-dictionary") - resourceDictionaryLoadService.loadPathResourceDictionary("./../../../../components/model-catalog/resource-dictionary/test-dictionary") + + val dictPaths: MutableList = arrayListOf() + dictPaths.add("./../../../../components/model-catalog/resource-dictionary/starter-dictionary") + dictPaths.add("./../../../../components/model-catalog/resource-dictionary/test-dictionary") + resourceDictionaryLoadService.loadPathsResourceDictionary(dictPaths) } } @Test @Throws(Exception::class) fun testEnhancementAndValidation() { - val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" testComponentInvokeEnhancementAndValidation(basePath, "base-enhance") } + @Test + @Throws(Exception::class) + fun testVFWEnhancementAndValidation() { + val basePath = "./../../../../components/model-catalog/blueprint-model/service-blueprint/vFW" + testComponentInvokeEnhancementAndValidation(basePath, "vFW-enhance") + } + @Test @Throws(Exception::class) fun testGoldenEnhancementAndValidation() { @@ -96,7 +105,7 @@ class BluePrintEnhancerServiceImplTest { val valid = bluePrintValidatorService.validateBluePrints(targetPath) Assert.assertTrue("blueprint($basePath) validation failed ", valid) - deleteDir(targetPath) +// deleteDir(targetPath) } } -- cgit 1.2.3-korg