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;
14 import org.jboss.arquillian.container.test.api.Deployment;
15 import org.jboss.arquillian.container.test.api.OperateOnDeployment;
16 import org.jboss.arquillian.container.test.api.Testable;
17 import org.jboss.arquillian.junit.Arquillian;
18 import org.jboss.shrinkwrap.api.Archive;
19 import org.jboss.shrinkwrap.api.ShrinkWrap;
20 import org.jboss.shrinkwrap.api.spec.JavaArchive;
21 import org.jboss.shrinkwrap.api.spec.WebArchive;
22 import org.jboss.shrinkwrap.resolver.api.maven.Maven;
23 import org.junit.After;
24 import org.junit.Before;
25 import org.junit.BeforeClass;
26 import org.junit.AfterClass;
27 import org.junit.Test;
28 import org.junit.runner.RunWith;
30 import org.openecomp.sdc.api.consumer.IDistributionStatusMessage;
31 import org.openecomp.sdc.api.notification.IArtifactInfo;
32 import org.openecomp.sdc.api.notification.IResourceInstance;
33 import org.openecomp.sdc.api.notification.IVfModuleMetadata;
34 import org.openecomp.sdc.utils.DistributionStatusEnum;
35 import org.openecomp.mso.asdc.client.ASDCConfiguration;
36 import org.openecomp.mso.asdc.client.ASDCController;
37 import org.openecomp.mso.asdc.client.exceptions.ASDCControllerException;
38 import org.openecomp.mso.asdc.client.exceptions.ASDCParametersException;
39 import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException;
40 import org.openecomp.mso.db.catalog.CatalogDatabase;
41 import org.openecomp.mso.db.catalog.beans.HeatEnvironment;
42 import org.openecomp.mso.db.catalog.beans.HeatFiles;
43 import org.openecomp.mso.db.catalog.beans.HeatTemplate;
44 import org.openecomp.mso.db.catalog.beans.Service;
45 import org.openecomp.mso.db.catalog.beans.VfModule;
46 import org.openecomp.mso.db.catalog.beans.VnfResource;
47 import org.openecomp.mso.global_tests.ArquillianPackagerForITCases;
48 import org.openecomp.mso.global_tests.asdc.notif_emulator.DistributionClientEmulator;
49 import org.openecomp.mso.global_tests.asdc.notif_emulator.JsonNotificationData;
51 @RunWith(Arquillian.class)
52 public class ASDCITCase {
55 * Add the resources in the right folder of a jar
56 * @param jar The jarArchive
57 * @param dir The main dir containing things that must be added
58 * @throws Exception In case of issues with the files
60 private static void addFiles(JavaArchive jar, File dir,String destFolder) throws Exception {
62 if (!dir.isDirectory()) {
63 throw new Exception("not a directory");
65 for (File f : dir.listFiles()) {
69 jar.addAsResource(f, destFolder + "/" + f.getName());
72 addFiles(jar, f, destFolder+"/"+f.getName());
77 @Deployment(name="asdc-controller",testable=true)
78 public static Archive<?> createAsdcControllerWarDeployment () throws Exception {
79 System.out.println("Deploying ASDC Controller WAR with additional resources on default server");
81 WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war");
83 // Add the current test class
84 JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar");
86 testclasses.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
88 addFiles(testclasses,new File(Thread.currentThread().getContextClassLoader().getResource("resource-examples/asdc").getFile()),"resource-examples/asdc");
90 System.out.println(testclasses.toString(true));
91 warArchive.addAsLibraries(testclasses);
95 // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml
96 warArchive.addAsLibraries(Maven.resolver()
97 .resolve("org.mockito:mockito-all:1.10.19")
98 .withoutTransitivity ()
101 //warArchive.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator");
102 //addFiles(warArchive,new File(ASDCITCase.class.getClassLoader().getResource("resource-examples").getPath()),"resource-examples");
104 // Take one war randomly to make arquilian happy
105 Testable.archiveToTest(warArchive);
108 System.out.println(warArchive.toString(true));
114 public static final void waitBeforeStart() throws InterruptedException,
117 NoSuchAlgorithmException {
118 System.out.println("Executing " + ASDCITCase.class.getName());
122 public static final void waitAfterStart() throws InterruptedException,
125 NoSuchAlgorithmException {
126 System.out.println("Waiting 60000ms " + ASDCITCase.class.getName());
131 * Be careful when using that notification fake structure, the UUID of notif artifacts MUST be different.
132 * There is a static Map behind the scene.
134 private JsonNotificationData notifDataWithoutModuleInfo;
135 private DistributionClientEmulator distribClientWithoutModuleInfo;
137 private JsonNotificationData notifDataV1, notifDataV2, notifDataV3, notifDataV4, notifDataV5,notifDataDNS,notifDataVFW;
138 private DistributionClientEmulator distribClientV1, distribClientV2, distribClientV3, distribClientV4, distribClientV5, distribClientV1ForSameNotif, distribClientDNS,distribClientVFW;
142 public final void beforeEachTest() throws IOException {
144 distribClientV1= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
145 distribClientV1ForSameNotif= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1");
146 notifDataV1 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V1");
148 // This is a duplicate in version 2 of the version 1
149 distribClientV2= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V2");
150 notifDataV2 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V2");
152 distribClientV3= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V3");
153 notifDataV3 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V3");
155 // This is a duplicate in version 4 of the version 3
156 distribClientV4= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V4");
157 notifDataV4 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V4");
159 // This notification is to test the deployment of volume with nested + an artifact not used (should send notification with DEPLOY_ERROR
160 distribClientV5= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V5");
161 notifDataV5 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V5");
164 distribClientWithoutModuleInfo= new DistributionClientEmulator("/resource-examples/asdc/notif-without-modules-metadata");
165 notifDataWithoutModuleInfo = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/notif-without-modules-metadata");
168 distribClientDNS= new DistributionClientEmulator("/resource-examples/asdc/demo-dns-V1");
169 notifDataDNS = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-dns-V1");
172 distribClientVFW= new DistributionClientEmulator("/resource-examples/asdc/demo-vfw-V1");
173 notifDataVFW = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-vfw-V1");
179 @OperateOnDeployment("asdc-controller")
180 public void testNotifWithoutModuleInfo () throws NoSuchAlgorithmException,
183 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
187 ASDCController asdcController = new ASDCController("asdc-controller1", distribClientWithoutModuleInfo);
188 asdcController.initASDC();
189 asdcController.treatNotification(notifDataWithoutModuleInfo);
191 assertTrue(distribClientWithoutModuleInfo.getDistributionMessageReceived().size() > 0);
194 for (IDistributionStatusMessage message:distribClientWithoutModuleInfo.getDistributionMessageReceived()) {
195 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
196 if(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR)) {
200 assertTrue(badDeployment == 3);
202 // Check if something has been recorder in DB, as it should not
203 CatalogDatabase catalogDB = new CatalogDatabase();
205 HeatTemplate heatTemplate = catalogDB.getHeatTemplate("Whot-nimbus-oam_v1.0.yaml", "1.0", "resourceName-1");
206 assertNull(heatTemplate);
209 private void validateVnfResource(JsonNotificationData inputNotification,List<IVfModuleMetadata> moduleList) {
211 CatalogDatabase catalogDB = new CatalogDatabase();
214 for (IResourceInstance resource:inputNotification.getResources()) {
215 VnfResource vnfResourceDB = catalogDB.getVnfResource(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName(), inputNotification.getServiceVersion());
216 assertNotNull(vnfResourceDB);
218 assertTrue(vnfResourceDB.getAsdcUuid().equals(resource.getResourceUUID()));
219 assertTrue(vnfResourceDB.getDescription().equals(inputNotification.getServiceDescription()));
220 assertTrue(vnfResourceDB.getModelInvariantUuid().equals(resource.getResourceInvariantUUID()));
221 assertTrue(vnfResourceDB.getModelVersion().equals(resource.getResourceVersion()));
222 assertTrue(vnfResourceDB.getOrchestrationMode().equals("HEAT"));
223 assertTrue(vnfResourceDB.getVersion().equals(inputNotification.getServiceVersion()));
224 assertTrue(vnfResourceDB.getVnfType().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
225 assertTrue(vnfResourceDB.getModelCustomizationName().equals(resource.getResourceInstanceName()));
226 assertTrue(vnfResourceDB.getModelName().equals(resource.getResourceName()));
227 assertTrue(vnfResourceDB.getServiceModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
229 for (IVfModuleMetadata module:moduleList) {
231 VfModule vfModuleDB = catalogDB.getVfModuleModelName(module.getVfModuleModelName(),inputNotification.getServiceVersion());
232 assertNotNull(vfModuleDB);
233 assertTrue(module.getVfModuleModelName().equals(vfModuleDB.getModelName()));
235 assertTrue((inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()+"::"+vfModuleDB.getModelName()).equals(vfModuleDB.getType()));
236 assertTrue(vnfResourceDB.getId()!=0);
237 assertNotNull(vfModuleDB.getVnfResourceId());
239 assertTrue(vnfResourceDB.getId()==vfModuleDB.getVnfResourceId().intValue());
241 for (String artifactUUID:module.getArtifacts()) {
242 IArtifactInfo artifact = null;
243 for (IArtifactInfo artifactTemp:resource.getArtifacts()) {
244 if (artifactTemp.getArtifactUUID().equals(artifactUUID)) {
245 artifact = artifactTemp;
249 assertNotNull(artifact);
251 switch (artifact.getArtifactType()) {
252 case ASDCConfiguration.HEAT:
253 HeatTemplate heatTemplateDB= catalogDB.getHeatTemplate(vfModuleDB.getTemplateId());
254 assertNotNull(heatTemplateDB);
255 assertTrue(heatTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
256 assertTrue(heatTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
257 assertTrue(heatTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
258 assertTrue(heatTemplateDB.getTemplateBody() != null && !heatTemplateDB.getTemplateBody().isEmpty());
259 assertTrue(heatTemplateDB.getParameters().size()>0);
261 assertTrue(heatTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
263 if (artifact.getArtifactTimeout() != null) {
264 assertTrue(heatTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
266 assertTrue(heatTemplateDB.getTimeoutMinutes()== 240);
268 assertTrue(heatTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
270 assertFalse(heatTemplateDB.getTemplateBody().contains("file:///"));
272 case ASDCConfiguration.HEAT_ENV:
274 HeatEnvironment heatEnvironmentDB = catalogDB.getHeatEnvironment(artifact.getArtifactName(), artifact.getArtifactVersion(), inputNotification.getServiceName()+"/"+resource.getResourceInstanceName());
276 assertNotNull(heatEnvironmentDB);
277 assertTrue((vfModuleDB.getVolEnvironmentId() != null && vfModuleDB.getVolEnvironmentId().intValue() == heatEnvironmentDB.getId())
278 || (vfModuleDB.getEnvironmentId() != null && vfModuleDB.getEnvironmentId() == heatEnvironmentDB.getId()));
280 assertTrue(heatEnvironmentDB.getAsdcResourceName().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()));
282 assertTrue(heatEnvironmentDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
283 assertTrue(heatEnvironmentDB.getDescription().equals(artifact.getArtifactDescription()));
284 assertTrue(heatEnvironmentDB.getVersion().equals(artifact.getArtifactVersion()));
285 assertTrue(heatEnvironmentDB.getName().equals(artifact.getArtifactName()));
286 assertTrue(heatEnvironmentDB.getEnvironment() != null);
287 assertFalse(heatEnvironmentDB.getEnvironment().contains("file:///"));
290 case ASDCConfiguration.HEAT_NESTED:
291 Map<String,Object> listNestedDBMainHeat=new HashMap<String,Object>();
292 Map<String,Object> listNestedDBVolHeat=new HashMap<String,Object>();
294 if (vfModuleDB.getTemplateId() != null) {
295 listNestedDBMainHeat = catalogDB.getNestedTemplates(vfModuleDB.getTemplateId());
297 if (vfModuleDB.getVolTemplateId() != null) {
298 listNestedDBVolHeat = catalogDB.getNestedTemplates(vfModuleDB.getVolTemplateId());
301 assertTrue(listNestedDBMainHeat.size() > 0 || listNestedDBVolHeat.size() > 0);
304 assertTrue(listNestedDBMainHeat.get(artifact.getArtifactName()) != null
305 || listNestedDBVolHeat.get(artifact.getArtifactName()) != null);
307 HeatTemplate rightNestedTemplateDB = catalogDB.getHeatTemplate(artifact.getArtifactName(), artifact.getArtifactVersion(), resource.getResourceName());
308 assertNotNull(rightNestedTemplateDB);
309 assertTrue(catalogDB.getNestedHeatTemplate(vfModuleDB.getTemplateId(), rightNestedTemplateDB.getId()) != null || catalogDB.getNestedHeatTemplate(vfModuleDB.getVolTemplateId(), rightNestedTemplateDB.getId()) != null);
311 assertTrue(rightNestedTemplateDB.getAsdcResourceName().equals(resource.getResourceName()));
312 assertTrue(rightNestedTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
313 assertTrue(rightNestedTemplateDB.getDescription().equals(artifact.getArtifactDescription()));
314 assertTrue(rightNestedTemplateDB.getTemplateBody() != null && !rightNestedTemplateDB.getTemplateBody().isEmpty());
315 assertTrue(rightNestedTemplateDB.getTemplateName().equals(artifact.getArtifactName()));
317 if (artifact.getArtifactTimeout() != null) {
318 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
320 assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== 240);
322 assertTrue(rightNestedTemplateDB.getVersion().equals(artifact.getArtifactVersion()));
323 assertFalse(rightNestedTemplateDB.getTemplateBody().contains("file:///"));
326 case ASDCConfiguration.HEAT_VOL:
327 HeatTemplate heatTemplateVolDB = catalogDB.getHeatTemplate(vfModuleDB.getVolTemplateId());
328 assertNotNull(heatTemplateVolDB);
330 assertTrue(heatTemplateVolDB.getAsdcResourceName().equals(resource.getResourceName()));
331 assertTrue(heatTemplateVolDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
332 assertTrue(heatTemplateVolDB.getDescription().equals(artifact.getArtifactDescription()));
333 assertTrue(heatTemplateVolDB.getTemplateBody() != null && !heatTemplateVolDB.getTemplateBody().isEmpty());
334 assertTrue(heatTemplateVolDB.getTemplateName().equals(artifact.getArtifactName()));
336 if (artifact.getArtifactTimeout() != null) {
337 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue());
339 assertTrue(heatTemplateVolDB.getTimeoutMinutes()== 240);
341 assertTrue(heatTemplateVolDB.getVersion().equals(artifact.getArtifactVersion()));
342 assertFalse(heatTemplateVolDB.getTemplateBody().contains("file:///"));
345 case ASDCConfiguration.HEAT_ARTIFACT:
346 Map<String,HeatFiles> heatFilesDB= catalogDB.getHeatFilesForVfModule(vfModuleDB.getId());
347 assertTrue(heatFilesDB.size()>0);
348 HeatFiles rightHeatFilesDB=heatFilesDB.get( artifact.getArtifactName());
349 assertNotNull(rightHeatFilesDB);
351 assertTrue(rightHeatFilesDB.getAsdcResourceName().equals(resource.getResourceName()));
352 assertTrue(rightHeatFilesDB.getAsdcUuid().equals(artifact.getArtifactUUID()));
353 assertTrue(rightHeatFilesDB.getDescription().equals(artifact.getArtifactDescription()));
354 assertTrue(rightHeatFilesDB.getFileBody() != null && !rightHeatFilesDB.getFileBody().isEmpty());
355 assertTrue(rightHeatFilesDB.getFileName().equals( artifact.getArtifactName()));
356 assertTrue(rightHeatFilesDB.getVersion().equals(artifact.getArtifactVersion()));
369 Service service = catalogDB.getServiceByUUID(inputNotification.getServiceUUID());
370 assertNotNull(service);
371 assertTrue(service.getCreated() !=null && service.getCreated().getTime()>0);
372 assertTrue(service.getDescription().equals(inputNotification.getServiceDescription()));
373 assertTrue(service.getId()>0);
374 assertTrue(service.getModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID()));
375 assertTrue(service.getServiceName().equals(inputNotification.getServiceName()));
376 assertTrue(service.getServiceNameVersionId().equals(inputNotification.getServiceUUID()));
377 assertTrue(service.getVersion().equals(inputNotification.getServiceVersion()));
382 @OperateOnDeployment("asdc-controller")
383 public void testNotifsDeployment () throws NoSuchAlgorithmException,
386 ArtifactInstallerException, ASDCControllerException, ASDCParametersException {
390 ASDCController asdcControllerV1 = new ASDCController("asdc-controller1", distribClientV1);
391 asdcControllerV1.initASDC();
392 asdcControllerV1.treatNotification(notifDataV1);
394 assertTrue(distribClientV1.getDistributionMessageReceived().size() > 0);
395 for (IDistributionStatusMessage message:distribClientV1.getDistributionMessageReceived()) {
396 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
397 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
400 this.validateVnfResource(notifDataV1,distribClientV1.getListVFModuleMetaData());
404 // Try again to load the same notif
405 ASDCController asdcControllerNewNotif = new ASDCController("asdc-controller1", distribClientV1ForSameNotif);
406 asdcControllerNewNotif.initASDC();
407 asdcControllerNewNotif.treatNotification(notifDataV1);
409 for (IDistributionStatusMessage message:distribClientV1ForSameNotif.getDistributionMessageReceived()) {
410 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
411 assertTrue(message.getStatus().equals(DistributionStatusEnum.ALREADY_DEPLOYED) || message.getStatus().equals(DistributionStatusEnum.ALREADY_DOWNLOADED));
415 // Try again to load same notif but in V2
416 ASDCController asdcControllerV2 = new ASDCController("asdc-controller1", distribClientV2);
417 asdcControllerV2.initASDC();
418 asdcControllerV2.treatNotification(notifDataV2);
420 for (IDistributionStatusMessage message:distribClientV2.getDistributionMessageReceived()) {
421 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
422 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
425 this.validateVnfResource(notifDataV2,distribClientV2.getListVFModuleMetaData());
428 // Try again to load same notif + Script + Volume artifacts and in service V3
429 ASDCController asdcControllerV3 = new ASDCController("asdc-controller1", distribClientV3);
430 asdcControllerV3.initASDC();
431 asdcControllerV3.treatNotification(notifDataV3);
433 for (IDistributionStatusMessage message:distribClientV3.getDistributionMessageReceived()) {
434 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
435 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
438 this.validateVnfResource(notifDataV3,distribClientV3.getListVFModuleMetaData());
440 // Try again to load same notif + Script + Volume artifacts and in service V4
441 ASDCController asdcControllerV4 = new ASDCController("asdc-controller1", distribClientV4);
442 asdcControllerV4.initASDC();
443 asdcControllerV4.treatNotification(notifDataV4);
445 for (IDistributionStatusMessage message:distribClientV4.getDistributionMessageReceived()) {
446 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
447 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
450 this.validateVnfResource(notifDataV4,distribClientV4.getListVFModuleMetaData());
453 // Try again with service V5 (Nested template attached to Volume + HEat artifact not used by module),
454 //this should force the notification DEPLOY_ERROR to be sent for this artifact
455 ASDCController asdcControllerV5 = new ASDCController("asdc-controller1", distribClientV5);
456 asdcControllerV5.initASDC();
457 asdcControllerV5.treatNotification(notifDataV5);
459 for (IDistributionStatusMessage message:distribClientV5.getDistributionMessageReceived()) {
460 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
461 if ("cloud-nimbus.sh".equals(message.getArtifactURL())) {
462 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
464 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
468 this.validateVnfResource(notifDataV5,distribClientV5.getListVFModuleMetaData());
471 // Try again with demo DNS
472 ASDCController asdcControllerDNS = new ASDCController("asdc-controller1", distribClientDNS);
473 asdcControllerDNS.initASDC();
474 asdcControllerDNS.treatNotification(notifDataDNS);
476 for (IDistributionStatusMessage message:distribClientDNS.getDistributionMessageReceived()) {
477 System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name());
478 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
481 this.validateVnfResource(notifDataDNS,distribClientDNS.getListVFModuleMetaData());
483 // Try again with demo VFW
484 ASDCController asdcControllerVFW = new ASDCController("asdc-controller1", distribClientVFW);
485 asdcControllerVFW.initASDC();
486 asdcControllerVFW.treatNotification(notifDataVFW);
488 for (IDistributionStatusMessage message : distribClientVFW.getDistributionMessageReceived()) {
489 System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name());
490 assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK)
491 || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK));
494 this.validateVnfResource(notifDataVFW, distribClientVFW.getListVFModuleMetaData());