diff options
author | Dan Timoney <dtimoney@att.com> | 2019-03-22 16:07:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-22 16:07:47 +0000 |
commit | ef6983b670796becfa66c69075c1829e8f9aef4b (patch) | |
tree | c99422a32a6a035c83d8f2b8312ca65d1adeb5e5 /ms/controllerblueprints/modules/service | |
parent | 4a4f175d15ac9db708f584822587b5fb5aec47d2 (diff) | |
parent | b86beb3f274449b7b6a50c1ed1e141d7d5704b5f (diff) |
Merge "Add workflow output resolution"
Diffstat (limited to 'ms/controllerblueprints/modules/service')
3 files changed, 8 insertions, 10 deletions
diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt index cf1bfb57..41a7bf8a 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt @@ -103,7 +103,7 @@ class BluePrintEnhancerUtils { suspend fun decompressFilePart(filePart: FilePart, archiveDir: String, enhanceDir: String): File { val filePartFile = extractCompressFilePart(filePart, archiveDir, enhanceDir) - val deCompressFileName = Paths.get(enhanceDir).toUri().path + val deCompressFileName = normalizedPathName(enhanceDir) return filePartFile.deCompress(deCompressFileName) } diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt index 74f225a5..62a37bef 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt +++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt @@ -23,16 +23,16 @@ import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.apps.controllerblueprints.TestApplication +import org.onap.ccsdk.apps.controllerblueprints.core.deleteDir import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintEnhancerService import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService +import org.onap.ccsdk.apps.controllerblueprints.core.normalizedPathName import org.onap.ccsdk.apps.controllerblueprints.service.load.ModelTypeLoadService import org.onap.ccsdk.apps.controllerblueprints.service.load.ResourceDictionaryLoadService import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner -import java.io.File -import java.nio.file.Paths @RunWith(SpringRunner::class) @ContextConfiguration(classes = arrayOf(TestApplication::class)) @@ -92,9 +92,9 @@ class BluePrintEnhancerServiceImplTest { private fun testComponentInvokeEnhancementAndValidation(basePath: String, targetDirName: String) { runBlocking { - val targetPath = Paths.get("target", targetDirName).toUri().path + val targetPath = normalizedPathName("target/blueprints/enrichment", targetDirName) - deleteTargetDirectory(targetPath) + deleteDir(targetPath) val bluePrintContext = bluePrintEnhancerService.enhance(basePath, targetPath) Assert.assertNotNull("failed to get blueprintContext ", bluePrintContext) @@ -102,12 +102,10 @@ class BluePrintEnhancerServiceImplTest { // Validate the Generated BluePrints val valid = bluePrintValidatorService.validateBluePrints(targetPath) Assert.assertTrue("blueprint($basePath) validation failed ", valid) + + deleteDir(targetPath) } } - private fun deleteTargetDirectory(targetPath: String) { - val targetDirectory = File(targetPath) - targetDirectory.deleteRecursively() - } }
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt index 026561e1..6bd10525 100644 --- a/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt +++ b/ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt @@ -31,7 +31,7 @@ class BluePrintEnhancerUtilsTest { private val blueprintDir = "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration" private val blueprintArchivePath: String = "./target/blueprints/archive" private val blueprintEnrichmentPath: String = "./target/blueprints/enrichment" - private var zipBlueprintFileName = Paths.get(blueprintArchivePath, "test.zip").normalize().toUri().path + private var zipBlueprintFileName = normalizedPathName(blueprintArchivePath, "test.zip") @Before fun setUp() { |