diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java index fa22ae839c..3d633d5144 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/BaseTestCase.java @@ -19,7 +19,6 @@ import org.apache.log4j.PropertyConfigurator; import org.json.JSONArray; import org.json.simple.JSONObject; -import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.testng.ITestContext; import org.testng.annotations.AfterSuite; @@ -44,7 +43,7 @@ * All suite level before and after tests will be completed here. * */ -public class BaseTestCase extends AbstractTestNGSpringContextTests { +public class BaseTestCase { protected static Logger logger = Logger.getLogger(BaseTestCase.class); public static OTPListener otpListener = null; @@ -209,7 +208,7 @@ public static String getGlobalResourcePath() { if (runTypeS.equalsIgnoreCase("JAR")) { path = new File(jarURLS).getParentFile().getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; } else if (runTypeS.equalsIgnoreCase("IDE")) { - path = new File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath() + path = new File(BaseTestCase.class.getClassLoader().getResource("").getPath()).getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; if (path.contains(GlobalConstants.TESTCLASSES)) path = path.replace(GlobalConstants.TESTCLASSES, "classes"); diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/ExtractResource.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/ExtractResource.java index 47e585b786..246d3d902e 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/ExtractResource.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/ExtractResource.java @@ -58,7 +58,7 @@ public static void copyCommonResources(String moduleName) { public static void getListOfFilesFromJarAndCopyToExternalResource(String key) { ZipInputStream zipInputStream = null; try { - CodeSource src = MosipTestRunner.class.getProtectionDomain().getCodeSource(); + CodeSource src = BaseTestCase.class.getProtectionDomain().getCodeSource(); if (src != null) { URL jar = src.getLocation(); zipInputStream = new ZipInputStream(jar.openStream()); @@ -106,7 +106,7 @@ private static boolean copyFilesFromJarToOutsideResource(String resourceFilePare String resourceFileAbsolutePath = resourceFileParentPath + "MosipTemporaryTestResource/" + resourceFileName; File destinationFile = new File(resourceFileAbsolutePath); LOGGER.info("resourceFile : " + BaseTestCase.jarURLS + "destinationFile : " + resourceFileAbsolutePath); - org.apache.commons.io.FileUtils.copyInputStreamToFile(MosipTestRunner.class.getResourceAsStream("/" + resourceFileName), destinationFile); + org.apache.commons.io.FileUtils.copyInputStreamToFile(BaseTestCase.class.getResourceAsStream("/" + resourceFileName), destinationFile); return true; } catch (Exception e) { LOGGER.error( diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java deleted file mode 100644 index 4465045970..0000000000 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ /dev/null @@ -1,21 +0,0 @@ -package io.mosip.testrig.apirig.testrunner; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.log4j.Logger; - -/** - * Class to initiate mosip api test execution - * - * @author Vignesh - * - */ -public class MosipTestRunner { - private static final Logger LOGGER = Logger.getLogger(MosipTestRunner.class); - - public static String jarUrl = MosipTestRunner.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - public static List languageList = new ArrayList<>(); - - public static void main(String[] arg) {} -} \ No newline at end of file