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
commit1f32a2c10bdd5a39fd93221406b8ac5aaaef88f6 (patch)
tree9f2fb2933a37f4157c8755c175f09c834c7c0a66 /ms/controllerblueprints/modules/service/src
parent0e86613ab9cbe5c6b87746bb7bff09fc3a324d0b (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 cf1bfb578..41a7bf8a5 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 74f225a5b..62a37bef1 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 026561e10..6bd10525e 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() {