2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.global_tests.asdc;
23 import static org.junit.Assert.*;
26 import java.io.IOException;
27 import java.lang.reflect.Method;
28 import java.net.URISyntaxException;
29 import java.security.NoSuchAlgorithmException;
30 import java.util.HashMap;
31 import java.util.List;
33 import java.util.LinkedList;
35 import org.jboss.arquillian.container.test.api.Deployment;
36 import org.jboss.arquillian.container.test.api.OperateOnDeployment;
37 import org.jboss.arquillian.container.test.api.Testable;
38 import org.jboss.arquillian.junit.Arquillian;
39 import org.jboss.shrinkwrap.api.Archive;
40 import org.jboss.shrinkwrap.api.ShrinkWrap;
41 import org.jboss.shrinkwrap.api.spec.JavaArchive;
42 import org.jboss.shrinkwrap.api.spec.WebArchive;
43 import org.jboss.shrinkwrap.resolver.api.maven.Maven;
44 import org.junit.After;
45 import org.junit.Before;
46 import org.junit.BeforeClass;
47 import org.junit.AfterClass;
48 import org.junit.Test;
49 import org.junit.runner.RunWith;
51 import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;
52 import org.openecomp.sdc.api.notification.IArtifactInfo;
53 import org.openecomp.sdc.api.notification.IResourceInstance;
54 import org.openecomp.mso.asdc.installer.VfModuleMetaData;
55 import org.openecomp.mso.asdc.installer.IVfModuleData;
56 import org.openecomp.sdc.utils.DistributionStatusEnum;
57 import org.openecomp.mso.asdc.client.ASDCConfiguration;
58 import org.openecomp.mso.asdc.client.ASDCController;
59 import org.openecomp.mso.asdc.client.exceptions.ASDCControllerException;
60 import org.openecomp.mso.asdc.client.exceptions.ASDCParametersException;
61 import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException;
62 import org.openecomp.mso.db.catalog.CatalogDatabase;
63 import org.openecomp.mso.db.catalog.beans.HeatEnvironment;
64 import org.openecomp.mso.db.catalog.beans.HeatFiles;
65 import org.openecomp.mso.db.catalog.beans.HeatTemplate;
66 import org.openecomp.mso.db.catalog.beans.Service;
67 import org.openecomp.mso.db.catalog.beans.VfModule;
68 import org.openecomp.mso.db.catalog.beans.VnfResource;
69 import org.openecomp.mso.global_tests.ArquillianPackagerForITCases;
70 import org.openecomp.mso.global_tests.asdc.notif_emulator.DistributionClientEmulator;
71 import org.openecomp.mso.global_tests.asdc.notif_emulator.JsonNotificationData;
73 @RunWith(Arquillian.class)
74 public class ASDCITCase {
77 * Add the resources in the right folder of a jar
78 * @param jar The jarArchive
79 * @param dir The main dir containing things that must be added
80 * @throws Exception In case of issues with the files
82 private static void addFiles(JavaArchive jar, File dir,String destFolder) throws Exception {
84 if (!dir.isDirectory()) {
85 throw new Exception("not a directory");
87 for (File f : dir.listFiles()) {
91 jar.addAsResource(f, destFolder + "/" + f.getName());
94 addFiles(jar, f, destFolder+"/"+f.getName());
99 @Deployment(name="asdc-controller",testable=true)
100 public static Archive<?> createAsdcControllerWarDeployment () throws Exception {
101 System.out.println("Deploying ASDC Controller WAR with additional resources on default server");
103 WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war");
105 // Add the current test class
106 JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar");
108 testclasses.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
110 addFiles(testclasses,new File(Thread.currentThread().getContextClassLoader().getResource("resource-examples/asdc").getFile()),"resource-examples/asdc");
112 System.out.println(testclasses.toString(true));
113 warArchive.addAsLibraries(testclasses);
117 // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml
118 warArchive.addAsLibraries(Maven.resolver()
119 .resolve("org.mockito:mockito-all:1.10.19")
120 .withoutTransitivity ()
123 //warArchive.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
124 //addFiles(warArchive,new File(ASDCITCase.class.getClassLoader().getResource("resource-examples").getPath()),"resource-examples");
126 // Take one war randomly to make arquilian happy
127 Testable.archiveToTest(warArchive);
130 System.out.println(warArchive.toString(true));
136 public static final void waitBeforeStart() throws InterruptedException,
139 NoSuchAlgorithmException {
140 System.out.println("Executing " + ASDCITCase.class.getName());
144 public static final void waitAfterStart() throws InterruptedException,
147 NoSuchAlgorithmException {
148 System.out.println("Waiting 60000ms " + ASDCITCase.class.getName());
153 * Be careful when using that notification fake structure, the UUID of notif artifacts MUST be different.
154 * There is a static Map behind the scene.
156 private JsonNotificationData notifDataWithoutModuleInfo;
157 private DistributionClientEmulator distribClientWithoutModuleInfo;
159 private JsonNotificationData notifDataV1, notifDataV2, notifDataV3, notifDataV4, notifDataV5,notifDataDNS,notifDataVFW;
160 private DistributionClientEmulator distribClientV1, distribClientV2, distribClientV3, distribClientV4, distribClientV5, distribClientV1ForSameNotif, distribClientDNS,distribClientVFW;
164 public final void beforeEachTest() throws IOException {
166 distribClientV1= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
167 distribClientV1ForSameNotif= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
168 notifDataV1 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V1");
170 // This is a duplicate in version 2 of the version 1
171 distribClientV2= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V2");
172 notifDataV2 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V2");
174 distribClientV3= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V3");
175 notifDataV3 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V3");
177 // This is a duplicate in version 4 of the version 3
178 distribClientV4= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V4");
179 notifDataV4 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V4");
181 // This notification is to test the deployment of volume with nested + an artifact not used (should send notification with DEPLOY_ERROR
182 distribClientV5= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V5");
183 notifDataV5 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V5");
186 distribClientWithoutModuleInfo= new DistributionClientEmulator("/resource-examples/asdc/notif-without-modules-metadata");
187 notifDataWithoutModuleInfo = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/notif-without-modules-metadata");
190 distribClientDNS= new DistributionClientEmulator("/resource-examples/asdc/demo-dns-V1");
191 notifDataDNS = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-dns-V1");
194 distribClientVFW= new DistributionClientEmulator("/resource-examples/asdc/demo-vfw-V1");
195 notifDataVFW = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-vfw-V1");
201 @OperateOnDeployment("asdc-controller")
202 public void testNotifWithoutModuleInfo () throws NoSuchAlgorithmException,
205 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
209 ASDCController asdcController = new ASDCController("asdc-controller1", distribClientWithoutModuleInfo);
210 asdcController.initASDC();
211 asdcController.treatNotification(notifDataWithoutModuleInfo);
213 assertTrue(distribClientWithoutModuleInfo.getDistributionMessageReceived().size() > 0);
216 for (IDistributionStatusMessage message:distribClientWithoutModuleInfo.getDistributionMessageReceived()) {
217 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
218 if(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR)) {
222 assertTrue(badDeployment == 3);
224 // Check if something has been recorder in DB, as it should not
225 CatalogDatabase catalogDB = CatalogDatabase.getInstance();
227 HeatTemplate heatTemplate = catalogDB.getHeatTemplate("Whot-nimbus-oam_v1.0.yaml", "1.0", "resourceName-1");
228 assertNull(heatTemplate);
231 private void validateVnfResource(JsonNotificationData inputNotification, List<IVfModuleData> moduleList) {
233 CatalogDatabase catalogDB = CatalogDatabase.getInstance();
236 for (IResourceInstance resource:inputNotification.getResources()) {
237 VnfResource vnfResourceDB = catalogDB.getVnfResource(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName(), inputNotification.getServiceVersion());
238 assertNotNull(vnfResourceDB);
240 //assertTrue(vnfResourceDB.getAsdcUuid().equals(resource.getResourceUUID()));
241 assertTrue(vnfResourceDB.getDescription().equals(inputNotification.getServiceDescription()));
242 assertTrue(vnfResourceDB.getModelInvariantUuid().equals(resource.getResourceInvariantUUID()));
243 assertTrue(vnfResourceDB.getModelVersion().equals(resource.getResourceVersion()));
244 assertTrue(vnfResourceDB.getOrchestrationMode().equals("HEAT"));
245 assertTrue(vnfResourceDB.getVersion().equals(inputNotification.getServiceVersion()));
246 //assertTrue(vnfResourceDB.getVnfType().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
247 //assertTrue(vnfResourceDB.getModelCustomizationName().equals(resource.getResourceInstanceName()));
248 assertTrue(vnfResourceDB.getModelName().equals(resource.getResourceName()));
249 //assertTrue(vnfResourceDB.getServiceModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
251 for (IVfModuleData module:moduleList) {
253 VfModule vfModuleDB = catalogDB.getVfModuleModelName(module.getVfModuleModelName(),inputNotification.getServiceVersion());
254 assertNotNull(vfModuleDB);
255 assertTrue(module.getVfModuleModelName().equals(vfModuleDB.getModelName()));
257 // assertTrue((inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()+"::"+vfModuleDB.getModelName()).equals(vfModuleDB.getType()));
258 // assertTrue(vnfResourceDB.getId()!=0);
259 //assertNotNull(vfModuleDB.getVnfResourceId());
261 // assertTrue(vnfResourceDB.getId()==vfModuleDB.getVnfResourceId().intValue());
263 for (String artifactUUID:module.getArtifacts()) {
264 IArtifactInfo artifact = null;
265 for (IArtifactInfo artifactTemp:resource.getArtifacts()) {
266 if (artifactTemp.getArtifactUUID().equals(artifactUUID)) {
267 artifact = artifactTemp;
271 assertNotNull(artifact);
273 switch (artifact.getArtifactType()) {
274 case ASDCConfiguration.HEAT:
275 HeatTemplate heatTemplateDB= catalogDB.getHeatTemplate(vfModuleDB.getHeatTemplateArtifactUUId());
276 assertNotNull(heatTemplateDB);
277 //assertTrue(heatTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
278 assertTrue(heatTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
279 assertTrue(heatTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
280 assertTrue(heatTemplateDB.getTemplateBody() != null && !heatTemplateDB.getTemplateBody().isEmpty());
281 assertTrue(heatTemplateDB.getParameters().size()>0);
283 assertTrue(heatTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
285 if (artifact.getArtifactTimeout() != null) {
286 assertTrue(heatTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
288 assertTrue(heatTemplateDB.getTimeoutMinutes()== 240);
290 assertTrue(heatTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
292 assertFalse(heatTemplateDB.getTemplateBody().contains("file:///"));
294 case ASDCConfiguration.HEAT_ENV:
296 HeatEnvironment heatEnvironmentDB = catalogDB.getHeatEnvironment(artifact.getArtifactName(), artifact.getArtifactVersion(), inputNotification.getServiceName()+"/"+resource.getResourceInstanceName());
298 assertNotNull(heatEnvironmentDB);
299 // assertTrue((vfModuleDB.getVolEnvironmentId() != null && vfModuleDB.getVolEnvironmentId().intValue() == heatEnvironmentDB.getId())
300 // || (vfModuleDB.getEnvironmentId() != null && vfModuleDB.getEnvironmentId() == heatEnvironmentDB.getId()));
302 // assertTrue(heatEnvironmentDB.getAsdcResourceName().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
304 // assertTrue(heatEnvironmentDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
305 assertTrue(heatEnvironmentDB.getDescription().equals(artifact.getArtifactDescription()));
306 assertTrue(heatEnvironmentDB.getVersion().equals(artifact.getArtifactVersion()));
307 assertTrue(heatEnvironmentDB.getName().equals(artifact.getArtifactName()));
308 assertTrue(heatEnvironmentDB.getEnvironment() != null);
309 assertFalse(heatEnvironmentDB.getEnvironment().contains("file:///"));
312 case ASDCConfiguration.HEAT_NESTED:
313 Map<String,Object> listNestedDBMainHeat=new HashMap<String,Object>();
314 Map<String,Object> listNestedDBVolHeat=new HashMap<String,Object>();
316 if (vfModuleDB.getHeatTemplateArtifactUUId() != null) {
317 listNestedDBMainHeat = catalogDB.getNestedTemplates(vfModuleDB.getHeatTemplateArtifactUUId());
319 if (vfModuleDB.getVolHeatTemplateArtifactUUId() != null) {
320 listNestedDBVolHeat = catalogDB.getNestedTemplates(vfModuleDB.getVolHeatTemplateArtifactUUId());
323 assertTrue(listNestedDBMainHeat.size() > 0 || listNestedDBVolHeat.size() > 0);
326 assertTrue(listNestedDBMainHeat.get(artifact.getArtifactName()) != null
327 || listNestedDBVolHeat.get(artifact.getArtifactName()) != null);
329 HeatTemplate rightNestedTemplateDB = catalogDB.getHeatTemplate(artifact.getArtifactName(), artifact.getArtifactVersion(), resource.getResourceName());
330 assertNotNull(rightNestedTemplateDB);
331 //assertTrue(catalogDB.getNestedHeatTemplate(vfModuleDB.getTemplateId(), rightNestedTemplateDB.getId()) != null || catalogDB.getNestedHeatTemplate(vfModuleDB.getVolTemplateId(), rightNestedTemplateDB.getId()) != null);
333 //assertTrue(rightNestedTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
334 assertTrue(rightNestedTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
335 assertTrue(rightNestedTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
336 assertTrue(rightNestedTemplateDB.getTemplateBody() != null && !rightNestedTemplateDB.getTemplateBody().isEmpty());
337 assertTrue(rightNestedTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
339 if (artifact.getArtifactTimeout() != null) {
340 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
342 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== 240);
344 assertTrue(rightNestedTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
345 assertFalse(rightNestedTemplateDB.getTemplateBody().contains("file:///"));
348 case ASDCConfiguration.HEAT_VOL:
349 HeatTemplate heatTemplateVolDB = catalogDB.getHeatTemplate(vfModuleDB.getVolHeatTemplateArtifactUUId());
350 assertNotNull(heatTemplateVolDB);
352 //assertTrue(heatTemplateVolDB.getAsdcResourceName().equals(resource.getResourceName()));
353 assertTrue(heatTemplateVolDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
354 assertTrue(heatTemplateVolDB.getDescription().equals(artifact.getArtifactDescription()));
355 assertTrue(heatTemplateVolDB.getTemplateBody() != null && !heatTemplateVolDB.getTemplateBody().isEmpty());
356 assertTrue(heatTemplateVolDB.getTemplateName().equals(artifact.getArtifactName()));
358 if (artifact.getArtifactTimeout() != null) {
359 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
361 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== 240);
363 assertTrue(heatTemplateVolDB.getVersion().equals(artifact.getArtifactVersion()));
364 assertFalse(heatTemplateVolDB.getTemplateBody().contains("file:///"));
367 case ASDCConfiguration.HEAT_ARTIFACT:
368 Map<String,HeatFiles> heatFilesDB= catalogDB.getHeatFilesForVfModule(vfModuleDB.getModelUUID());
369 assertTrue(heatFilesDB.size()>0);
370 HeatFiles rightHeatFilesDB=heatFilesDB.get( artifact.getArtifactName());
371 assertNotNull(rightHeatFilesDB);
373 //assertTrue(rightHeatFilesDB.getAsdcResourceName().equals(resource.getResourceName()));
374 assertTrue(rightHeatFilesDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
375 assertTrue(rightHeatFilesDB.getDescription().equals(artifact.getArtifactDescription()));
376 assertTrue(rightHeatFilesDB.getFileBody() != null && !rightHeatFilesDB.getFileBody().isEmpty());
377 assertTrue(rightHeatFilesDB.getFileName().equals( artifact.getArtifactName()));
378 assertTrue(rightHeatFilesDB.getVersion().equals(artifact.getArtifactVersion()));
391 Service service = catalogDB.getServiceByModelUUID(inputNotification.getServiceUUID());
392 assertNotNull(service);
393 assertTrue(service.getCreated() !=null && service.getCreated().getTime()>0);
394 assertTrue(service.getDescription().equals(inputNotification.getServiceDescription()));
395 assertTrue(service.getModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
396 assertTrue(service.getModelName().equals(inputNotification.getServiceName()));
397 assertTrue(service.getModelUUID().equals(inputNotification.getServiceUUID()));
398 assertTrue(service.getVersion().equals(inputNotification.getServiceVersion()));
403 @OperateOnDeployment("asdc-controller")
404 public void testNotifsDeployment () throws NoSuchAlgorithmException,
407 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
411 ASDCController asdcControllerV1 = new ASDCController("asdc-controller1", distribClientV1);
412 asdcControllerV1.initASDC();
413 asdcControllerV1.treatNotification(notifDataV1);
415 assertTrue(distribClientV1.getDistributionMessageReceived().size() > 0);
416 for (IDistributionStatusMessage message:distribClientV1.getDistributionMessageReceived()) {
417 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
418 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
421 this.validateVnfResource(notifDataV1,distribClientV1.getListVFModuleMetaData());
425 // Try again to load the same notif
426 ASDCController asdcControllerNewNotif = new ASDCController("asdc-controller1", distribClientV1ForSameNotif);
427 asdcControllerNewNotif.initASDC();
428 asdcControllerNewNotif.treatNotification(notifDataV1);
430 for (IDistributionStatusMessage message:distribClientV1ForSameNotif.getDistributionMessageReceived()) {
431 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
432 assertTrue(message.getStatus().equals(DistributionStatusEnum.ALREADY_DEPLOYED) || message.getStatus().equals(DistributionStatusEnum.ALREADY_DOWNLOADED));
436 // Try again to load same notif but in V2
437 ASDCController asdcControllerV2 = new ASDCController("asdc-controller1", distribClientV2);
438 asdcControllerV2.initASDC();
439 asdcControllerV2.treatNotification(notifDataV2);
441 for (IDistributionStatusMessage message:distribClientV2.getDistributionMessageReceived()) {
442 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
443 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
446 this.validateVnfResource(notifDataV2,distribClientV2.getListVFModuleMetaData());
449 // Try again to load same notif + Script + Volume artifacts and in service V3
450 ASDCController asdcControllerV3 = new ASDCController("asdc-controller1", distribClientV3);
451 asdcControllerV3.initASDC();
452 asdcControllerV3.treatNotification(notifDataV3);
454 for (IDistributionStatusMessage message:distribClientV3.getDistributionMessageReceived()) {
455 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
456 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
459 this.validateVnfResource(notifDataV3,distribClientV3.getListVFModuleMetaData());
461 // Try again to load same notif + Script + Volume artifacts and in service V4
462 ASDCController asdcControllerV4 = new ASDCController("asdc-controller1", distribClientV4);
463 asdcControllerV4.initASDC();
464 asdcControllerV4.treatNotification(notifDataV4);
466 for (IDistributionStatusMessage message:distribClientV4.getDistributionMessageReceived()) {
467 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
468 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
471 this.validateVnfResource(notifDataV4,distribClientV4.getListVFModuleMetaData());
474 // Try again with service V5 (Nested template attached to Volume + HEat artifact not used by module),
475 //this should force the notification DEPLOY_ERROR to be sent for this artifact
476 ASDCController asdcControllerV5 = new ASDCController("asdc-controller1", distribClientV5);
477 asdcControllerV5.initASDC();
478 asdcControllerV5.treatNotification(notifDataV5);
480 for (IDistributionStatusMessage message:distribClientV5.getDistributionMessageReceived()) {
481 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
482 if ("cloud-nimbus.sh".equals(message.getArtifactURL())) {
483 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
485 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
489 this.validateVnfResource(notifDataV5,distribClientV5.getListVFModuleMetaData());
492 // Try again with demo DNS
493 ASDCController asdcControllerDNS = new ASDCController("asdc-controller1", distribClientDNS);
494 asdcControllerDNS.initASDC();
495 asdcControllerDNS.treatNotification(notifDataDNS);
497 for (IDistributionStatusMessage message:distribClientDNS.getDistributionMessageReceived()) {
498 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
499 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
502 this.validateVnfResource(notifDataDNS,distribClientDNS.getListVFModuleMetaData());
504 // Try again with demo VFW
505 ASDCController asdcControllerVFW = new ASDCController("asdc-controller1", distribClientVFW);
506 asdcControllerVFW.initASDC();
507 asdcControllerVFW.treatNotification(notifDataVFW);
509 for (IDistributionStatusMessage message : distribClientVFW.getDistributionMessageReceived()) {
510 System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name());
511 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK)
512 || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
515 this.validateVnfResource(notifDataVFW, distribClientVFW.getListVFModuleMetaData());