diff options
Diffstat (limited to 'test-apis-ci')
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnboardingDataProviders.java (renamed from test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java) | 2 | ||||
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java | 4 | ||||
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java | 44 |
3 files changed, 32 insertions, 18 deletions
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnboardingDataProviders.java index 8b58ca9993..cf94c79462 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnboardingDataProviders.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class OnbordingDataProviders { +public class OnboardingDataProviders { protected static String filepath = FileHandling.getVnfRepositoryPath(); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java index ec83b05be9..44e386ada6 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java @@ -32,7 +32,7 @@ import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; import org.openecomp.sdc.ci.tests.api.ExtentTestActions; -import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders; +import org.openecomp.sdc.ci.tests.dataProviders.OnboardingDataProviders; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; @@ -78,7 +78,7 @@ public class Onboard extends ComponentBaseTest { } - @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List") + @Test(dataProviderClass = OnboardingDataProviders.class, dataProvider = "VNF_List") public void onboardVNFShotFlow(String filepath, String vnfFile) throws Exception, Throwable { setLog(vnfFile); System.out.println("print - >" + makeDistributionValue); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java index b82e6a0f52..c8f9ee4139 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java @@ -20,25 +20,37 @@ package org.openecomp.sdc.ci.tests.utils.general; -import com.aventstack.extentreports.Status; -import com.clearspring.analytics.util.Pair; -import org.apache.commons.io.FileUtils; -import org.openecomp.sdc.be.model.DataTypeDefinition; -import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; -import org.openecomp.sdc.ci.tests.config.Config; - -import org.openecomp.sdc.common.util.GeneralUtility; -import org.yaml.snakeyaml.Yaml; +import static org.testng.AssertJUnit.assertTrue; -import java.io.*; +import java.io.BufferedOutputStream; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; -import static org.testng.AssertJUnit.assertTrue; +import org.apache.commons.io.FileUtils; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; +import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.common.util.GeneralUtility; +import org.yaml.snakeyaml.Yaml; + +import com.aventstack.extentreports.Status; public class FileHandling { @@ -173,9 +185,9 @@ public class FileHandling { } public static List<String> filterFileNamesListFromFolder(String filepath, String extension) { + List<String> filenames = new ArrayList<String>(); try { File dir = new File(filepath); - List<String> filenames = new ArrayList<String>(); FilenameFilter extensionFilter = new FilenameFilter() { public boolean accept(File dir, String name) { @@ -193,7 +205,7 @@ public class FileHandling { } catch (Exception e) { e.printStackTrace(); } - return null; + return filenames; } public static String[] getArtifactsFromZip(String filepath, String zipFilename){ @@ -233,7 +245,9 @@ public class FileHandling { // } public static List<String> getZipFileNamesFromFolder(String filepath) { - return filterFileNamesListFromFolder(filepath, ".zip"); + List<String> fileNamesListFromFolder = filterFileNamesListFromFolder(filepath, ".zip"); + fileNamesListFromFolder.addAll(filterFileNamesListFromFolder(filepath, ".csar")); + return fileNamesListFromFolder; } public static int countFilesInZipFile(String[] artifactsArr, String reqExtension){ |