1 package org.openecomp.mso.global_tests.asdc;
3 import static org.junit.Assert.*;
6 import java.io.IOException;
7 import java.lang.reflect.Method;
8 import java.net.URISyntaxException;
9 import java.security.NoSuchAlgorithmException;
10 import java.util.HashMap;
11 import java.util.List;
13 import java.util.LinkedList;
15 import org.jboss.arquillian.container.test.api.Deployment;
16 import org.jboss.arquillian.container.test.api.OperateOnDeployment;
17 import org.jboss.arquillian.container.test.api.Testable;
18 import org.jboss.arquillian.junit.Arquillian;
19 import org.jboss.shrinkwrap.api.Archive;
20 import org.jboss.shrinkwrap.api.ShrinkWrap;
21 import org.jboss.shrinkwrap.api.spec.JavaArchive;
22 import org.jboss.shrinkwrap.api.spec.WebArchive;
23 import org.jboss.shrinkwrap.resolver.api.maven.Maven;
24 import org.junit.After;
25 import org.junit.Before;
26 import org.junit.BeforeClass;
27 import org.junit.AfterClass;
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
31 import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;
32 import org.openecomp.sdc.api.notification.IArtifactInfo;
33 import org.openecomp.sdc.api.notification.IResourceInstance;
34 import org.openecomp.mso.asdc.installer.VfModuleMetaData;
35 import org.openecomp.mso.asdc.installer.IVfModuleData;
36 import org.openecomp.sdc.utils.DistributionStatusEnum;
37 import org.openecomp.mso.asdc.client.ASDCConfiguration;
38 import org.openecomp.mso.asdc.client.ASDCController;
39 import org.openecomp.mso.asdc.client.exceptions.ASDCControllerException;
40 import org.openecomp.mso.asdc.client.exceptions.ASDCParametersException;
41 import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException;
42 import org.openecomp.mso.db.catalog.CatalogDatabase;
43 import org.openecomp.mso.db.catalog.beans.HeatEnvironment;
44 import org.openecomp.mso.db.catalog.beans.HeatFiles;
45 import org.openecomp.mso.db.catalog.beans.HeatTemplate;
46 import org.openecomp.mso.db.catalog.beans.Service;
47 import org.openecomp.mso.db.catalog.beans.VfModule;
48 import org.openecomp.mso.db.catalog.beans.VnfResource;
49 import org.openecomp.mso.global_tests.ArquillianPackagerForITCases;
50 import org.openecomp.mso.global_tests.asdc.notif_emulator.DistributionClientEmulator;
51 import org.openecomp.mso.global_tests.asdc.notif_emulator.JsonNotificationData;
53 @RunWith(Arquillian.class)
54 public class ASDCITCase {
57 * Add the resources in the right folder of a jar
58 * @param jar The jarArchive
59 * @param dir The main dir containing things that must be added
60 * @throws Exception In case of issues with the files
62 private static void addFiles(JavaArchive jar, File dir,String destFolder) throws Exception {
64 if (!dir.isDirectory()) {
65 throw new Exception("not a directory");
67 for (File f : dir.listFiles()) {
71 jar.addAsResource(f, destFolder + "/" + f.getName());
74 addFiles(jar, f, destFolder+"/"+f.getName());
79 @Deployment(name="asdc-controller",testable=true)
80 public static Archive<?> createAsdcControllerWarDeployment () throws Exception {
81 System.out.println("Deploying ASDC Controller WAR with additional resources on default server");
83 WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war");
85 // Add the current test class
86 JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar");
88 testclasses.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
90 addFiles(testclasses,new File(Thread.currentThread().getContextClassLoader().getResource("resource-examples/asdc").getFile()),"resource-examples/asdc");
92 System.out.println(testclasses.toString(true));
93 warArchive.addAsLibraries(testclasses);
97 // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml
98 warArchive.addAsLibraries(Maven.resolver()
99 .resolve("org.mockito:mockito-all:1.10.19")
100 .withoutTransitivity ()
103 //warArchive.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
104 //addFiles(warArchive,new File(ASDCITCase.class.getClassLoader().getResource("resource-examples").getPath()),"resource-examples");
106 // Take one war randomly to make arquilian happy
107 Testable.archiveToTest(warArchive);
110 System.out.println(warArchive.toString(true));
116 public static final void waitBeforeStart() throws InterruptedException,
119 NoSuchAlgorithmException {
120 System.out.println("Executing " + ASDCITCase.class.getName());
124 public static final void waitAfterStart() throws InterruptedException,
127 NoSuchAlgorithmException {
128 System.out.println("Waiting 60000ms " + ASDCITCase.class.getName());
133 * Be careful when using that notification fake structure, the UUID of notif artifacts MUST be different.
134 * There is a static Map behind the scene.
136 private JsonNotificationData notifDataWithoutModuleInfo;
137 private DistributionClientEmulator distribClientWithoutModuleInfo;
139 private JsonNotificationData notifDataV1, notifDataV2, notifDataV3, notifDataV4, notifDataV5,notifDataDNS,notifDataVFW;
140 private DistributionClientEmulator distribClientV1, distribClientV2, distribClientV3, distribClientV4, distribClientV5, distribClientV1ForSameNotif, distribClientDNS,distribClientVFW;
144 public final void beforeEachTest() throws IOException {
146 distribClientV1= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
147 distribClientV1ForSameNotif= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
148 notifDataV1 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V1");
150 // This is a duplicate in version 2 of the version 1
151 distribClientV2= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V2");
152 notifDataV2 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V2");
154 distribClientV3= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V3");
155 notifDataV3 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V3");
157 // This is a duplicate in version 4 of the version 3
158 distribClientV4= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V4");
159 notifDataV4 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V4");
161 // This notification is to test the deployment of volume with nested + an artifact not used (should send notification with DEPLOY_ERROR
162 distribClientV5= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V5");
163 notifDataV5 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V5");
166 distribClientWithoutModuleInfo= new DistributionClientEmulator("/resource-examples/asdc/notif-without-modules-metadata");
167 notifDataWithoutModuleInfo = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/notif-without-modules-metadata");
170 distribClientDNS= new DistributionClientEmulator("/resource-examples/asdc/demo-dns-V1");
171 notifDataDNS = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-dns-V1");
174 distribClientVFW= new DistributionClientEmulator("/resource-examples/asdc/demo-vfw-V1");
175 notifDataVFW = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-vfw-V1");
181 @OperateOnDeployment("asdc-controller")
182 public void testNotifWithoutModuleInfo () throws NoSuchAlgorithmException,
185 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
189 ASDCController asdcController = new ASDCController("asdc-controller1", distribClientWithoutModuleInfo);
190 asdcController.initASDC();
191 asdcController.treatNotification(notifDataWithoutModuleInfo);
193 assertTrue(distribClientWithoutModuleInfo.getDistributionMessageReceived().size() > 0);
196 for (IDistributionStatusMessage message:distribClientWithoutModuleInfo.getDistributionMessageReceived()) {
197 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
198 if(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR)) {
202 assertTrue(badDeployment == 3);
204 // Check if something has been recorder in DB, as it should not
205 CatalogDatabase catalogDB = new CatalogDatabase();
207 HeatTemplate heatTemplate = catalogDB.getHeatTemplate("Whot-nimbus-oam_v1.0.yaml", "1.0", "resourceName-1");
208 assertNull(heatTemplate);
211 private void validateVnfResource(JsonNotificationData inputNotification, List<IVfModuleData> moduleList) {
213 CatalogDatabase catalogDB = new CatalogDatabase();
216 for (IResourceInstance resource:inputNotification.getResources()) {
217 VnfResource vnfResourceDB = catalogDB.getVnfResource(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName(), inputNotification.getServiceVersion());
218 assertNotNull(vnfResourceDB);
220 assertTrue(vnfResourceDB.getAsdcUuid().equals(resource.getResourceUUID()));
221 assertTrue(vnfResourceDB.getDescription().equals(inputNotification.getServiceDescription()));
222 assertTrue(vnfResourceDB.getModelInvariantUuid().equals(resource.getResourceInvariantUUID()));
223 assertTrue(vnfResourceDB.getModelVersion().equals(resource.getResourceVersion()));
224 assertTrue(vnfResourceDB.getOrchestrationMode().equals("HEAT"));
225 assertTrue(vnfResourceDB.getVersion().equals(inputNotification.getServiceVersion()));
226 assertTrue(vnfResourceDB.getVnfType().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
227 assertTrue(vnfResourceDB.getModelCustomizationName().equals(resource.getResourceInstanceName()));
228 assertTrue(vnfResourceDB.getModelName().equals(resource.getResourceName()));
229 assertTrue(vnfResourceDB.getServiceModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
231 for (IVfModuleData module:moduleList) {
233 VfModule vfModuleDB = catalogDB.getVfModuleModelName(module.getVfModuleModelName(),inputNotification.getServiceVersion());
234 assertNotNull(vfModuleDB);
235 assertTrue(module.getVfModuleModelName().equals(vfModuleDB.getModelName()));
237 assertTrue((inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()+"::"+vfModuleDB.getModelName()).equals(vfModuleDB.getType()));
238 assertTrue(vnfResourceDB.getId()!=0);
239 assertNotNull(vfModuleDB.getVnfResourceId());
241 assertTrue(vnfResourceDB.getId()==vfModuleDB.getVnfResourceId().intValue());
243 for (String artifactUUID:module.getArtifacts()) {
244 IArtifactInfo artifact = null;
245 for (IArtifactInfo artifactTemp:resource.getArtifacts()) {
246 if (artifactTemp.getArtifactUUID().equals(artifactUUID)) {
247 artifact = artifactTemp;
251 assertNotNull(artifact);
253 switch (artifact.getArtifactType()) {
254 case ASDCConfiguration.HEAT:
255 HeatTemplate heatTemplateDB= catalogDB.getHeatTemplate(vfModuleDB.getTemplateId());
256 assertNotNull(heatTemplateDB);
257 assertTrue(heatTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
258 assertTrue(heatTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
259 assertTrue(heatTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
260 assertTrue(heatTemplateDB.getTemplateBody() != null && !heatTemplateDB.getTemplateBody().isEmpty());
261 assertTrue(heatTemplateDB.getParameters().size()>0);
263 assertTrue(heatTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
265 if (artifact.getArtifactTimeout() != null) {
266 assertTrue(heatTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
268 assertTrue(heatTemplateDB.getTimeoutMinutes()== 240);
270 assertTrue(heatTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
272 assertFalse(heatTemplateDB.getTemplateBody().contains("file:///"));
274 case ASDCConfiguration.HEAT_ENV:
276 HeatEnvironment heatEnvironmentDB = catalogDB.getHeatEnvironment(artifact.getArtifactName(), artifact.getArtifactVersion(), inputNotification.getServiceName()+"/"+resource.getResourceInstanceName());
278 assertNotNull(heatEnvironmentDB);
279 assertTrue((vfModuleDB.getVolEnvironmentId() != null && vfModuleDB.getVolEnvironmentId().intValue() == heatEnvironmentDB.getId())
280 || (vfModuleDB.getEnvironmentId() != null && vfModuleDB.getEnvironmentId() == heatEnvironmentDB.getId()));
282 assertTrue(heatEnvironmentDB.getAsdcResourceName().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
284 assertTrue(heatEnvironmentDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
285 assertTrue(heatEnvironmentDB.getDescription().equals(artifact.getArtifactDescription()));
286 assertTrue(heatEnvironmentDB.getVersion().equals(artifact.getArtifactVersion()));
287 assertTrue(heatEnvironmentDB.getName().equals(artifact.getArtifactName()));
288 assertTrue(heatEnvironmentDB.getEnvironment() != null);
289 assertFalse(heatEnvironmentDB.getEnvironment().contains("file:///"));
292 case ASDCConfiguration.HEAT_NESTED:
293 Map<String,Object> listNestedDBMainHeat=new HashMap<String,Object>();
294 Map<String,Object> listNestedDBVolHeat=new HashMap<String,Object>();
296 if (vfModuleDB.getTemplateId() != null) {
297 listNestedDBMainHeat = catalogDB.getNestedTemplates(vfModuleDB.getTemplateId());
299 if (vfModuleDB.getVolTemplateId() != null) {
300 listNestedDBVolHeat = catalogDB.getNestedTemplates(vfModuleDB.getVolTemplateId());
303 assertTrue(listNestedDBMainHeat.size() > 0 || listNestedDBVolHeat.size() > 0);
306 assertTrue(listNestedDBMainHeat.get(artifact.getArtifactName()) != null
307 || listNestedDBVolHeat.get(artifact.getArtifactName()) != null);
309 HeatTemplate rightNestedTemplateDB = catalogDB.getHeatTemplate(artifact.getArtifactName(), artifact.getArtifactVersion(), resource.getResourceName());
310 assertNotNull(rightNestedTemplateDB);
311 assertTrue(catalogDB.getNestedHeatTemplate(vfModuleDB.getTemplateId(), rightNestedTemplateDB.getId()) != null || catalogDB.getNestedHeatTemplate(vfModuleDB.getVolTemplateId(), rightNestedTemplateDB.getId()) != null);
313 assertTrue(rightNestedTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
314 assertTrue(rightNestedTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
315 assertTrue(rightNestedTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
316 assertTrue(rightNestedTemplateDB.getTemplateBody() != null && !rightNestedTemplateDB.getTemplateBody().isEmpty());
317 assertTrue(rightNestedTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
319 if (artifact.getArtifactTimeout() != null) {
320 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
322 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== 240);
324 assertTrue(rightNestedTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
325 assertFalse(rightNestedTemplateDB.getTemplateBody().contains("file:///"));
328 case ASDCConfiguration.HEAT_VOL:
329 HeatTemplate heatTemplateVolDB = catalogDB.getHeatTemplate(vfModuleDB.getVolTemplateId());
330 assertNotNull(heatTemplateVolDB);
332 assertTrue(heatTemplateVolDB.getAsdcResourceName().equals(resource.getResourceName()));
333 assertTrue(heatTemplateVolDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
334 assertTrue(heatTemplateVolDB.getDescription().equals(artifact.getArtifactDescription()));
335 assertTrue(heatTemplateVolDB.getTemplateBody() != null && !heatTemplateVolDB.getTemplateBody().isEmpty());
336 assertTrue(heatTemplateVolDB.getTemplateName().equals(artifact.getArtifactName()));
338 if (artifact.getArtifactTimeout() != null) {
339 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
341 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== 240);
343 assertTrue(heatTemplateVolDB.getVersion().equals(artifact.getArtifactVersion()));
344 assertFalse(heatTemplateVolDB.getTemplateBody().contains("file:///"));
347 case ASDCConfiguration.HEAT_ARTIFACT:
348 Map<String,HeatFiles> heatFilesDB= catalogDB.getHeatFilesForVfModule(vfModuleDB.getId());
349 assertTrue(heatFilesDB.size()>0);
350 HeatFiles rightHeatFilesDB=heatFilesDB.get( artifact.getArtifactName());
351 assertNotNull(rightHeatFilesDB);
353 assertTrue(rightHeatFilesDB.getAsdcResourceName().equals(resource.getResourceName()));
354 assertTrue(rightHeatFilesDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
355 assertTrue(rightHeatFilesDB.getDescription().equals(artifact.getArtifactDescription()));
356 assertTrue(rightHeatFilesDB.getFileBody() != null && !rightHeatFilesDB.getFileBody().isEmpty());
357 assertTrue(rightHeatFilesDB.getFileName().equals( artifact.getArtifactName()));
358 assertTrue(rightHeatFilesDB.getVersion().equals(artifact.getArtifactVersion()));
371 Service service = catalogDB.getServiceByUUID(inputNotification.getServiceUUID());
372 assertNotNull(service);
373 assertTrue(service.getCreated() !=null && service.getCreated().getTime()>0);
374 assertTrue(service.getDescription().equals(inputNotification.getServiceDescription()));
375 assertTrue(service.getId()>0);
376 assertTrue(service.getModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
377 assertTrue(service.getServiceName().equals(inputNotification.getServiceName()));
378 assertTrue(service.getServiceNameVersionId().equals(inputNotification.getServiceUUID()));
379 assertTrue(service.getVersion().equals(inputNotification.getServiceVersion()));
384 @OperateOnDeployment("asdc-controller")
385 public void testNotifsDeployment () throws NoSuchAlgorithmException,
388 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
392 ASDCController asdcControllerV1 = new ASDCController("asdc-controller1", distribClientV1);
393 asdcControllerV1.initASDC();
394 asdcControllerV1.treatNotification(notifDataV1);
396 assertTrue(distribClientV1.getDistributionMessageReceived().size() > 0);
397 for (IDistributionStatusMessage message:distribClientV1.getDistributionMessageReceived()) {
398 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
399 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
402 this.validateVnfResource(notifDataV1,distribClientV1.getListVFModuleMetaData());
406 // Try again to load the same notif
407 ASDCController asdcControllerNewNotif = new ASDCController("asdc-controller1", distribClientV1ForSameNotif);
408 asdcControllerNewNotif.initASDC();
409 asdcControllerNewNotif.treatNotification(notifDataV1);
411 for (IDistributionStatusMessage message:distribClientV1ForSameNotif.getDistributionMessageReceived()) {
412 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
413 assertTrue(message.getStatus().equals(DistributionStatusEnum.ALREADY_DEPLOYED) || message.getStatus().equals(DistributionStatusEnum.ALREADY_DOWNLOADED));
417 // Try again to load same notif but in V2
418 ASDCController asdcControllerV2 = new ASDCController("asdc-controller1", distribClientV2);
419 asdcControllerV2.initASDC();
420 asdcControllerV2.treatNotification(notifDataV2);
422 for (IDistributionStatusMessage message:distribClientV2.getDistributionMessageReceived()) {
423 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
424 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
427 this.validateVnfResource(notifDataV2,distribClientV2.getListVFModuleMetaData());
430 // Try again to load same notif + Script + Volume artifacts and in service V3
431 ASDCController asdcControllerV3 = new ASDCController("asdc-controller1", distribClientV3);
432 asdcControllerV3.initASDC();
433 asdcControllerV3.treatNotification(notifDataV3);
435 for (IDistributionStatusMessage message:distribClientV3.getDistributionMessageReceived()) {
436 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
437 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
440 this.validateVnfResource(notifDataV3,distribClientV3.getListVFModuleMetaData());
442 // Try again to load same notif + Script + Volume artifacts and in service V4
443 ASDCController asdcControllerV4 = new ASDCController("asdc-controller1", distribClientV4);
444 asdcControllerV4.initASDC();
445 asdcControllerV4.treatNotification(notifDataV4);
447 for (IDistributionStatusMessage message:distribClientV4.getDistributionMessageReceived()) {
448 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
449 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
452 this.validateVnfResource(notifDataV4,distribClientV4.getListVFModuleMetaData());
455 // Try again with service V5 (Nested template attached to Volume + HEat artifact not used by module),
456 //this should force the notification DEPLOY_ERROR to be sent for this artifact
457 ASDCController asdcControllerV5 = new ASDCController("asdc-controller1", distribClientV5);
458 asdcControllerV5.initASDC();
459 asdcControllerV5.treatNotification(notifDataV5);
461 for (IDistributionStatusMessage message:distribClientV5.getDistributionMessageReceived()) {
462 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
463 if ("cloud-nimbus.sh".equals(message.getArtifactURL())) {
464 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
466 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
470 this.validateVnfResource(notifDataV5,distribClientV5.getListVFModuleMetaData());
473 // Try again with demo DNS
474 ASDCController asdcControllerDNS = new ASDCController("asdc-controller1", distribClientDNS);
475 asdcControllerDNS.initASDC();
476 asdcControllerDNS.treatNotification(notifDataDNS);
478 for (IDistributionStatusMessage message:distribClientDNS.getDistributionMessageReceived()) {
479 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
480 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
483 this.validateVnfResource(notifDataDNS,distribClientDNS.getListVFModuleMetaData());
485 // Try again with demo VFW
486 ASDCController asdcControllerVFW = new ASDCController("asdc-controller1", distribClientVFW);
487 asdcControllerVFW.initASDC();
488 asdcControllerVFW.treatNotification(notifDataVFW);
490 for (IDistributionStatusMessage message : distribClientVFW.getDistributionMessageReceived()) {
491 System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name());
492 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK)
493 || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
496 this.validateVnfResource(notifDataVFW, distribClientVFW.getListVFModuleMetaData());