summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/service/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-21 15:56:38 -0400
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-22 11:42:42 -0400
commitb86beb3f274449b7b6a50c1ed1e141d7d5704b5f (patch)
treee1862836d411fc77f1a02b331ced1ed76fe87c62 /ms/controllerblueprints/modules/service/src
parent663217341fafeea16541958b8b70c270e1270965 (diff)
Add workflow output resolution
Change-Id: I3d5bb339fd07257e86ada85e4a30040183808848 Issue-ID: CCSDK-1175 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints/modules/service/src')
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtils.kt2
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt14
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/service/utils/BluePrintEnhancerUtilsTest.kt2
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() {