diff options
author | Rob Daugherty <rd472p@att.com> | 2018-03-09 15:02:18 -0500 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-03-09 15:08:14 -0500 |
commit | 96b5a685d0c3afddb632e4a68ca7483f933b55dc (patch) | |
tree | 246399de05a3d429bf45ef1e5af2b9b0218d99f3 /packages/arquillian-unit-tests/src/test/java | |
parent | 4475278c81668109b2b37a1d2720d8f2910641c4 (diff) |
Revert Reduce log noise/warnings
This reverts commit 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e.
It is seriously impeding our ability complete the promised merge of AT&T
1802 code.
While I'm all for coding standards, if we are serious about using spaces
instead of tabs, then I think we need to (1) agree with the community when
this will happen, (2) do consistently in all files, and (3) enforce it.
Change-Id: Ib9b996f6b6c7d81ac9ac95d58b0c7d8cc39675ff
Issue-ID: SO-368
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'packages/arquillian-unit-tests/src/test/java')
13 files changed, 1181 insertions, 1178 deletions
diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/filesearching/LogFileSearching.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/filesearching/LogFileSearching.java index 89a00cdeb2..fba28ac0fd 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/filesearching/LogFileSearching.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/filesearching/LogFileSearching.java @@ -31,102 +31,102 @@ import java.util.NoSuchElementException; import java.util.Scanner; public class LogFileSearching { - - private static PrintWriter writer; - - public static void initFile(String filePath) { - if (writer == null) { - try { - // This is to reopen an existing file - writer = new PrintWriter(new FileOutputStream(filePath, true)); - } catch (IOException e) { - System.out.println("Exception caught when trying to open the file /tmp/mso-log-checker.log to dump the result"); - e.printStackTrace(); - } - } - } - - public static void closeFile() { - if (writer != null) { - writer.close(); - writer = null; - } - } - - - public static boolean searchInFile(final String needle, final File file) throws FileNotFoundException { - Scanner logScanner = new Scanner(file); - try { - writer.println("Searching pattern " + needle + " in " + file.getAbsolutePath()); - //System.out.println("Searching pattern " + needle + " in " + file.getAbsolutePath()); - - String filedata = logScanner.useDelimiter("\\Z").next(); - - int occurrences = 0; - int index = 0; - - while (index < filedata.length() && (index = filedata.indexOf(needle, index)) >= 0) { - occurrences++; - - int separatorIndex = filedata.indexOf(System.getProperty("line.separator"), index); - if (separatorIndex >= 0) { - writer.println("FOUND:" + filedata.substring(index, separatorIndex)); - //System.out.println("FOUND:" - // + filedata.substring(index, separatorIndex)); - } else { - writer.println("FOUND:" + filedata.substring(index, filedata.length() - 1)); - //System.out.println("FOUND:" - // + filedata.substring(index, filedata.length()-1)); - } - index += needle.length(); - } - writer.println("TOTAL:" + occurrences + " FOUND"); - //System.out.println("TOTAL:" + occurrences + " FOUND"); - if (occurrences > 0) { - - return true; - } else { - - return false; - } - } catch (NoSuchElementException e) { - writer.println("TOTAL:0 FOUND"); - //System.out.println("TOTAL:0 FOUND"); - return false; - } finally { - logScanner.close(); - } - } - - public static boolean searchInDirectory(final String needle, final File directory) throws FileNotFoundException { - - boolean res = false; - String[] dirFiles = directory.list(); - - if (dirFiles != null) { - - for (String dir : dirFiles) { - res = res || searchInDirectory(needle, new File(directory.getAbsolutePath() + "/" + dir)); - } - - } else { - return LogFileSearching.searchInFile(needle, directory); - } - return res; - } - - public static boolean searchInDirectoryForCommonIssues(final String[] needles, final File directory) throws FileNotFoundException { - String[] defaultPatternsToUse = {"ClassNotFound", "NullPointer", "RuntimeException", "IllegalStateException", "FATAL"}; - - if (needles != null && needles.length > 0) { - defaultPatternsToUse = needles; - } - - boolean returnValue = false; - for (String needle : defaultPatternsToUse) { - returnValue |= LogFileSearching.searchInDirectory(needle, directory); - } - - return returnValue; - } + + private static PrintWriter writer; + + public static void initFile(String filePath) { + if (writer == null) { + try { + // This is to reopen an existing file + writer = new PrintWriter(new FileOutputStream(filePath,true)); + } catch ( IOException e) { + System.out.println("Exception caught when trying to open the file /tmp/mso-log-checker.log to dump the result"); + e.printStackTrace(); + } + } + } + + public static void closeFile() { + if (writer != null) { + writer.close(); + writer = null; + } + } + + + public static boolean searchInFile(final String needle, final File file) throws FileNotFoundException { + Scanner logScanner = new Scanner(file); + try { + writer.println("Searching pattern " + needle + " in " + file.getAbsolutePath()); + //System.out.println("Searching pattern " + needle + " in " + file.getAbsolutePath()); + + String filedata = logScanner.useDelimiter("\\Z").next(); + + int occurrences = 0; + int index = 0; + + while (index < filedata.length() && (index = filedata.indexOf(needle, index)) >= 0) { + occurrences++; + + int separatorIndex = filedata.indexOf(System.getProperty("line.separator"), index); + if (separatorIndex >=0){ + writer.println("FOUND:" + filedata.substring(index, separatorIndex)); + //System.out.println("FOUND:" + // + filedata.substring(index, separatorIndex)); + } else { + writer.println("FOUND:" + filedata.substring(index, filedata.length()-1)); + //System.out.println("FOUND:" + // + filedata.substring(index, filedata.length()-1)); + } + index += needle.length(); + } + writer.println("TOTAL:" + occurrences + " FOUND"); + //System.out.println("TOTAL:" + occurrences + " FOUND"); + if (occurrences > 0) { + + return true; + } else { + + return false; + } + } catch (NoSuchElementException e) { + writer.println("TOTAL:0 FOUND"); + //System.out.println("TOTAL:0 FOUND"); + return false; + } finally { + logScanner.close(); + } + } + + public static boolean searchInDirectory(final String needle, final File directory) throws FileNotFoundException { + + boolean res = false; + String[] dirFiles = directory.list(); + + if (dirFiles != null) { + + for (String dir : dirFiles) { + res = res || searchInDirectory(needle, new File(directory.getAbsolutePath() + "/" + dir)); + } + + } else { + return LogFileSearching.searchInFile(needle, directory); + } + return res; + } + + public static boolean searchInDirectoryForCommonIssues(final String[] needles, final File directory) throws FileNotFoundException { + String[] defaultPatternsToUse = {"ClassNotFound","NullPointer","RuntimeException","IllegalStateException","FATAL"}; + + if (needles != null && needles.length>0) { + defaultPatternsToUse=needles; + } + + boolean returnValue=false; + for (String needle:defaultPatternsToUse) { + returnValue |= LogFileSearching.searchInDirectory(needle,directory); + } + + return returnValue; + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/ArquillianPackagerForITCases.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/ArquillianPackagerForITCases.java index 4e86f664d6..200e1d2621 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/ArquillianPackagerForITCases.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/ArquillianPackagerForITCases.java @@ -36,42 +36,42 @@ import org.jboss.shrinkwrap.api.spec.WebArchive; public class ArquillianPackagerForITCases { - public static Archive<?> createPackageFromExistingOne(String path, String globPattern, String newPackageName) { - Path dir = Paths.get(path); + public static Archive<?> createPackageFromExistingOne(String path, String globPattern, String newPackageName) { + Path dir = Paths.get(path); - try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, globPattern)) { - Iterator<Path> it = stream.iterator(); - if (it.hasNext()) { + try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, globPattern)) { + Iterator<Path> it = stream.iterator(); + if (it.hasNext()) { - if (newPackageName.endsWith(".war")) { - File archive = it.next().toFile(); - WebArchive webArchive = ShrinkWrap.create(WebArchive.class, newPackageName); - webArchive.merge((ShrinkWrap.createFromZipFile(WebArchive.class, archive))); - return webArchive; - } else if (newPackageName.endsWith(".jar")) { - File archive = it.next().toFile(); - JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class, newPackageName); - javaArchive.merge((ShrinkWrap.createFromZipFile(JavaArchive.class, archive))); - return javaArchive; - } else if (newPackageName.endsWith(".ear")) { - File archive = it.next().toFile(); - EnterpriseArchive earArchive = ShrinkWrap.create(EnterpriseArchive.class, newPackageName); - earArchive.merge((ShrinkWrap.createFromZipFile(EnterpriseArchive.class, archive))); - return earArchive; - } else { - return null; - } + if (newPackageName.endsWith(".war")) { + File archive = it.next().toFile(); + WebArchive webArchive = ShrinkWrap.create(WebArchive.class, newPackageName); + webArchive.merge((ShrinkWrap.createFromZipFile(WebArchive.class, archive))); + return webArchive; + } else if (newPackageName.endsWith(".jar")) { + File archive = it.next().toFile(); + JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class, newPackageName); + javaArchive.merge((ShrinkWrap.createFromZipFile(JavaArchive.class, archive))); + return javaArchive; + } else if (newPackageName.endsWith(".ear")) { + File archive = it.next().toFile(); + EnterpriseArchive earArchive = ShrinkWrap.create(EnterpriseArchive.class, newPackageName); + earArchive.merge((ShrinkWrap.createFromZipFile(EnterpriseArchive.class, archive))); + return earArchive; + } else { + return null; + } - } else { - return null; - } - - } catch (IOException e) { - e.printStackTrace(); - return null; - } - - } + } else { + return null; + } + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/ASDCITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/ASDCITCase.java index 3170cd1655..27cfe6fa17 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/ASDCITCase.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/ASDCITCase.java @@ -73,443 +73,446 @@ import org.openecomp.mso.global_tests.asdc.notif_emulator.JsonNotificationData; @RunWith(Arquillian.class) public class ASDCITCase { - /** - * Add the resources in the right folder of a jar - * - * @param jar The jarArchive - * @param dir The main dir containing things that must be added - * @throws Exception In case of issues with the files - */ - private static void addFiles(JavaArchive jar, File dir, String destFolder) throws Exception { + /** + * Add the resources in the right folder of a jar + * @param jar The jarArchive + * @param dir The main dir containing things that must be added + * @throws Exception In case of issues with the files + */ + private static void addFiles(JavaArchive jar, File dir,String destFolder) throws Exception { - if (!dir.isDirectory()) { - throw new Exception("not a directory"); - } - for (File f : dir.listFiles()) { + if (!dir.isDirectory()) { + throw new Exception("not a directory"); + } + for (File f : dir.listFiles()) { - if (f.isFile()) { - jar.addAsResource(f, destFolder + "/" + f.getName()); - } else { + if (f.isFile()) { + jar.addAsResource(f, destFolder + "/" + f.getName()); + } else { - addFiles(jar, f, destFolder + "/" + f.getName()); - } - } - } + addFiles(jar, f, destFolder+"/"+f.getName()); + } + } + } - @Deployment(name = "asdc-controller", testable = true) - public static Archive<?> createAsdcControllerWarDeployment() throws Exception { - System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); + @Deployment(name="asdc-controller",testable=true) + public static Archive<?> createAsdcControllerWarDeployment () throws Exception { + System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); - WebArchive warArchive = (WebArchive) ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); + WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); - // Add the current test class - JavaArchive testclasses = ShrinkWrap.create(JavaArchive.class, "testClasses.jar"); + // Add the current test class + JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar"); - testclasses.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator"); + testclasses.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator"); - addFiles(testclasses, new File(Thread.currentThread().getContextClassLoader().getResource("resource-examples/asdc").getFile()), "resource-examples/asdc"); + addFiles(testclasses,new File(Thread.currentThread().getContextClassLoader().getResource("resource-examples/asdc").getFile()),"resource-examples/asdc"); - System.out.println(testclasses.toString(true)); - warArchive.addAsLibraries(testclasses); + System.out.println(testclasses.toString(true)); + warArchive.addAsLibraries(testclasses); - // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml - warArchive.addAsLibraries(Maven.resolver() - .resolve("org.mockito:mockito-all:1.10.19") - .withoutTransitivity() - .asFile()); - //warArchive.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator"); - //addFiles(warArchive,new File(ASDCITCase.class.getClassLoader().getResource("resource-examples").getPath()),"resource-examples"); + // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml + warArchive.addAsLibraries(Maven.resolver() + .resolve("org.mockito:mockito-all:1.10.19") + .withoutTransitivity () + .asFile ()); - // Take one war randomly to make arquilian happy - Testable.archiveToTest(warArchive); + //warArchive.addPackage("org.openecomp.mso.global_tests.asdc.notif_emulator"); + //addFiles(warArchive,new File(ASDCITCase.class.getClassLoader().getResource("resource-examples").getPath()),"resource-examples"); + // Take one war randomly to make arquilian happy + Testable.archiveToTest(warArchive); - System.out.println(warArchive.toString(true)); - return warArchive; - } + System.out.println(warArchive.toString(true)); - @BeforeClass - public static final void waitBeforeStart() throws InterruptedException, - IOException, - URISyntaxException, - NoSuchAlgorithmException { - System.out.println("Executing " + ASDCITCase.class.getName()); - } + return warArchive; + } - @AfterClass - public static final void waitAfterStart() throws InterruptedException, - IOException, - URISyntaxException, - NoSuchAlgorithmException { - System.out.println("Waiting 60000ms " + ASDCITCase.class.getName()); - Thread.sleep(60000); - } + @BeforeClass + public static final void waitBeforeStart() throws InterruptedException, + IOException, + URISyntaxException, + NoSuchAlgorithmException { + System.out.println("Executing " + ASDCITCase.class.getName()); + } - /** - * Be careful when using that notification fake structure, the UUID of notif artifacts MUST be different. - * There is a static Map behind the scene. - */ - private JsonNotificationData notifDataWithoutModuleInfo; - private DistributionClientEmulator distribClientWithoutModuleInfo; + @AfterClass + public static final void waitAfterStart() throws InterruptedException, + IOException, + URISyntaxException, + NoSuchAlgorithmException { + System.out.println("Waiting 60000ms " + ASDCITCase.class.getName()); + Thread.sleep(60000); + } - private JsonNotificationData notifDataV1, notifDataV2, notifDataV3, notifDataV4, notifDataV5, notifDataDNS, notifDataVFW; - private DistributionClientEmulator distribClientV1, distribClientV2, distribClientV3, distribClientV4, distribClientV5, distribClientV1ForSameNotif, distribClientDNS, distribClientVFW; + /** + * Be careful when using that notification fake structure, the UUID of notif artifacts MUST be different. + * There is a static Map behind the scene. + */ + private JsonNotificationData notifDataWithoutModuleInfo; + private DistributionClientEmulator distribClientWithoutModuleInfo; + private JsonNotificationData notifDataV1, notifDataV2, notifDataV3, notifDataV4, notifDataV5,notifDataDNS,notifDataVFW; + private DistributionClientEmulator distribClientV1, distribClientV2, distribClientV3, distribClientV4, distribClientV5, distribClientV1ForSameNotif, distribClientDNS,distribClientVFW; - @Before - public final void beforeEachTest() throws IOException { - distribClientV1 = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1"); - distribClientV1ForSameNotif = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1"); - notifDataV1 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V1"); + @Before + public final void beforeEachTest() throws IOException { - // This is a duplicate in version 2 of the version 1 - distribClientV2 = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V2"); - notifDataV2 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V2"); + distribClientV1= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1"); + distribClientV1ForSameNotif= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V1"); + notifDataV1 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V1"); - distribClientV3 = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V3"); - notifDataV3 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V3"); + // This is a duplicate in version 2 of the version 1 + distribClientV2= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V2"); + notifDataV2 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V2"); - // This is a duplicate in version 4 of the version 3 - distribClientV4 = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V4"); - notifDataV4 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V4"); + distribClientV3= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V3"); + notifDataV3 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V3"); - // This notification is to test the deployment of volume with nested + an artifact not used (should send notification with DEPLOY_ERROR - distribClientV5 = new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V5"); - notifDataV5 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V5"); + // This is a duplicate in version 4 of the version 3 + distribClientV4= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V4"); + notifDataV4 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V4"); + // This notification is to test the deployment of volume with nested + an artifact not used (should send notification with DEPLOY_ERROR + distribClientV5= new DistributionClientEmulator("/resource-examples/asdc/simpleNotif-V5"); + notifDataV5 = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/simpleNotif-V5"); - distribClientWithoutModuleInfo = new DistributionClientEmulator("/resource-examples/asdc/notif-without-modules-metadata"); - notifDataWithoutModuleInfo = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/notif-without-modules-metadata"); + distribClientWithoutModuleInfo= new DistributionClientEmulator("/resource-examples/asdc/notif-without-modules-metadata"); + notifDataWithoutModuleInfo = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/notif-without-modules-metadata"); - distribClientDNS = new DistributionClientEmulator("/resource-examples/asdc/demo-dns-V1"); - notifDataDNS = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-dns-V1"); + distribClientDNS= new DistributionClientEmulator("/resource-examples/asdc/demo-dns-V1"); + notifDataDNS = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-dns-V1"); - distribClientVFW = new DistributionClientEmulator("/resource-examples/asdc/demo-vfw-V1"); - notifDataVFW = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-vfw-V1"); + distribClientVFW= new DistributionClientEmulator("/resource-examples/asdc/demo-vfw-V1"); + notifDataVFW = JsonNotificationData.instantiateNotifFromJsonFile("/resource-examples/asdc/demo-vfw-V1"); - } - @Test - @OperateOnDeployment("asdc-controller") - public void testNotifWithoutModuleInfo() throws NoSuchAlgorithmException, - IOException, - URISyntaxException, - ArtifactInstallerException, ASDCControllerException, ASDCParametersException { + } + @Test + @OperateOnDeployment("asdc-controller") + public void testNotifWithoutModuleInfo () throws NoSuchAlgorithmException, + IOException, + URISyntaxException, + ArtifactInstallerException, ASDCControllerException, ASDCParametersException { - ASDCController asdcController = new ASDCController("asdc-controller1", distribClientWithoutModuleInfo); - asdcController.initASDC(); - asdcController.treatNotification(notifDataWithoutModuleInfo); - assertTrue(distribClientWithoutModuleInfo.getDistributionMessageReceived().size() > 0); - int badDeployment = 0; - for (IDistributionStatusMessage message : distribClientWithoutModuleInfo.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - if (message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR)) { - badDeployment++; - } - } - assertTrue(badDeployment == 3); + ASDCController asdcController = new ASDCController("asdc-controller1", distribClientWithoutModuleInfo); + asdcController.initASDC(); + asdcController.treatNotification(notifDataWithoutModuleInfo); - // Check if something has been recorder in DB, as it should not - CatalogDatabase catalogDB = CatalogDatabase.getInstance(); + assertTrue(distribClientWithoutModuleInfo.getDistributionMessageReceived().size() > 0); - HeatTemplate heatTemplate = catalogDB.getHeatTemplate("Whot-nimbus-oam_v1.0.yaml", "1.0", "resourceName-1"); - assertNull(heatTemplate); - } + int badDeployment=0; + for (IDistributionStatusMessage message:distribClientWithoutModuleInfo.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + if(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR)) { + badDeployment++; + } + } + assertTrue(badDeployment == 3); - private void validateVnfResource(JsonNotificationData inputNotification, List<IVfModuleData> moduleList) { + // Check if something has been recorder in DB, as it should not + CatalogDatabase catalogDB = CatalogDatabase.getInstance(); - CatalogDatabase catalogDB = CatalogDatabase.getInstance(); + HeatTemplate heatTemplate = catalogDB.getHeatTemplate("Whot-nimbus-oam_v1.0.yaml", "1.0", "resourceName-1"); + assertNull(heatTemplate); + } + private void validateVnfResource(JsonNotificationData inputNotification, List<IVfModuleData> moduleList) { - for (IResourceInstance resource : inputNotification.getResources()) { - VnfResource vnfResourceDB = catalogDB.getVnfResource(inputNotification.getServiceName() + "/" + resource.getResourceInstanceName(), inputNotification.getServiceVersion()); - assertNotNull(vnfResourceDB); + CatalogDatabase catalogDB = CatalogDatabase.getInstance(); - //assertTrue(vnfResourceDB.getAsdcUuid().equals(resource.getResourceUUID())); - assertTrue(vnfResourceDB.getDescription().equals(inputNotification.getServiceDescription())); - assertTrue(vnfResourceDB.getModelInvariantUuid().equals(resource.getResourceInvariantUUID())); - assertTrue(vnfResourceDB.getModelVersion().equals(resource.getResourceVersion())); - assertTrue(vnfResourceDB.getOrchestrationMode().equals("HEAT")); - assertTrue(vnfResourceDB.getVersion().equals(inputNotification.getServiceVersion())); - //assertTrue(vnfResourceDB.getVnfType().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName())); - //assertTrue(vnfResourceDB.getModelCustomizationName().equals(resource.getResourceInstanceName())); - assertTrue(vnfResourceDB.getModelName().equals(resource.getResourceName())); - //assertTrue(vnfResourceDB.getServiceModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID())); - for (IVfModuleData module : moduleList) { + for (IResourceInstance resource:inputNotification.getResources()) { + VnfResource vnfResourceDB = catalogDB.getVnfResource(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName(), inputNotification.getServiceVersion()); + assertNotNull(vnfResourceDB); - VfModule vfModuleDB = catalogDB.getVfModuleModelName(module.getVfModuleModelName(), inputNotification.getServiceVersion()); - assertNotNull(vfModuleDB); - assertTrue(module.getVfModuleModelName().equals(vfModuleDB.getModelName())); + //assertTrue(vnfResourceDB.getAsdcUuid().equals(resource.getResourceUUID())); + assertTrue(vnfResourceDB.getDescription().equals(inputNotification.getServiceDescription())); + assertTrue(vnfResourceDB.getModelInvariantUuid().equals(resource.getResourceInvariantUUID())); + assertTrue(vnfResourceDB.getModelVersion().equals(resource.getResourceVersion())); + assertTrue(vnfResourceDB.getOrchestrationMode().equals("HEAT")); + assertTrue(vnfResourceDB.getVersion().equals(inputNotification.getServiceVersion())); + //assertTrue(vnfResourceDB.getVnfType().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName())); + //assertTrue(vnfResourceDB.getModelCustomizationName().equals(resource.getResourceInstanceName())); + assertTrue(vnfResourceDB.getModelName().equals(resource.getResourceName())); + //assertTrue(vnfResourceDB.getServiceModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID())); - // assertTrue((inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()+"::"+vfModuleDB.getModelName()).equals(vfModuleDB.getType())); - // assertTrue(vnfResourceDB.getId()!=0); - //assertNotNull(vfModuleDB.getVnfResourceId()); + for (IVfModuleData module:moduleList) { - // assertTrue(vnfResourceDB.getId()==vfModuleDB.getVnfResourceId().intValue()); + VfModule vfModuleDB = catalogDB.getVfModuleModelName(module.getVfModuleModelName(),inputNotification.getServiceVersion()); + assertNotNull(vfModuleDB); + assertTrue(module.getVfModuleModelName().equals(vfModuleDB.getModelName())); - for (String artifactUUID : module.getArtifacts()) { - IArtifactInfo artifact = null; - for (IArtifactInfo artifactTemp : resource.getArtifacts()) { - if (artifactTemp.getArtifactUUID().equals(artifactUUID)) { - artifact = artifactTemp; - break; - } - } - assertNotNull(artifact); + // assertTrue((inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()+"::"+vfModuleDB.getModelName()).equals(vfModuleDB.getType())); + // assertTrue(vnfResourceDB.getId()!=0); + //assertNotNull(vfModuleDB.getVnfResourceId()); - switch (artifact.getArtifactType()) { - case ASDCConfiguration.HEAT: - HeatTemplate heatTemplateDB = catalogDB.getHeatTemplate(vfModuleDB.getHeatTemplateArtifactUUId()); - assertNotNull(heatTemplateDB); - //assertTrue(heatTemplateDB.getAsdcResourceName().equals(resource.getResourceName())); - assertTrue(heatTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID())); - assertTrue(heatTemplateDB.getDescription().equals(artifact.getArtifactDescription())); - assertTrue(heatTemplateDB.getTemplateBody() != null && !heatTemplateDB.getTemplateBody().isEmpty()); - assertTrue(heatTemplateDB.getParameters().size() > 0); + // assertTrue(vnfResourceDB.getId()==vfModuleDB.getVnfResourceId().intValue()); - assertTrue(heatTemplateDB.getTemplateName().equals(artifact.getArtifactName())); + for (String artifactUUID:module.getArtifacts()) { + IArtifactInfo artifact = null; + for (IArtifactInfo artifactTemp:resource.getArtifacts()) { + if (artifactTemp.getArtifactUUID().equals(artifactUUID)) { + artifact = artifactTemp; + break; + } + } + assertNotNull(artifact); - if (artifact.getArtifactTimeout() != null) { - assertTrue(heatTemplateDB.getTimeoutMinutes() == artifact.getArtifactTimeout().intValue()); - } else { - assertTrue(heatTemplateDB.getTimeoutMinutes() == 240); - } - assertTrue(heatTemplateDB.getVersion().equals(artifact.getArtifactVersion())); + switch (artifact.getArtifactType()) { + case ASDCConfiguration.HEAT: + HeatTemplate heatTemplateDB= catalogDB.getHeatTemplate(vfModuleDB.getHeatTemplateArtifactUUId()); + assertNotNull(heatTemplateDB); + //assertTrue(heatTemplateDB.getAsdcResourceName().equals(resource.getResourceName())); + assertTrue(heatTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID())); + assertTrue(heatTemplateDB.getDescription().equals(artifact.getArtifactDescription())); + assertTrue(heatTemplateDB.getTemplateBody() != null && !heatTemplateDB.getTemplateBody().isEmpty()); + assertTrue(heatTemplateDB.getParameters().size()>0); - assertFalse(heatTemplateDB.getTemplateBody().contains("file:///")); - break; - case ASDCConfiguration.HEAT_ENV: - - HeatEnvironment heatEnvironmentDB = catalogDB.getHeatEnvironment(artifact.getArtifactName(), artifact.getArtifactVersion(), inputNotification.getServiceName() + "/" + resource.getResourceInstanceName()); + assertTrue(heatTemplateDB.getTemplateName().equals(artifact.getArtifactName())); - assertNotNull(heatEnvironmentDB); + if (artifact.getArtifactTimeout() != null) { + assertTrue(heatTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue()); + } else { + assertTrue(heatTemplateDB.getTimeoutMinutes()== 240); + } + assertTrue(heatTemplateDB.getVersion().equals(artifact.getArtifactVersion())); + + assertFalse(heatTemplateDB.getTemplateBody().contains("file:///")); + break; + case ASDCConfiguration.HEAT_ENV: + + HeatEnvironment heatEnvironmentDB = catalogDB.getHeatEnvironment(artifact.getArtifactName(), artifact.getArtifactVersion(), inputNotification.getServiceName()+"/"+resource.getResourceInstanceName()); + + assertNotNull(heatEnvironmentDB); // assertTrue((vfModuleDB.getVolEnvironmentId() != null && vfModuleDB.getVolEnvironmentId().intValue() == heatEnvironmentDB.getId()) // || (vfModuleDB.getEnvironmentId() != null && vfModuleDB.getEnvironmentId() == heatEnvironmentDB.getId())); // // assertTrue(heatEnvironmentDB.getAsdcResourceName().equals(inputNotification.getServiceName()+"/"+resource.getResourceInstanceName())); // // assertTrue(heatEnvironmentDB.getAsdcUuid().equals(artifact.getArtifactUUID())); - assertTrue(heatEnvironmentDB.getDescription().equals(artifact.getArtifactDescription())); - assertTrue(heatEnvironmentDB.getVersion().equals(artifact.getArtifactVersion())); - assertTrue(heatEnvironmentDB.getName().equals(artifact.getArtifactName())); - assertTrue(heatEnvironmentDB.getEnvironment() != null); - assertFalse(heatEnvironmentDB.getEnvironment().contains("file:///")); - - break; - case ASDCConfiguration.HEAT_NESTED: - Map<String, Object> listNestedDBMainHeat = new HashMap<String, Object>(); - Map<String, Object> listNestedDBVolHeat = new HashMap<String, Object>(); - - if (vfModuleDB.getHeatTemplateArtifactUUId() != null) { - listNestedDBMainHeat = catalogDB.getNestedTemplates(vfModuleDB.getHeatTemplateArtifactUUId()); - } - if (vfModuleDB.getVolHeatTemplateArtifactUUId() != null) { - listNestedDBVolHeat = catalogDB.getNestedTemplates(vfModuleDB.getVolHeatTemplateArtifactUUId()); - } - - assertTrue(listNestedDBMainHeat.size() > 0 || listNestedDBVolHeat.size() > 0); - - - assertTrue(listNestedDBMainHeat.get(artifact.getArtifactName()) != null - || listNestedDBVolHeat.get(artifact.getArtifactName()) != null); - - HeatTemplate rightNestedTemplateDB = catalogDB.getHeatTemplate(artifact.getArtifactName(), artifact.getArtifactVersion(), resource.getResourceName()); - assertNotNull(rightNestedTemplateDB); - //assertTrue(catalogDB.getNestedHeatTemplate(vfModuleDB.getTemplateId(), rightNestedTemplateDB.getId()) != null || catalogDB.getNestedHeatTemplate(vfModuleDB.getVolTemplateId(), rightNestedTemplateDB.getId()) != null); - - //assertTrue(rightNestedTemplateDB.getAsdcResourceName().equals(resource.getResourceName())); - assertTrue(rightNestedTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID())); - assertTrue(rightNestedTemplateDB.getDescription().equals(artifact.getArtifactDescription())); - assertTrue(rightNestedTemplateDB.getTemplateBody() != null && !rightNestedTemplateDB.getTemplateBody().isEmpty()); - assertTrue(rightNestedTemplateDB.getTemplateName().equals(artifact.getArtifactName())); - - if (artifact.getArtifactTimeout() != null) { - assertTrue(rightNestedTemplateDB.getTimeoutMinutes() == artifact.getArtifactTimeout().intValue()); - } else { - assertTrue(rightNestedTemplateDB.getTimeoutMinutes() == 240); - } - assertTrue(rightNestedTemplateDB.getVersion().equals(artifact.getArtifactVersion())); - assertFalse(rightNestedTemplateDB.getTemplateBody().contains("file:///")); - - break; - case ASDCConfiguration.HEAT_VOL: - HeatTemplate heatTemplateVolDB = catalogDB.getHeatTemplate(vfModuleDB.getVolHeatTemplateArtifactUUId()); - assertNotNull(heatTemplateVolDB); - - //assertTrue(heatTemplateVolDB.getAsdcResourceName().equals(resource.getResourceName())); - assertTrue(heatTemplateVolDB.getAsdcUuid().equals(artifact.getArtifactUUID())); - assertTrue(heatTemplateVolDB.getDescription().equals(artifact.getArtifactDescription())); - assertTrue(heatTemplateVolDB.getTemplateBody() != null && !heatTemplateVolDB.getTemplateBody().isEmpty()); - assertTrue(heatTemplateVolDB.getTemplateName().equals(artifact.getArtifactName())); - - if (artifact.getArtifactTimeout() != null) { - assertTrue(heatTemplateVolDB.getTimeoutMinutes() == artifact.getArtifactTimeout().intValue()); - } else { - assertTrue(heatTemplateVolDB.getTimeoutMinutes() == 240); - } - assertTrue(heatTemplateVolDB.getVersion().equals(artifact.getArtifactVersion())); - assertFalse(heatTemplateVolDB.getTemplateBody().contains("file:///")); - - break; - case ASDCConfiguration.HEAT_ARTIFACT: - Map<String, HeatFiles> heatFilesDB = catalogDB.getHeatFilesForVfModule(vfModuleDB.getModelUUID()); - assertTrue(heatFilesDB.size() > 0); - HeatFiles rightHeatFilesDB = heatFilesDB.get(artifact.getArtifactName()); - assertNotNull(rightHeatFilesDB); - - //assertTrue(rightHeatFilesDB.getAsdcResourceName().equals(resource.getResourceName())); - assertTrue(rightHeatFilesDB.getAsdcUuid().equals(artifact.getArtifactUUID())); - assertTrue(rightHeatFilesDB.getDescription().equals(artifact.getArtifactDescription())); - assertTrue(rightHeatFilesDB.getFileBody() != null && !rightHeatFilesDB.getFileBody().isEmpty()); - assertTrue(rightHeatFilesDB.getFileName().equals(artifact.getArtifactName())); - assertTrue(rightHeatFilesDB.getVersion().equals(artifact.getArtifactVersion())); - - break; - default: - break; - - } - } - - } - - } - - Service service = catalogDB.getServiceByModelUUID(inputNotification.getServiceUUID()); - assertNotNull(service); - assertTrue(service.getCreated() != null && service.getCreated().getTime() > 0); - assertTrue(service.getDescription().equals(inputNotification.getServiceDescription())); - assertTrue(service.getModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID())); - assertTrue(service.getModelName().equals(inputNotification.getServiceName())); - assertTrue(service.getModelUUID().equals(inputNotification.getServiceUUID())); - assertTrue(service.getVersion().equals(inputNotification.getServiceVersion())); - - } - - @Test - @OperateOnDeployment("asdc-controller") - public void testNotifsDeployment() throws NoSuchAlgorithmException, - IOException, - URISyntaxException, - ArtifactInstallerException, ASDCControllerException, ASDCParametersException { - - - ASDCController asdcControllerV1 = new ASDCController("asdc-controller1", distribClientV1); - asdcControllerV1.initASDC(); - asdcControllerV1.treatNotification(notifDataV1); - - assertTrue(distribClientV1.getDistributionMessageReceived().size() > 0); - for (IDistributionStatusMessage message : distribClientV1.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } - - this.validateVnfResource(notifDataV1, distribClientV1.getListVFModuleMetaData()); + assertTrue(heatEnvironmentDB.getDescription().equals(artifact.getArtifactDescription())); + assertTrue(heatEnvironmentDB.getVersion().equals(artifact.getArtifactVersion())); + assertTrue(heatEnvironmentDB.getName().equals(artifact.getArtifactName())); + assertTrue(heatEnvironmentDB.getEnvironment() != null); + assertFalse(heatEnvironmentDB.getEnvironment().contains("file:///")); + + break; + case ASDCConfiguration.HEAT_NESTED: + Map<String,Object> listNestedDBMainHeat=new HashMap<String,Object>(); + Map<String,Object> listNestedDBVolHeat=new HashMap<String,Object>(); + + if (vfModuleDB.getHeatTemplateArtifactUUId() != null) { + listNestedDBMainHeat = catalogDB.getNestedTemplates(vfModuleDB.getHeatTemplateArtifactUUId()); + } + if (vfModuleDB.getVolHeatTemplateArtifactUUId() != null) { + listNestedDBVolHeat = catalogDB.getNestedTemplates(vfModuleDB.getVolHeatTemplateArtifactUUId()); + } + + assertTrue(listNestedDBMainHeat.size() > 0 || listNestedDBVolHeat.size() > 0); + + + assertTrue(listNestedDBMainHeat.get(artifact.getArtifactName()) != null + || listNestedDBVolHeat.get(artifact.getArtifactName()) != null); + + HeatTemplate rightNestedTemplateDB = catalogDB.getHeatTemplate(artifact.getArtifactName(), artifact.getArtifactVersion(), resource.getResourceName()); + assertNotNull(rightNestedTemplateDB); + //assertTrue(catalogDB.getNestedHeatTemplate(vfModuleDB.getTemplateId(), rightNestedTemplateDB.getId()) != null || catalogDB.getNestedHeatTemplate(vfModuleDB.getVolTemplateId(), rightNestedTemplateDB.getId()) != null); + + //assertTrue(rightNestedTemplateDB.getAsdcResourceName().equals(resource.getResourceName())); + assertTrue(rightNestedTemplateDB.getAsdcUuid().equals(artifact.getArtifactUUID())); + assertTrue(rightNestedTemplateDB.getDescription().equals(artifact.getArtifactDescription())); + assertTrue(rightNestedTemplateDB.getTemplateBody() != null && !rightNestedTemplateDB.getTemplateBody().isEmpty()); + assertTrue(rightNestedTemplateDB.getTemplateName().equals(artifact.getArtifactName())); + + if (artifact.getArtifactTimeout() != null) { + assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue()); + } else { + assertTrue(rightNestedTemplateDB.getTimeoutMinutes()== 240); + } + assertTrue(rightNestedTemplateDB.getVersion().equals(artifact.getArtifactVersion())); + assertFalse(rightNestedTemplateDB.getTemplateBody().contains("file:///")); + + break; + case ASDCConfiguration.HEAT_VOL: + HeatTemplate heatTemplateVolDB = catalogDB.getHeatTemplate(vfModuleDB.getVolHeatTemplateArtifactUUId()); + assertNotNull(heatTemplateVolDB); + + //assertTrue(heatTemplateVolDB.getAsdcResourceName().equals(resource.getResourceName())); + assertTrue(heatTemplateVolDB.getAsdcUuid().equals(artifact.getArtifactUUID())); + assertTrue(heatTemplateVolDB.getDescription().equals(artifact.getArtifactDescription())); + assertTrue(heatTemplateVolDB.getTemplateBody() != null && !heatTemplateVolDB.getTemplateBody().isEmpty()); + assertTrue(heatTemplateVolDB.getTemplateName().equals(artifact.getArtifactName())); + + if (artifact.getArtifactTimeout() != null) { + assertTrue(heatTemplateVolDB.getTimeoutMinutes()== artifact.getArtifactTimeout().intValue()); + } else { + assertTrue(heatTemplateVolDB.getTimeoutMinutes()== 240); + } + assertTrue(heatTemplateVolDB.getVersion().equals(artifact.getArtifactVersion())); + assertFalse(heatTemplateVolDB.getTemplateBody().contains("file:///")); + + break; + case ASDCConfiguration.HEAT_ARTIFACT: + Map<String,HeatFiles> heatFilesDB= catalogDB.getHeatFilesForVfModule(vfModuleDB.getModelUUID()); + assertTrue(heatFilesDB.size()>0); + HeatFiles rightHeatFilesDB=heatFilesDB.get( artifact.getArtifactName()); + assertNotNull(rightHeatFilesDB); + + //assertTrue(rightHeatFilesDB.getAsdcResourceName().equals(resource.getResourceName())); + assertTrue(rightHeatFilesDB.getAsdcUuid().equals(artifact.getArtifactUUID())); + assertTrue(rightHeatFilesDB.getDescription().equals(artifact.getArtifactDescription())); + assertTrue(rightHeatFilesDB.getFileBody() != null && !rightHeatFilesDB.getFileBody().isEmpty()); + assertTrue(rightHeatFilesDB.getFileName().equals( artifact.getArtifactName())); + assertTrue(rightHeatFilesDB.getVersion().equals(artifact.getArtifactVersion())); + + break; + default: + break; + + } + } + + } + + } + + Service service = catalogDB.getServiceByModelUUID(inputNotification.getServiceUUID()); + assertNotNull(service); + assertTrue(service.getCreated() !=null && service.getCreated().getTime()>0); + assertTrue(service.getDescription().equals(inputNotification.getServiceDescription())); + assertTrue(service.getModelInvariantUUID().equals(inputNotification.getServiceInvariantUUID())); + assertTrue(service.getModelName().equals(inputNotification.getServiceName())); + assertTrue(service.getModelUUID().equals(inputNotification.getServiceUUID())); + assertTrue(service.getVersion().equals(inputNotification.getServiceVersion())); + + } + + @Test + @OperateOnDeployment("asdc-controller") + public void testNotifsDeployment () throws NoSuchAlgorithmException, + IOException, + URISyntaxException, + ArtifactInstallerException, ASDCControllerException, ASDCParametersException { + + + + ASDCController asdcControllerV1 = new ASDCController("asdc-controller1", distribClientV1); + asdcControllerV1.initASDC(); + asdcControllerV1.treatNotification(notifDataV1); + + assertTrue(distribClientV1.getDistributionMessageReceived().size() > 0); + for (IDistributionStatusMessage message:distribClientV1.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } + + this.validateVnfResource(notifDataV1,distribClientV1.getListVFModuleMetaData()); + + + + // Try again to load the same notif + ASDCController asdcControllerNewNotif = new ASDCController("asdc-controller1", distribClientV1ForSameNotif); + asdcControllerNewNotif.initASDC(); + asdcControllerNewNotif.treatNotification(notifDataV1); + + for (IDistributionStatusMessage message:distribClientV1ForSameNotif.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.ALREADY_DEPLOYED) || message.getStatus().equals(DistributionStatusEnum.ALREADY_DOWNLOADED)); + } + + + // Try again to load same notif but in V2 + ASDCController asdcControllerV2 = new ASDCController("asdc-controller1", distribClientV2); + asdcControllerV2.initASDC(); + asdcControllerV2.treatNotification(notifDataV2); + for (IDistributionStatusMessage message:distribClientV2.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } - // Try again to load the same notif - ASDCController asdcControllerNewNotif = new ASDCController("asdc-controller1", distribClientV1ForSameNotif); - asdcControllerNewNotif.initASDC(); - asdcControllerNewNotif.treatNotification(notifDataV1); - - for (IDistributionStatusMessage message : distribClientV1ForSameNotif.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.ALREADY_DEPLOYED) || message.getStatus().equals(DistributionStatusEnum.ALREADY_DOWNLOADED)); - } - - - // Try again to load same notif but in V2 - ASDCController asdcControllerV2 = new ASDCController("asdc-controller1", distribClientV2); - asdcControllerV2.initASDC(); - asdcControllerV2.treatNotification(notifDataV2); - - for (IDistributionStatusMessage message : distribClientV2.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } - - this.validateVnfResource(notifDataV2, distribClientV2.getListVFModuleMetaData()); + this.validateVnfResource(notifDataV2,distribClientV2.getListVFModuleMetaData()); - // Try again to load same notif + Script + Volume artifacts and in service V3 - ASDCController asdcControllerV3 = new ASDCController("asdc-controller1", distribClientV3); - asdcControllerV3.initASDC(); - asdcControllerV3.treatNotification(notifDataV3); + // Try again to load same notif + Script + Volume artifacts and in service V3 + ASDCController asdcControllerV3 = new ASDCController("asdc-controller1", distribClientV3); + asdcControllerV3.initASDC(); + asdcControllerV3.treatNotification(notifDataV3); - for (IDistributionStatusMessage message : distribClientV3.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } + for (IDistributionStatusMessage message:distribClientV3.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } - this.validateVnfResource(notifDataV3, distribClientV3.getListVFModuleMetaData()); + this.validateVnfResource(notifDataV3,distribClientV3.getListVFModuleMetaData()); - // Try again to load same notif + Script + Volume artifacts and in service V4 - ASDCController asdcControllerV4 = new ASDCController("asdc-controller1", distribClientV4); - asdcControllerV4.initASDC(); - asdcControllerV4.treatNotification(notifDataV4); + // Try again to load same notif + Script + Volume artifacts and in service V4 + ASDCController asdcControllerV4 = new ASDCController("asdc-controller1", distribClientV4); + asdcControllerV4.initASDC(); + asdcControllerV4.treatNotification(notifDataV4); - for (IDistributionStatusMessage message : distribClientV4.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } + for (IDistributionStatusMessage message:distribClientV4.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } - this.validateVnfResource(notifDataV4, distribClientV4.getListVFModuleMetaData()); + this.validateVnfResource(notifDataV4,distribClientV4.getListVFModuleMetaData()); - // Try again with service V5 (Nested template attached to Volume + HEat artifact not used by module), - //this should force the notification DEPLOY_ERROR to be sent for this artifact - ASDCController asdcControllerV5 = new ASDCController("asdc-controller1", distribClientV5); - asdcControllerV5.initASDC(); - asdcControllerV5.treatNotification(notifDataV5); + // Try again with service V5 (Nested template attached to Volume + HEat artifact not used by module), + //this should force the notification DEPLOY_ERROR to be sent for this artifact + ASDCController asdcControllerV5 = new ASDCController("asdc-controller1", distribClientV5); + asdcControllerV5.initASDC(); + asdcControllerV5.treatNotification(notifDataV5); - for (IDistributionStatusMessage message : distribClientV5.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - if ("cloud-nimbus.sh".equals(message.getArtifactURL())) { - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } else { - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } - } + for (IDistributionStatusMessage message:distribClientV5.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + if ("cloud-nimbus.sh".equals(message.getArtifactURL())) { + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_ERROR) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } else { + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } + } - this.validateVnfResource(notifDataV5, distribClientV5.getListVFModuleMetaData()); + this.validateVnfResource(notifDataV5,distribClientV5.getListVFModuleMetaData()); - // Try again with demo DNS - ASDCController asdcControllerDNS = new ASDCController("asdc-controller1", distribClientDNS); - asdcControllerDNS.initASDC(); - asdcControllerDNS.treatNotification(notifDataDNS); + // Try again with demo DNS + ASDCController asdcControllerDNS = new ASDCController("asdc-controller1", distribClientDNS); + asdcControllerDNS.initASDC(); + asdcControllerDNS.treatNotification(notifDataDNS); - for (IDistributionStatusMessage message : distribClientDNS.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } + for (IDistributionStatusMessage message:distribClientDNS.getDistributionMessageReceived()) { + System.out.println("Message received, URL:"+message.getArtifactURL()+", Value:"+message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } - this.validateVnfResource(notifDataDNS, distribClientDNS.getListVFModuleMetaData()); + this.validateVnfResource(notifDataDNS,distribClientDNS.getListVFModuleMetaData()); - // Try again with demo VFW - ASDCController asdcControllerVFW = new ASDCController("asdc-controller1", distribClientVFW); - asdcControllerVFW.initASDC(); - asdcControllerVFW.treatNotification(notifDataVFW); + // Try again with demo VFW + ASDCController asdcControllerVFW = new ASDCController("asdc-controller1", distribClientVFW); + asdcControllerVFW.initASDC(); + asdcControllerVFW.treatNotification(notifDataVFW); - for (IDistributionStatusMessage message : distribClientVFW.getDistributionMessageReceived()) { - System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); - assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) - || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); - } + for (IDistributionStatusMessage message : distribClientVFW.getDistributionMessageReceived()) { + System.out.println("Message received, URL:" + message.getArtifactURL() + ", Value:" + message.getStatus().name()); + assertTrue(message.getStatus().equals(DistributionStatusEnum.DEPLOY_OK) + || message.getStatus().equals(DistributionStatusEnum.DOWNLOAD_OK)); + } - this.validateVnfResource(notifDataVFW, distribClientVFW.getListVFModuleMetaData()); + this.validateVnfResource(notifDataVFW, distribClientVFW.getListVFModuleMetaData()); - } + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/DistributionClientEmulator.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/DistributionClientEmulator.java index 933216e611..3cb5a97d09 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/DistributionClientEmulator.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/DistributionClientEmulator.java @@ -48,28 +48,28 @@ import org.openecomp.mso.asdc.installer.IVfModuleData; public class DistributionClientEmulator implements IDistributionClient { - private String resourcePath; + private String resourcePath; - private List<IVfModuleData> listVFModuleMetaData; + private List<IVfModuleData> listVFModuleMetaData; - private List<IDistributionStatusMessage> distributionMessageReceived = new LinkedList<>(); + private List<IDistributionStatusMessage> distributionMessageReceived = new LinkedList<>(); - public DistributionClientEmulator(String notifFolderInResource) { + public DistributionClientEmulator(String notifFolderInResource) { - resourcePath = notifFolderInResource; - } + resourcePath = notifFolderInResource; + } - public List<IDistributionStatusMessage> getDistributionMessageReceived() { - return distributionMessageReceived; - } - - @Override - public List<IVfModuleMetadata> decodeVfModuleArtifact(byte[] arg0) { - return null; - } + public List<IDistributionStatusMessage> getDistributionMessageReceived() { + return distributionMessageReceived; + } + + @Override + public List<IVfModuleMetadata> decodeVfModuleArtifact(byte[] arg0) { + return null; + } /* @Override - public List<IVfModuleData> decodeVfModuleArtifact(byte[] arg0) { + public List<IVfModuleData> decodeVfModuleArtifact(byte[] arg0) { try { listVFModuleMetaData = new ObjectMapper().readValue(arg0, new TypeReference<List<JsonVfModuleMetaData>>(){}); return listVFModuleMetaData; @@ -84,91 +84,91 @@ public class DistributionClientEmulator implements IDistributionClient { return null; } */ - public List<IVfModuleData> getListVFModuleMetaData() { - return listVFModuleMetaData; - } - - @Override - public IDistributionClientDownloadResult download(IArtifactInfo arg0) { - - - //String filename = resourcePath+"/artifacts/"+arg0.getArtifactURL(); - String filename = arg0.getArtifactURL(); - System.out.println("Emulating the download from resources files:" + filename); - - InputStream inputStream = null; - - if (arg0.getArtifactName().equals("service_Rg516VmmscSrvc_csar.csar")) { - try { - inputStream = new FileInputStream(System.getProperty("java.io.tmpdir") + File.separator + "service_Rg516VmmscSrvc_csar.csar"); - } catch (Exception e) { - System.out.println("Error " + e.getMessage()); - } - } else { - - inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourcePath + filename); - } - - if (inputStream == null) { - System.out.println("InputStream is NULL for:" + filename); - } - try { - return new DistributionClientDownloadResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name(), arg0.getArtifactName(), IOUtils.toByteArray(inputStream)); - } catch (IOException e) { - - e.printStackTrace(); - } - return null; - } - - @Override - public IConfiguration getConfiguration() { - return null; - } - - @Override - public IDistributionClientResult init(IConfiguration arg0, INotificationCallback arg1) { - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } - - @Override - public IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage arg0) { - this.distributionMessageReceived.add(arg0); - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } - - @Override - public IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage arg0, String arg1) { - this.distributionMessageReceived.add(arg0); - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } - - @Override - public IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage arg0) { - this.distributionMessageReceived.add(arg0); - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } - - @Override - public IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage arg0, String arg1) { - this.distributionMessageReceived.add(arg0); - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } - - @Override - public IDistributionClientResult start() { - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } + public List<IVfModuleData> getListVFModuleMetaData() { + return listVFModuleMetaData; + } @Override - public IDistributionClientResult stop() { - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); + public IDistributionClientDownloadResult download (IArtifactInfo arg0) { + + + //String filename = resourcePath+"/artifacts/"+arg0.getArtifactURL(); + String filename = arg0.getArtifactURL(); + System.out.println("Emulating the download from resources files:"+filename); + + InputStream inputStream = null; + + if(arg0.getArtifactName().equals("service_Rg516VmmscSrvc_csar.csar")){ + try{ + inputStream = new FileInputStream(System.getProperty("java.io.tmpdir") + File.separator + "service_Rg516VmmscSrvc_csar.csar"); + }catch(Exception e){ + System.out.println("Error " + e.getMessage()); + } + }else{ + + inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourcePath + filename); + } - } + if (inputStream == null) { + System.out.println("InputStream is NULL for:"+filename); + } + try { + return new DistributionClientDownloadResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name(),arg0.getArtifactName(),IOUtils.toByteArray(inputStream)); + } catch (IOException e) { + + e.printStackTrace(); + } + return null; + } - @Override - public IDistributionClientResult updateConfiguration(IConfiguration arg0) { - return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS, DistributionActionResultEnum.SUCCESS.name()); - } + @Override + public IConfiguration getConfiguration() { + return null; + } + + @Override + public IDistributionClientResult init(IConfiguration arg0, INotificationCallback arg1) { + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage arg0) { + this.distributionMessageReceived.add(arg0); + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult sendDeploymentStatus(IDistributionStatusMessage arg0, String arg1) { + this.distributionMessageReceived.add(arg0); + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage arg0) { + this.distributionMessageReceived.add(arg0); + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult sendDownloadStatus(IDistributionStatusMessage arg0, String arg1) { + this.distributionMessageReceived.add(arg0); + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult start() { + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } + + @Override + public IDistributionClientResult stop() { + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + + } + + @Override + public IDistributionClientResult updateConfiguration(IConfiguration arg0) { + return new DistributionClientResultImpl(DistributionActionResultEnum.SUCCESS,DistributionActionResultEnum.SUCCESS.name()); + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfo.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfo.java index e998778a26..90511033dd 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfo.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfo.java @@ -19,7 +19,6 @@ */ package org.openecomp.mso.global_tests.asdc.notif_emulator; - import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -32,91 +31,92 @@ import org.openecomp.sdc.api.notification.IArtifactInfo; public class JsonArtifactInfo implements IArtifactInfo { - @JsonIgnore - private Map<String, IArtifactInfo> artifactsMapByUUID = new HashMap<>(); - - @JsonIgnore - private Map<String, Object> attributesMap = new HashMap<>(); - - public JsonArtifactInfo() { - - } - - public synchronized void addArtifactToUUIDMap(List<JsonArtifactInfo> artifactList) { - for (JsonArtifactInfo artifact : artifactList) { - artifactsMapByUUID.put(artifact.getArtifactUUID(), artifact); - } - - } - - @SuppressWarnings("unused") - @JsonAnySetter - public final void setAttribute(String attrName, Object attrValue) { - if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { - this.attributesMap.put(attrName, attrValue); - } - } - - - public Map<String, IArtifactInfo> getArtifactsMapByUUID() { - return artifactsMapByUUID; - } - - @Override - public String getArtifactChecksum() { - return (String) attributesMap.get("artifactCheckSum"); - } - - @Override - public String getArtifactDescription() { - return (String) attributesMap.get("artifactDescription"); - } - - @Override - public String getArtifactName() { - return (String) attributesMap.get("artifactName"); - } - - @Override - public Integer getArtifactTimeout() { - return (Integer) attributesMap.get("artifactTimeout"); - } - - @Override - public String getArtifactType() { - return (String) attributesMap.get("artifactType"); - } - - @Override - public String getArtifactURL() { - return (String) attributesMap.get("artifactURL"); - } - - @Override - public String getArtifactUUID() { - return (String) attributesMap.get("artifactUUID"); - } - - @Override - public String getArtifactVersion() { - return (String) attributesMap.get("artifactVersion"); - } - - @Override - public IArtifactInfo getGeneratedArtifact() { - return artifactsMapByUUID.get(attributesMap.get("generatedArtifact")); - } - - @Override - public List<IArtifactInfo> getRelatedArtifacts() { - List<IArtifactInfo> listArtifacts = new LinkedList<>(); - List<String> uuidList = (List<String>) attributesMap.get("relatedArtifact"); - if (uuidList != null) { - for (String uuid : uuidList) { - listArtifacts.add(artifactsMapByUUID.get(uuid)); - } - } - return listArtifacts; - } + @JsonIgnore + private Map<String,IArtifactInfo> artifactsMapByUUID = new HashMap<>(); + + @JsonIgnore + private Map<String,Object> attributesMap = new HashMap<>(); + + public JsonArtifactInfo() { + + } + + public synchronized void addArtifactToUUIDMap (List<JsonArtifactInfo> artifactList) { + for (JsonArtifactInfo artifact:artifactList) { + artifactsMapByUUID.put(artifact.getArtifactUUID(), artifact); + } + + } + + @SuppressWarnings("unused") + @JsonAnySetter + public final void setAttribute(String attrName, Object attrValue) { + if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { + this.attributesMap.put(attrName,attrValue); + } + } + + + + public Map<String, IArtifactInfo> getArtifactsMapByUUID() { + return artifactsMapByUUID; + } + + @Override + public String getArtifactChecksum() { + return (String)attributesMap.get("artifactCheckSum"); + } + + @Override + public String getArtifactDescription() { + return (String)attributesMap.get("artifactDescription"); + } + + @Override + public String getArtifactName() { + return (String)attributesMap.get("artifactName"); + } + + @Override + public Integer getArtifactTimeout() { + return (Integer)attributesMap.get("artifactTimeout"); + } + + @Override + public String getArtifactType() { + return (String)attributesMap.get("artifactType"); + } + + @Override + public String getArtifactURL() { + return (String)attributesMap.get("artifactURL"); + } + + @Override + public String getArtifactUUID() { + return (String)attributesMap.get("artifactUUID"); + } + + @Override + public String getArtifactVersion() { + return (String)attributesMap.get("artifactVersion"); + } + + @Override + public IArtifactInfo getGeneratedArtifact () { + return artifactsMapByUUID.get(attributesMap.get("generatedArtifact")); + } + + @Override + public List<IArtifactInfo> getRelatedArtifacts() { + List<IArtifactInfo> listArtifacts = new LinkedList<>(); + List<String> uuidList = (List<String>)attributesMap.get("relatedArtifact"); + if (uuidList != null) { + for(String uuid:uuidList) { + listArtifacts.add(artifactsMapByUUID.get(uuid)); + } + } + return listArtifacts; + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfoDeserializer.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfoDeserializer.java index c1213763df..010c9ac2a7 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfoDeserializer.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonArtifactInfoDeserializer.java @@ -30,20 +30,19 @@ import org.codehaus.jackson.map.JsonDeserializer; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -public class JsonArtifactInfoDeserializer extends JsonDeserializer<List<JsonArtifactInfo>> { +public class JsonArtifactInfoDeserializer extends JsonDeserializer<List<JsonArtifactInfo>>{ - @Override - public List<JsonArtifactInfo> deserialize(JsonParser jp, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - List<JsonArtifactInfo> jsonArtifactInfoList = new ObjectMapper().readValue(jp, new TypeReference<List<JsonArtifactInfo>>() { - }); + @Override + public List<JsonArtifactInfo> deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + List<JsonArtifactInfo> jsonArtifactInfoList = new ObjectMapper().readValue(jp, new TypeReference<List<JsonArtifactInfo>>(){}); - // For each artifact add the list of artifact retrieved - // This could be used later to index by UUID - for (JsonArtifactInfo artifactInfo : jsonArtifactInfoList) { - artifactInfo.addArtifactToUUIDMap(jsonArtifactInfoList); - } - return jsonArtifactInfoList; - } + // For each artifact add the list of artifact retrieved + // This could be used later to index by UUID + for (JsonArtifactInfo artifactInfo:jsonArtifactInfoList) { + artifactInfo.addArtifactToUUIDMap(jsonArtifactInfoList); + } + return jsonArtifactInfoList; + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonNotificationData.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonNotificationData.java index 7622a43a7b..cf041afd6c 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonNotificationData.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonNotificationData.java @@ -40,89 +40,89 @@ import org.openecomp.sdc.api.notification.IResourceInstance; public class JsonNotificationData implements INotificationData { - @JsonIgnore - private Map<String, Object> attributesMap = new HashMap<>(); - - @JsonProperty("serviceArtifacts") - @JsonDeserialize(using = JsonArtifactInfoDeserializer.class) - private List<IArtifactInfo> serviceArtifacts; - - @JsonProperty("resources") - @JsonDeserialize(using = JsonResourceInfoDeserializer.class) - private List<IResourceInstance> resourcesList; - - public JsonNotificationData() { - - } - - /** - * Method instantiate a INotificationData implementation from a JSON file. - * - * @param notifFilePath The file path in String - * @return A JsonNotificationData instance - * @throws IOException in case of the file is not readable or not accessible - */ - public static JsonNotificationData instantiateNotifFromJsonFile(String notifFilePath) throws IOException { - - InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(notifFilePath + "/notif-structure.json"); - - if (is == null) { - throw new FileExistsException("Resource Path does not exist: " + notifFilePath); - } - ObjectMapper mapper = new ObjectMapper(); - return mapper.readValue(is, JsonNotificationData.class); - } - - @SuppressWarnings("unused") - @JsonAnySetter - public final void setAttribute(String attrName, Object attrValue) { - if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { - this.attributesMap.put(attrName, attrValue); - } - } - - @Override - public IArtifactInfo getArtifactMetadataByUUID(String arg0) { - return null; - } - - @Override - public String getDistributionID() { - return (String) this.attributesMap.get("distributionID"); - } - - @Override - public List<IResourceInstance> getResources() { - return resourcesList; - } - - @Override - public List<IArtifactInfo> getServiceArtifacts() { - return this.serviceArtifacts; - } - - @Override - public String getServiceDescription() { - return (String) this.attributesMap.get("serviceDescription"); - } - - @Override - public String getServiceInvariantUUID() { - return (String) this.attributesMap.get("serviceInvariantUUID"); - } - - @Override - public String getServiceName() { - return (String) this.attributesMap.get("serviceName"); - } - - @Override - public String getServiceUUID() { - return (String) this.attributesMap.get("serviceUUID"); - } - - @Override - public String getServiceVersion() { - return (String) this.attributesMap.get("serviceVersion"); - } + @JsonIgnore + private Map<String,Object> attributesMap = new HashMap<>(); + + @JsonProperty("serviceArtifacts") + @JsonDeserialize(using=JsonArtifactInfoDeserializer.class) + private List<IArtifactInfo> serviceArtifacts; + + @JsonProperty("resources") + @JsonDeserialize(using=JsonResourceInfoDeserializer.class) + private List<IResourceInstance> resourcesList; + + public JsonNotificationData() { + + } + + /** + * Method instantiate a INotificationData implementation from a JSON file. + * + * @param notifFilePath The file path in String + * @return A JsonNotificationData instance + * @throws IOException in case of the file is not readable or not accessible + */ + public static JsonNotificationData instantiateNotifFromJsonFile(String notifFilePath) throws IOException { + + InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(notifFilePath+"/notif-structure.json"); + + if (is == null) { + throw new FileExistsException("Resource Path does not exist: "+notifFilePath); + } + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(is, JsonNotificationData.class); + } + + @SuppressWarnings("unused") + @JsonAnySetter + public final void setAttribute(String attrName, Object attrValue) { + if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { + this.attributesMap.put(attrName,attrValue); + } + } + + @Override + public IArtifactInfo getArtifactMetadataByUUID(String arg0) { + return null; + } + + @Override + public String getDistributionID() { + return (String)this.attributesMap.get("distributionID"); + } + + @Override + public List<IResourceInstance> getResources() { + return resourcesList; + } + + @Override + public List<IArtifactInfo> getServiceArtifacts() { + return this.serviceArtifacts; + } + + @Override + public String getServiceDescription() { + return (String)this.attributesMap.get("serviceDescription"); + } + + @Override + public String getServiceInvariantUUID() { + return (String)this.attributesMap.get("serviceInvariantUUID"); + } + + @Override + public String getServiceName() { + return (String)this.attributesMap.get("serviceName"); + } + + @Override + public String getServiceUUID() { + return (String)this.attributesMap.get("serviceUUID"); + } + + @Override + public String getServiceVersion() { + return (String)this.attributesMap.get("serviceVersion"); + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfo.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfo.java index a717238bb9..af49ee0d37 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfo.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfo.java @@ -34,72 +34,72 @@ import org.openecomp.sdc.api.notification.IResourceInstance; public class JsonResourceInfo implements IResourceInstance { - @JsonIgnore - private Map<String, Object> attributesMap = new HashMap<>(); - - @JsonProperty("artifacts") - @JsonDeserialize(using = JsonArtifactInfoDeserializer.class) - private List<IArtifactInfo> artifacts; - - public JsonResourceInfo() { - - } - - @Override - public List<IArtifactInfo> getArtifacts() { - return artifacts; - } - - @Override - public String getResourceInstanceName() { - return (String) attributesMap.get("resourceInstanceName"); - } - - @Override - public String getResourceInvariantUUID() { - return (String) attributesMap.get("resourceInvariantUUID"); - } - - @Override - public String getResourceName() { - return (String) attributesMap.get("resourceName"); - } - - @Override - public String getResourceType() { - return (String) attributesMap.get("resourceType"); - } - - @Override - public String getResourceUUID() { - return (String) attributesMap.get("resourceUUID"); - } - - @Override - public String getResourceVersion() { - return (String) attributesMap.get("resourceVersion"); - } - - @Override - public String getResourceCustomizationUUID() { - return (String) attributesMap.get("resourceCustomizationUUID"); - } - - @Override - public String getSubcategory() { - return (String) attributesMap.get("subCategory"); - } - - @Override - public String getCategory() { - return (String) attributesMap.get("category"); - } - - @SuppressWarnings("unused") - @JsonAnySetter - public final void setAttribute(String attrName, Object attrValue) { - if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { - this.attributesMap.put(attrName, attrValue); - } - } + @JsonIgnore + private Map<String,Object> attributesMap = new HashMap<>(); + + @JsonProperty("artifacts") + @JsonDeserialize(using=JsonArtifactInfoDeserializer.class) + private List<IArtifactInfo> artifacts; + + public JsonResourceInfo() { + + } + + @Override + public List<IArtifactInfo> getArtifacts() { + return artifacts; + } + + @Override + public String getResourceInstanceName() { + return (String)attributesMap.get("resourceInstanceName"); + } + + @Override + public String getResourceInvariantUUID() { + return (String)attributesMap.get("resourceInvariantUUID"); + } + + @Override + public String getResourceName() { + return (String)attributesMap.get("resourceName"); + } + + @Override + public String getResourceType() { + return (String)attributesMap.get("resourceType"); + } + + @Override + public String getResourceUUID() { + return (String)attributesMap.get("resourceUUID"); + } + + @Override + public String getResourceVersion() { + return (String)attributesMap.get("resourceVersion"); + } + + @Override + public String getResourceCustomizationUUID() { + return (String)attributesMap.get("resourceCustomizationUUID"); + } + + @Override + public String getSubcategory() { + return (String)attributesMap.get("subCategory"); + } + + @Override + public String getCategory() { + return (String)attributesMap.get("category"); + } + + @SuppressWarnings("unused") + @JsonAnySetter + public final void setAttribute(String attrName, Object attrValue) { + if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { + this.attributesMap.put(attrName,attrValue); + } + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfoDeserializer.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfoDeserializer.java index b1cf82af63..5b18a2cbc9 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfoDeserializer.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonResourceInfoDeserializer.java @@ -30,15 +30,14 @@ import org.codehaus.jackson.map.JsonDeserializer; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -public class JsonResourceInfoDeserializer extends JsonDeserializer<List<JsonResourceInfo>> { +public class JsonResourceInfoDeserializer extends JsonDeserializer<List<JsonResourceInfo>>{ - @Override - public List<JsonResourceInfo> deserialize(JsonParser jp, DeserializationContext ctxt) - throws IOException, JsonProcessingException { - List<JsonResourceInfo> jsonResourceInfoList = new ObjectMapper().readValue(jp, new TypeReference<List<JsonResourceInfo>>() { - }); - - return jsonResourceInfoList; - } + @Override + public List<JsonResourceInfo> deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + List<JsonResourceInfo> jsonResourceInfoList = new ObjectMapper().readValue(jp, new TypeReference<List<JsonResourceInfo>>(){}); + + return jsonResourceInfoList; + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonVfModuleMetaData.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonVfModuleMetaData.java index 08fd140bda..08d9895a53 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonVfModuleMetaData.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/asdc/notif_emulator/JsonVfModuleMetaData.java @@ -31,53 +31,53 @@ import org.openecomp.sdc.api.notification.IVfModuleMetadata; public class JsonVfModuleMetaData implements IVfModuleMetadata { - @JsonProperty("artifacts") - private List<String> artifacts; + @JsonProperty("artifacts") + private List<String> artifacts; + + @JsonIgnore + private Map<String,Object> attributesMap = new HashMap<>(); + + @Override + public List<String> getArtifacts() { + return artifacts; + } - @JsonIgnore - private Map<String, Object> attributesMap = new HashMap<>(); + @Override + public String getVfModuleModelDescription() { + return (String)attributesMap.get("vfModuleModelDescription"); + } - @Override - public List<String> getArtifacts() { - return artifacts; - } + @Override + public String getVfModuleModelInvariantUUID() { + return (String)attributesMap.get("vfModuleModelInvariantUUID"); + } - @Override - public String getVfModuleModelDescription() { - return (String) attributesMap.get("vfModuleModelDescription"); - } + @Override + public String getVfModuleModelName() { + return (String)attributesMap.get("vfModuleModelName"); + } - @Override - public String getVfModuleModelInvariantUUID() { - return (String) attributesMap.get("vfModuleModelInvariantUUID"); - } + @Override + public String getVfModuleModelUUID() { + return (String)attributesMap.get("vfModuleModelUUID"); + } - @Override - public String getVfModuleModelName() { - return (String) attributesMap.get("vfModuleModelName"); - } + @Override + public String getVfModuleModelVersion() { + return (String)attributesMap.get("vfModuleModelVersion"); + } - @Override - public String getVfModuleModelUUID() { - return (String) attributesMap.get("vfModuleModelUUID"); - } - - @Override - public String getVfModuleModelVersion() { - return (String) attributesMap.get("vfModuleModelVersion"); - } - - @Override - public boolean isBase() { - return (boolean) attributesMap.get("isBase"); - } - - @SuppressWarnings("unused") - @JsonAnySetter - public final void setAttribute(String attrName, Object attrValue) { - if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { - this.attributesMap.put(attrName, attrValue); - } - } + @Override + public boolean isBase() { + return (boolean)attributesMap.get("isBase"); + } + + @SuppressWarnings("unused") + @JsonAnySetter + public final void setAttribute(String attrName, Object attrValue) { + if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) { + this.attributesMap.put(attrName,attrValue); + } + } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/jmeter/JMeterITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/jmeter/JMeterITCase.java index 72a957f45a..0bf9eac915 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/jmeter/JMeterITCase.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/jmeter/JMeterITCase.java @@ -50,80 +50,80 @@ import org.openecomp.mso.global_tests.ArquillianPackagerForITCases; @RunWith(Arquillian.class) public class JMeterITCase { - - @Deployment(name = "mso-api-handler-infra", testable = false) - public static Archive<?> createMsoApiHandlerInfraWarDeployment() { - System.out.println("Deploying ApiHandler Infra WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../mso-api-handlers/mso-api-handler-infra/target/", "mso-api-handler-infra*.war", "mso-api-handler-infra.war"); - } - - @Deployment(name = "mso-vnf-adapter", testable = false) - public static Archive<?> createMsoVnfAdapterWarDeployment() { - System.out.println("Deploying VNF Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-vnf-adapter/target/", "mso-vnf-adapter*.war", "mso-vnf-adapter.war"); - } - - @Deployment(name = "mso-tenant-adapter", testable = false) - public static Archive<?> createMsoTenantAdapterWarDeployment() { - System.out.println("Deploying Tenant Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-tenant-adapter/target/", "mso-tenant-adapter*.war", "mso-tenant-adapter.war"); - } - - @Deployment(name = "mso-sdnc-adapter", testable = false) - public static Archive<?> createMsoSdncAdapterWarDeployment() { - System.out.println("Deploying SDNC Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-sdnc-adapter/target/", "mso-sdnc-adapter*.war", "mso-sdnc-adapter.war"); - } - - @Deployment(name = "mso-network-adapter", testable = false) - public static Archive<?> createMsoNetworkAdapterWarDeployment() { - System.out.println("Deploying Network Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-network-adapter/target/", "mso-network-adapter*.war", "mso-network-adapter.war"); - } - - @Deployment(name = "mso-requests-db-adapter", testable = false) - public static Archive<?> createMsoRequestsDbAdapterWarDeployment() { - System.out.println("Deploying Requests DB Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-requests-db-adapter/target/", "mso-requests-db-adapter*.war", "mso-requests-db-adapter.war"); - } - - @Deployment(name = "asdc-controller", testable = true) - public static Archive<?> createAsdcControllerWarDeployment() { - System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); - - WebArchive warArchive = (WebArchive) ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); - - // Add the current test class - JavaArchive testclasses = ShrinkWrap.create(JavaArchive.class, "testClasses.jar"); - testclasses.addClasses(JMeterITCase.class); - - warArchive.addAsLibraries(testclasses); - - // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml - warArchive.addAsLibraries(Maven.resolver() - .resolve("org.mockito:mockito-all:1.10.19") - .withoutTransitivity() - .asFile()); - - // Take one war randomly to make arquilian happy - - Testable.archiveToTest(warArchive); - - - return warArchive; - } - - + + @Deployment(name="mso-api-handler-infra",testable=false) + public static Archive<?> createMsoApiHandlerInfraWarDeployment () { + System.out.println("Deploying ApiHandler Infra WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../mso-api-handlers/mso-api-handler-infra/target/", "mso-api-handler-infra*.war", "mso-api-handler-infra.war"); + } + + @Deployment(name="mso-vnf-adapter",testable=false) + public static Archive<?> createMsoVnfAdapterWarDeployment () { + System.out.println("Deploying VNF Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-vnf-adapter/target/", "mso-vnf-adapter*.war", "mso-vnf-adapter.war"); + } + + @Deployment(name="mso-tenant-adapter",testable=false) + public static Archive<?> createMsoTenantAdapterWarDeployment () { + System.out.println("Deploying Tenant Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-tenant-adapter/target/", "mso-tenant-adapter*.war", "mso-tenant-adapter.war"); + } + + @Deployment(name="mso-sdnc-adapter",testable=false) + public static Archive<?> createMsoSdncAdapterWarDeployment () { + System.out.println("Deploying SDNC Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-sdnc-adapter/target/", "mso-sdnc-adapter*.war", "mso-sdnc-adapter.war"); + } + + @Deployment(name="mso-network-adapter",testable=false) + public static Archive<?> createMsoNetworkAdapterWarDeployment () { + System.out.println("Deploying Network Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-network-adapter/target/", "mso-network-adapter*.war", "mso-network-adapter.war"); + } + + @Deployment(name="mso-requests-db-adapter",testable=false) + public static Archive<?> createMsoRequestsDbAdapterWarDeployment () { + System.out.println("Deploying Requests DB Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-requests-db-adapter/target/", "mso-requests-db-adapter*.war", "mso-requests-db-adapter.war"); + } + + @Deployment(name="asdc-controller",testable=true) + public static Archive<?> createAsdcControllerWarDeployment () { + System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); + + WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); + + // Add the current test class + JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar"); + testclasses.addClasses(JMeterITCase.class); + + warArchive.addAsLibraries(testclasses); + + // BE CAREFUL a settings.xml file must be located in ${home.user}/.m2/settings.xml + warArchive.addAsLibraries(Maven.resolver() + .resolve("org.mockito:mockito-all:1.10.19") + .withoutTransitivity () + .asFile ()); + + // Take one war randomly to make arquilian happy + + Testable.archiveToTest(warArchive); + + + return warArchive; + } + + @BeforeClass - public static void waitBeforeStart() throws InterruptedException { - System.out.println("Executing " + JMeterITCase.class.getName()); - + public static void waitBeforeStart () throws InterruptedException { + System.out.println ("Executing " + JMeterITCase.class.getName ()); + } @Test - @RunAsClient() - public void testJMeter() throws IOException { - // JMeter Engine + @RunAsClient() + public void testJMeter() throws IOException { + // JMeter Engine StandardJMeterEngine jmeter = new StandardJMeterEngine(); @@ -132,12 +132,12 @@ public class JMeterITCase { JMeterUtils.setJMeterHome("/tmp/apache-jmeter-2.13"); JMeterUtils.initLogging();// you can comment this line out to see extra log messages of i.e. DEBUG level JMeterUtils.initLocale(); - + // Initialize JMeter SaveService SaveService.loadProperties(); // Load existing .jmx Test Plan - + FileInputStream in = new FileInputStream("./src/test/resources/JMeter/MSO-Perf.jmx"); HashTree testPlanTree = SaveService.loadTree(in); testPlanTree.getTree("test variables"); @@ -146,21 +146,21 @@ public class JMeterITCase { // Run JMeter Test jmeter.configure(testPlanTree); jmeter.run(); - } + } @AfterClass public static void afterArquillianTest() { - try { - Files.move(Paths.get("./jmeter.log"), - Paths.get("./target/surefire-reports/jmeter.log"), - StandardCopyOption.REPLACE_EXISTING); - + try { + Files.move (Paths.get ("./jmeter.log"), + Paths.get ("./target/surefire-reports/jmeter.log"), + StandardCopyOption.REPLACE_EXISTING); + /* Files.move (Paths.get ("./mso-perf.jtl"), Paths.get ("./target/surefire-reports/mso-perf.log"), StandardCopyOption.REPLACE_EXISTING);*/ - } catch (IOException e) { - e.printStackTrace(); - } + } catch (IOException e) { + e.printStackTrace(); + } } } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/logging/LogsCheckerITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/logging/LogsCheckerITCase.java index 56bea0f6b3..bae9af5cc1 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/logging/LogsCheckerITCase.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/logging/LogsCheckerITCase.java @@ -47,60 +47,62 @@ import org.openecomp.mso.global_tests.ArquillianPackagerForITCases; @RunWith(Arquillian.class) public class LogsCheckerITCase { - + @BeforeClass - public static void waitBeforeStart() throws InterruptedException { - System.out.println("Executing " + LogsCheckerITCase.class.getName()); - - } - - @Deployment(name = "log-check", testable = true) - public static Archive<?> createAsdcControllerWarDeployment() throws Exception { - // Any war could be used here, we just take that one randomly - // Be careful some WAR does not work when being injected in JBOSS, probably due to Servlet conflict - System.out.println("Deploying ASDC Controller WAR for log checker"); - WebArchive warArchive = (WebArchive) ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); - - JavaArchive testclasses = ShrinkWrap.create(JavaArchive.class, "testClasses.jar"); - - testclasses.addPackage("org.openecomp.mso.filesearching"); - - warArchive.addAsLibraries(testclasses); - - Testable.archiveToTest(warArchive); - return warArchive; - } - - @Before - public void beforeEachTest() { - LogFileSearching.initFile("/tmp/mso-log-checker.log"); - } - - @After - public void afterEachTest() { - LogFileSearching.closeFile(); + public static void waitBeforeStart () throws InterruptedException { + System.out.println ("Executing " + LogsCheckerITCase.class.getName ()); + } - + + @Deployment(name="log-check",testable=true) + public static Archive<?> createAsdcControllerWarDeployment () throws Exception { + // Any war could be used here, we just take that one randomly + // Be careful some WAR does not work when being injected in JBOSS, probably due to Servlet conflict + System.out.println("Deploying ASDC Controller WAR for log checker"); + WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); + + JavaArchive testclasses = ShrinkWrap.create (JavaArchive.class, "testClasses.jar"); + + testclasses.addPackage("org.openecomp.mso.filesearching"); + + warArchive.addAsLibraries(testclasses); + + Testable.archiveToTest(warArchive); + return warArchive; + } + + @Before + public void beforeEachTest() { + LogFileSearching.initFile("/tmp/mso-log-checker.log"); + } + + @After + public void afterEachTest() { + LogFileSearching.closeFile(); + } + @Test - @OperateOnDeployment("log-check") - public void testJbossServerLog() throws IOException { - - File serverLogs = new File("/opt/jboss/standalone/log"); - //File serverLogs = new File("/tmp/jbosslogs/server.log"); - - assertFalse(LogFileSearching.searchInDirectoryForCommonIssues(null, serverLogs)); - + @OperateOnDeployment("log-check") + public void testJbossServerLog() throws IOException { + + File serverLogs = new File("/opt/jboss/standalone/log"); + //File serverLogs = new File("/tmp/jbosslogs/server.log"); + + assertFalse(LogFileSearching.searchInDirectoryForCommonIssues(null, serverLogs)); + } - + @Test @OperateOnDeployment("log-check") - public void testMSOLog() throws IOException { - //File serverLogs = new File("/opt/app/mso/jboss-eap-6.2/standalone/log/server.log"); - File msoLogs = new File("/var/log/ecomp/MSO"); - - assertFalse(LogFileSearching.searchInDirectoryForCommonIssues(null, msoLogs)); - + public void testMSOLog() throws IOException { + //File serverLogs = new File("/opt/app/mso/jboss-eap-6.2/standalone/log/server.log"); + File msoLogs = new File("/var/log/ecomp/MSO"); + + assertFalse(LogFileSearching.searchInDirectoryForCommonIssues(null, msoLogs)); + } - - + + + + } diff --git a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java index fe05e4ae3a..868de8d089 100644 --- a/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java +++ b/packages/arquillian-unit-tests/src/test/java/org/openecomp/mso/global_tests/soapui/SoapUiITCase.java @@ -54,63 +54,63 @@ import com.eviware.soapui.tools.SoapUITestCaseRunner; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SoapUiITCase { - private static String jbossHost = System.getProperty("docker.hostname"); - private static String jbossPort = "18080"; - - @Deployment(name = "mso-api-handler-infra", testable = false) - public static Archive<?> createMsoApiHandlerInfraWarDeployment() { - System.out.println("Deploying ApiHandler Infra WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../mso-api-handlers/mso-api-handler-infra/target/", "mso-api-handler-infra*.war", "mso-api-handler-infra.war"); - } - - @Deployment(name = "mso-vnf-adapter", testable = false) - public static Archive<?> createMsoVnfAdapterWarDeployment() { - System.out.println("Deploying VNF Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-vnf-adapter/target/", "mso-vnf-adapter*.war", "mso-vnf-adapter.war"); - } - - @Deployment(name = "mso-tenant-adapter", testable = false) - public static Archive<?> createMsoTenantAdapterWarDeployment() { - System.out.println("Deploying Tenant Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-tenant-adapter/target/", "mso-tenant-adapter*.war", "mso-tenant-adapter.war"); - } - - @Deployment(name = "mso-sdnc-adapter", testable = false) - public static Archive<?> createMsoSdncAdapterWarDeployment() { - System.out.println("Deploying SDNC Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-sdnc-adapter/target/", "mso-sdnc-adapter*.war", "mso-sdnc-adapter.war"); - } - - @Deployment(name = "mso-network-adapter", testable = false) - public static Archive<?> createMsoNetworkAdapterWarDeployment() { - System.out.println("Deploying Network Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-network-adapter/target/", "mso-network-adapter*.war", "mso-network-adapter.war"); - } - - @Deployment(name = "mso-requests-db-adapter", testable = false) - public static Archive<?> createMsoRequestsDbAdapterWarDeployment() { - System.out.println("Deploying Requests DB Adapter WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-requests-db-adapter/target/", "mso-requests-db-adapter*.war", "mso-requests-db-adapter.war"); - } - - @Deployment(name = "asdc-controller", testable = true) - public static Archive<?> createAsdcControllerWarDeployment() { - System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); - - WebArchive warArchive = (WebArchive) ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); - - // Take one war randomly to make arquilian happy - - - return warArchive; - } - - @Deployment(name = "infrastructure-bpmn", testable = false) - public static Archive<?> createInfraBPMNDeployment() { - System.out.println("Deploying Infrastructure BPMN WAR on default server"); - return ArquillianPackagerForITCases.createPackageFromExistingOne("../../bpmn/MSOInfrastructureBPMN/target/", - "MSOInfrastructureBPMN*.war", "MSOInfrastructureBPMN.war"); - } + private static String jbossHost=System.getProperty("docker.hostname"); + private static String jbossPort="18080"; + + @Deployment(name="mso-api-handler-infra",testable=false) + public static Archive<?> createMsoApiHandlerInfraWarDeployment () { + System.out.println("Deploying ApiHandler Infra WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../mso-api-handlers/mso-api-handler-infra/target/", "mso-api-handler-infra*.war", "mso-api-handler-infra.war"); + } + + @Deployment(name="mso-vnf-adapter",testable=false) + public static Archive<?> createMsoVnfAdapterWarDeployment () { + System.out.println("Deploying VNF Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-vnf-adapter/target/", "mso-vnf-adapter*.war", "mso-vnf-adapter.war"); + } + + @Deployment(name="mso-tenant-adapter",testable=false) + public static Archive<?> createMsoTenantAdapterWarDeployment () { + System.out.println("Deploying Tenant Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-tenant-adapter/target/", "mso-tenant-adapter*.war", "mso-tenant-adapter.war"); + } + + @Deployment(name="mso-sdnc-adapter",testable=false) + public static Archive<?> createMsoSdncAdapterWarDeployment () { + System.out.println("Deploying SDNC Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-sdnc-adapter/target/", "mso-sdnc-adapter*.war", "mso-sdnc-adapter.war"); + } + + @Deployment(name="mso-network-adapter",testable=false) + public static Archive<?> createMsoNetworkAdapterWarDeployment () { + System.out.println("Deploying Network Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-network-adapter/target/", "mso-network-adapter*.war", "mso-network-adapter.war"); + } + + @Deployment(name="mso-requests-db-adapter",testable=false) + public static Archive<?> createMsoRequestsDbAdapterWarDeployment () { + System.out.println("Deploying Requests DB Adapter WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../adapters/mso-requests-db-adapter/target/", "mso-requests-db-adapter*.war", "mso-requests-db-adapter.war"); + } + + @Deployment(name="asdc-controller",testable=true) + public static Archive<?> createAsdcControllerWarDeployment () { + System.out.println("Deploying ASDC Controller WAR with additional resources on default server"); + + WebArchive warArchive = (WebArchive)ArquillianPackagerForITCases.createPackageFromExistingOne("../../asdc-controller/target/", "asdc-controller*.war", "asdc-controller.war"); + + // Take one war randomly to make arquilian happy + + + return warArchive; + } + + @Deployment(name = "infrastructure-bpmn", testable = false) + public static Archive<?> createInfraBPMNDeployment() { + System.out.println("Deploying Infrastructure BPMN WAR on default server"); + return ArquillianPackagerForITCases.createPackageFromExistingOne("../../bpmn/MSOInfrastructureBPMN/target/", + "MSOInfrastructureBPMN*.war", "MSOInfrastructureBPMN.war"); + } /* @Deployment(name = "SoapUIMocks", testable = false) public static Archive <?> createSoapUIMocksWarDeployment () { @@ -125,129 +125,129 @@ public class SoapUiITCase { }*/ @BeforeClass - public static void waitBeforeStart() throws InterruptedException { - Thread.currentThread().sleep(10000); - System.out.println("Executing " + SoapUiITCase.class.getName()); - + public static void waitBeforeStart () throws InterruptedException { + Thread.currentThread().sleep(10000); + System.out.println ("Executing " + SoapUiITCase.class.getName ()); + } @Test @RunAsClient - public void test01Healthcheck() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test01Healthcheck () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/Healthcheck-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + runner.setProjectFile ("./src/test/resources/SoapUI/Healthcheck-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[7]; - properties[0] = "apihhost=" + jbossHost + ":" + jbossPort; - properties[1] = "jrahost=" + jbossHost + ":" + jbossPort; + properties[0] = "apihhost="+jbossHost+":"+jbossPort; + properties[1] = "jrahost="+jbossHost+":"+jbossPort; properties[2] = "userlogin=sitecontrol"; properties[3] = "userpassword=Domain2.0!"; - properties[4] = "bpmnhost=" + jbossHost + ":" + jbossPort; + properties[4] = "bpmnhost="+jbossHost+":"+jbossPort; properties[5] = "sitename=mso-docker"; properties[6] = "enableBpmn=false"; - runner.setProjectProperties(properties); + runner.setProjectProperties (properties); try { - runner.setTestSuite("Healthcheck TestSuite"); - runner.run(); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + runner.setTestSuite ("Healthcheck TestSuite"); + runner.run (); + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace (); fail("Failure in SOAPUI Healthcheck"); } } @Test @RunAsClient - public void test02ApiHandlerInfra() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test02ApiHandlerInfra () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/Local-API-Handler-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + runner.setProjectFile ("./src/test/resources/SoapUI/Local-API-Handler-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[3]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; + properties[0] = "host="+jbossHost+":"+jbossPort; properties[1] = "user-infraportal=InfraPortalClient"; properties[2] = "password-infraportal=password1$"; - runner.setProjectProperties(properties); + runner.setProjectProperties (properties); try { - runner.setTestSuite("simple_tests_endpoints"); - runner.run(); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + runner.setTestSuite ("simple_tests_endpoints"); + runner.run (); + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace (); fail("Failure in SOAPUI ApiHandler Infra"); } } @Test @RunAsClient - public void test03StartNetworkAdapter() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test03StartNetworkAdapter () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/MSONetworkAdapter-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); - String[] properties = new String[1]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; - runner.setProjectProperties(properties); - - - try { - runner.setTestSuite("MsoNetworkAdapter TestSuite"); - runner.run(); - - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { - assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); - } - assertTrue(runner.getFailedTests().size() == 0); - - } catch (Exception e) { - e.printStackTrace(); - fail("Failure in SOAPUI NetworkAdapter"); - } + runner.setProjectFile ("./src/test/resources/SoapUI/MSONetworkAdapter-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); + String[] properties = new String[1]; + properties[0] = "host="+jbossHost+":"+jbossPort; + runner.setProjectProperties (properties); + + + try { + runner.setTestSuite ("MsoNetworkAdapter TestSuite"); + runner.run (); + + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { + assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); + } + assertTrue (runner.getFailedTests ().size () == 0); + + } catch (Exception e) { + e.printStackTrace (); + fail("Failure in SOAPUI NetworkAdapter"); + } } @Test @RunAsClient - public void test04StartVnfAdapter() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test04StartVnfAdapter () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/MSOVnfAdapter-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + runner.setProjectFile ("./src/test/resources/SoapUI/MSOVnfAdapter-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[1]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; - runner.setProjectProperties(properties); + properties[0] = "host="+jbossHost+":"+jbossPort; + runner.setProjectProperties (properties); try { - runner.setTestSuite("MsoVnfAdapter TestSuite"); - runner.run(); + runner.setTestSuite ("MsoVnfAdapter TestSuite"); + runner.run (); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace (); fail("Failure in SOAPUI VnfAdapter"); } } @@ -255,30 +255,30 @@ public class SoapUiITCase { @Test @RunAsClient - public void test05StartTenantAdapter() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test05StartTenantAdapter () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/MSOTenantAdapter-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + runner.setProjectFile ("./src/test/resources/SoapUI/MSOTenantAdapter-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[3]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; + properties[0] = "host="+jbossHost+":"+jbossPort; properties[1] = "user-bpel=BPELClient"; properties[2] = "password-bpel=password1$"; - runner.setProjectProperties(properties); + runner.setProjectProperties (properties); try { - runner.setTestSuite("MsoTenantAdapter TestSuite"); - runner.run(); + runner.setTestSuite ("MsoTenantAdapter TestSuite"); + runner.run (); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace (); fail("Failure in SOAPUI TenantAdapter"); } } @@ -286,63 +286,63 @@ public class SoapUiITCase { @Test @RunAsClient - public void test06StartRequestDBAdapter() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); + public void test06StartRequestDBAdapter () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/MsoRequestDB-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + runner.setProjectFile ("./src/test/resources/SoapUI/MsoRequestDB-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[3]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; + properties[0] = "host="+jbossHost+":"+jbossPort; properties[1] = "user-infraportal=InfraPortalClient"; properties[2] = "password-infraportal=password1$"; - runner.setProjectProperties(properties); + runner.setProjectProperties (properties); try { - runner.setTestSuite("MsoRequestsDbAdapterImplPortBinding TestSuite"); - runner.run(); + runner.setTestSuite ("MsoRequestsDbAdapterImplPortBinding TestSuite"); + runner.run (); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); - fail("Failure in SOAPUI RequestDB adapter"); + e.printStackTrace (); + fail("Failure in SOAPUI RequestDB adapter"); } } @Test @RunAsClient - public void test07MsoConfigEndpoints() { - SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); - runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); - runner.setJUnitReport(true); - runner.setProjectFile("./src/test/resources/SoapUI/MSOConfig-soapui-project.xml"); - runner.setOutputFolder("./target/surefire-reports"); + public void test07MsoConfigEndpoints () { + SoapUITestCaseRunner runner = new SoapUITestCaseRunner (); + runner.setSettingsFile("./src/test/resources/SoapUI/soapui-settings.xml"); + runner.setJUnitReport(true); + runner.setProjectFile ("./src/test/resources/SoapUI/MSOConfig-soapui-project.xml"); + runner.setOutputFolder ("./target/surefire-reports"); String[] properties = new String[3]; - properties[0] = "host=" + jbossHost + ":" + jbossPort; + properties[0] = "host="+jbossHost+":"+jbossPort; properties[1] = "user-infraportal=InfraPortalClient"; properties[2] = "password-infraportal=password1$"; - runner.setProjectProperties(properties); + runner.setProjectProperties (properties); try { - runner.setTestSuite("test_config_endpoints TestSuite"); - runner.run(); + runner.setTestSuite ("test_config_endpoints TestSuite"); + runner.run (); - Map<TestAssertion, WsdlTestStepResult> mapResult = runner.getAssertionResults(); - for (Map.Entry<TestAssertion, WsdlTestStepResult> entry : mapResult.entrySet()) { + Map<TestAssertion,WsdlTestStepResult> mapResult= runner.getAssertionResults(); + for(Map.Entry<TestAssertion,WsdlTestStepResult> entry : mapResult.entrySet()) { assertTrue(entry.getValue().getStatus().equals(TestStepStatus.OK)); } - assertTrue(runner.getFailedTests().size() == 0); + assertTrue (runner.getFailedTests ().size () == 0); } catch (Exception e) { - e.printStackTrace(); - fail("Failure in SOAPUI MSOConfig Endpoints"); + e.printStackTrace (); + fail("Failure in SOAPUI MSOConfig Endpoints"); } } } |