...
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright © 2020 Bell Canada ~ ~ 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.ccsdk.cds.blueprintsprocessor<components.cba</groupId> <artifactId>test-blueprint-kotlin-parent</artifactId> <version>1.01.0-SNAPSHOT</version> </parent> <artifactId>test-kotlin-script</artifactId> <version>1.01.0-SNAPSHOT</version> <packaging>pom</packaging> <properties> <!-- Properties for -Pdeploy-cba --> <cds.username>ccsdkapps</cds.username> <cds.password>ccsdkapps</cds.password> <!-- DEFAULTS <cds.protocol>http</cds.protocol> <cds.host>localhost</cds.host> <cds.port>8081</cds.port> <cds.enrich.endpoint>api/v1/blueprint-model/enrich</cds.enrich.endpoint> <cds.publish.endpoint>api/v1/blueprint-model/publish</cds.publish.endpoint> --> </properties> </project> |
...
Kotlin unit tests should be added under /Tests/kotlin as show above. Test files must contain "Test" in the filename, for example ScriptTest.kt or TestScript.kt
Example project:view-file
Libraries:
...
Create a new empty project
Give it a name
Click the + symbol and select import module
Select the pom.xml in your CBA directory
You should now be able to write, run and debug unit tests
CDS Runtime debuging
...
Open File → Project Structure
Click the + symbol and select Import Module
Select pom.xml in the CDS root directory
You should now have both your CBA and CDS as modules in the project
Make sure your cds run configuration is setup properly and then start CDS in debug mode
Right-click your cba package and select Open In Terminal
Make sure your cds properties are correct in your CBA pom.xml, then run the below command in the terminal
Code Block | ||
---|---|---|
| ||
mvn clean install -Pdeploy-cba |
Maven will enrich and deploy your CBA to CDS
You should now be able to place breakpoints in your script
Send your request to CDS and start debugging