aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/application/src/test/resources/logback-test.xml (renamed from ms/controllerblueprints/application/src/test/resources/logback.xml)70
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/TopologicalSortingUtilsTest.kt14
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/logback-test.xml31
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ModelTypeLoadService.kt2
-rw-r--r--ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/load/ResourceDictionaryLoadService.kt11
-rw-r--r--ms/controllerblueprints/modules/service/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintEnhancerServiceImplTest.kt17
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/logback-test.xml (renamed from ms/controllerblueprints/modules/service/src/test/resources/logback.xml)9
7 files changed, 100 insertions, 54 deletions
diff --git a/ms/controllerblueprints/application/src/test/resources/logback.xml b/ms/controllerblueprints/application/src/test/resources/logback-test.xml
index 55b008d11..2252939e7 100644
--- a/ms/controllerblueprints/application/src/test/resources/logback.xml
+++ b/ms/controllerblueprints/application/src/test/resources/logback-test.xml
@@ -1,35 +1,35 @@
-<!--
- ~ Copyright © 2017-2018 AT&T Intellectual Property.
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<configuration>
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <!-- encoders are assigned the type
- ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
- <encoder>
- <pattern>%d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n</pattern>
- </encoder>
- </appender>
-
-
- <logger name="org.springframework" level="warn"/>
- <logger name="org.hibernate" level="info"/>
- <logger name="org.onap.ccsdk.cds.controllerblueprints" level="info"/>
-
- <root level="warn">
- <appender-ref ref="STDOUT"/>
- </root>
-
-</configuration>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{50} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+
+ <logger name="org.springframework" level="warn"/>
+ <logger name="org.hibernate" level="info"/>
+ <logger name="org.onap.ccsdk.cds.controllerblueprints" level="info"/>
+
+ <root level="warn">
+ <appender-ref ref="STDOUT"/>
+ </root>
+
+</configuration>
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/TopologicalSortingUtilsTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/TopologicalSortingUtilsTest.kt
index 08b77bd4e..5da43484c 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/TopologicalSortingUtilsTest.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/TopologicalSortingUtilsTest.kt
@@ -17,20 +17,22 @@
package org.onap.ccsdk.cds.controllerblueprints.core.utils
import org.junit.Test
+import org.slf4j.LoggerFactory
class TopologicalSortingUtilsTest {
-
+
+ private val log = LoggerFactory.getLogger(TopologicalSortingUtilsTest::class.java)
@Test
- fun testSorting(): Unit {
+ fun testSorting() {
val graph: TopologicalSortingUtils<String> = TopologicalSortingUtils()
graph.add("bundle-id", "bundle-mac")
graph.add("bundle-id", "bundle-ip")
graph.add("bundle-mac", "bundle-ip")
graph.add("bundle-ip", "bundle-mac")
- println("The current graph: " + graph)
- println("In-degrees: " + graph.inDegree())
- println("Out-degrees: " + graph.outDegree())
- println("A topological sort of the vertices: " + graph.topSort())
+ log.debug("The current graph: $graph")
+ log.debug("In-degrees: " + graph.inDegree())
+ log.debug("Out-degrees: " + graph.outDegree())
+ log.debug("A topological sort of the vertices: " + graph.topSort())
}
} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/logback-test.xml b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/logback-test.xml
new file mode 100644
index 000000000..83e0bc674
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/logback-test.xml
@@ -0,0 +1,31 @@
+<!--
+ ~ Copyright © 2019 IBM.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <!-- encoders are assigned the type
+ ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
+ <encoder>
+ <pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{50} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+ <logger name="org.onap.ccsdk.cds.controllerblueprints" level="info"/>
+ <root level="info">
+ <appender-ref ref="STDOUT"/>
+ </root>
+
+</configuration>
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<String>) {
- 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,21 +55,30 @@ 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<String> = 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() {
val basePath = "./../../../../components/model-catalog/blueprint-model/test-blueprint/golden"
testComponentInvokeEnhancementAndValidation(basePath, "golden-enhance")
@@ -96,7 +105,7 @@ class BluePrintEnhancerServiceImplTest {
val valid = bluePrintValidatorService.validateBluePrints(targetPath)
Assert.assertTrue("blueprint($basePath) validation failed ", valid)
- deleteDir(targetPath)
+// deleteDir(targetPath)
}
}
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/logback.xml b/ms/controllerblueprints/modules/service/src/test/resources/logback-test.xml
index e66127977..feb4514d6 100644
--- a/ms/controllerblueprints/modules/service/src/test/resources/logback.xml
+++ b/ms/controllerblueprints/modules/service/src/test/resources/logback-test.xml
@@ -17,13 +17,11 @@
<configuration>
- <property name="localPattern" value="[%-8thread] %d{HH:mm:ss.SSS} %-5level %logger{50} - %msg%n" />
-
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
- <pattern>${localPattern}</pattern>
+ <pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{50} - %msg%n</pattern>
</encoder>
</appender>
@@ -31,7 +29,8 @@
<logger name="org.springframework" level="warn"/>
<logger name="org.springframework.web" level="warn"/>
<logger name="org.hibernate" level="error"/>
- <logger name="org.onap.ccsdk.cds" level="info"/>
+ <logger name="org.onap.ccsdk.cds.controllerblueprints.core" level="warn"/>
+ <logger name="org.onap.ccsdk.cds.controllerblueprints" level="info"/>
<root level="warn">
<appender-ref ref="STDOUT"/>