summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-21 18:27:38 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-22 09:23:52 +0100
commit350b41105138242190f0dd42396721a0195e04d2 (patch)
tree71a9b162716b86089dbee0f998270a3fbd5664fd /src/test
parentf319e58261ac33b4c08d72b428ee3a9b8da82e79 (diff)
Rework of the csarinstaller
Csarinstaller rework to save Template and Model to database Issue-ID: CLAMP-81 Change-Id: I5edf9716146975ed3751a93b78f5c9b0b9ff2af9 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java10
-rw-r--r--src/test/resources/clds/blueprint-parser-mapping.json2
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/holmes.yaml7
-rw-r--r--src/test/resources/example/sdc/blueprint-dcae/tca.yaml24
4 files changed, 41 insertions, 2 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
index 94adfafa8..6ae64ef7d 100644
--- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java
@@ -38,6 +38,7 @@ import org.mockito.Mockito;
import org.onap.clamp.clds.dao.CldsDao;
import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
+import org.onap.clamp.clds.model.CldsModel;
import org.onap.clamp.clds.model.CldsTemplate;
import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller;
@@ -90,7 +91,7 @@ public class CsarInstallerItCase {
Mockito.when(csarHelper.getServiceMetadata()).thenReturn(data);
Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(csarHelper);
csarInstaller.installTheCsar(csarHandler);
- // Get it back from DB
+ // Get the template back from DB
CldsTemplate templateFromDB = CldsTemplate.retrieve(cldsDao,
generatedName + CsarInstallerImpl.TEMPLATE_NAME_SUFFIX, false);
assertNotNull(templateFromDB);
@@ -98,5 +99,12 @@ public class CsarInstallerItCase {
assertNotNull(templateFromDB.getImageText());
assertNotNull(templateFromDB.getPropText());
assertEquals(templateFromDB.getName(), generatedName + CsarInstallerImpl.TEMPLATE_NAME_SUFFIX);
+ // Get the Model back from DB
+ CldsModel modelFromDB = CldsModel.retrieve(cldsDao, generatedName + CsarInstallerImpl.MODEL_NAME_SUFFIX, false);
+ assertNotNull(modelFromDB);
+ assertNotNull(modelFromDB.getBpmnText());
+ assertNotNull(modelFromDB.getImageText());
+ assertNotNull(modelFromDB.getPropText());
+ assertEquals(modelFromDB.getName(), generatedName + CsarInstallerImpl.MODEL_NAME_SUFFIX);
}
}
diff --git a/src/test/resources/clds/blueprint-parser-mapping.json b/src/test/resources/clds/blueprint-parser-mapping.json
index a16ef0cbc..a22e9fcf1 100644
--- a/src/test/resources/clds/blueprint-parser-mapping.json
+++ b/src/test/resources/clds/blueprint-parser-mapping.json
@@ -1,6 +1,7 @@
[
{
"blueprintKey": "tca_",
+ "dcaeDeployable":"true",
"files": {
"bpmnXmlFilePath": "classpath:/clds/templates/bpmn/tca-template.xml",
"svgXmlFilePath": "classpath:/clds/templates/bpmn/tca-img.xml"
@@ -8,6 +9,7 @@
},
{
"blueprintKey": "holmes_",
+ "dcaeDeployable":"false",
"files": {
"bpmnXmlFilePath": "classpath:/clds/templates/bpmn/holmes-template.xml",
"svgXmlFilePath": "classpath:/clds/templates/bpmn/holmes-img.xml"
diff --git a/src/test/resources/example/sdc/blueprint-dcae/holmes.yaml b/src/test/resources/example/sdc/blueprint-dcae/holmes.yaml
index 1277a0243..f180a7df6 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/holmes.yaml
+++ b/src/test/resources/example/sdc/blueprint-dcae/holmes.yaml
@@ -22,6 +22,11 @@ inputs:
topic1_client_role:
type: string
node_templates:
+ policy_0:
+ type: dcae.nodes.policy
+ properties:
+ policy_model: policy.nodes.holmes
+ policy_filter: "DCAE.Config_Holmes.*"
docker_host_host:
type: dcae.nodes.SelectedDockerHost
properties:
@@ -157,6 +162,8 @@ node_templates:
type: dcae.relationships.subscribe_to_events
- target: topic1
type: dcae.relationships.subscribe_to_events
+ - target: policy_0
+ type: dcae.relationships.depends_on
topic0:
type: dcae.nodes.Topic
properties:
diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
index 101dc2c0d..1a756eea9 100644
--- a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
+++ b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml
@@ -9,7 +9,14 @@ inputs:
type: string
service_id:
type: string
+ policy_id:
+ type: string
node_templates:
+ policy_0:
+ type: dcae.nodes.policy
+ properties:
+ policy_id:
+ get_input: policy_id
cdap_host_host:
type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure
properties:
@@ -78,5 +85,20 @@ node_templates:
get_input: service_id
streamname: TCASubscriberOutputStream
relationships:
+ - target: topic0
+ type: dcae.relationships.subscribe_to_events
+ - target: topic1
+ type: dcae.relationships.publish_events
- target: cdap_host_host
- type: dcae.relationships.component_contained_in \ No newline at end of file
+ type: dcae.relationships.component_contained_in
+ - target: policy_0
+ type: dcae.relationships.depends_on
+ topic0:
+ type: dcae.nodes.Topic
+ properties:
+ topic_name: ''
+ topic1:
+ type: dcae.nodes.Topic
+ properties:
+ topic_name: ''
+ \ No newline at end of file