From 541fc49df901b9162b58c6897c10ec5f4b03784e Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Mon, 30 Sep 2024 18:51:26 +0530 Subject: [PATCH] MOSIP-35404 Signed-off-by: Nandhukumar --- .../apirig/testrunner/MosipTestRunner.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index c0d679e569..ba1f43916f 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -63,14 +63,15 @@ public static void main(String[] arg) { for (String envName : envMap.keySet()) { LOGGER.info(String.format("ENV %s = %s%n", envName, envMap.get(envName))); } + BaseTestCase.setRunContext(getRunType(), jarUrl); ExtractResource.removeOldMosipTestTestResource(); - if (checkRunType().equalsIgnoreCase("JAR")) { + if (getRunType().equalsIgnoreCase("JAR")) { ExtractResource.extractCommonResourceFromJar(); } else { ExtractResource.copyCommonResources(); } ConfigManager.init(); - BaseTestCase.suiteSetup(); + BaseTestCase.suiteSetup(getRunType()); SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt"); setLogLevels(); @@ -93,7 +94,7 @@ public static void main(String[] arg) { LOGGER.error("Exception " + e.getMessage()); } - MockSMTPListener.bTerminate = true; + OTPListener.bTerminate = true; if (BaseTestCase.isTargetEnvLTS()) HealthChecker.bTerminate = true; @@ -124,7 +125,7 @@ public static void startTestRunner() { List modulesToRun = BaseTestCase.listOfModules; String os = System.getProperty("os.name"); LOGGER.info(os); - if (checkRunType().contains("IDE") || os.toLowerCase().contains("windows")) { + if (getRunType().contains("IDE") || os.toLowerCase().contains("windows")) { homeDir = new File(System.getProperty("user.dir") + "/testNgXmlFiles"); LOGGER.info("IDE :" + homeDir); } else { @@ -172,9 +173,9 @@ public static String getGlobalResourcePath() { } String path = null; - if (checkRunType().equalsIgnoreCase("JAR")) { + if (getRunType().equalsIgnoreCase("JAR")) { path = new File(jarUrl).getParentFile().getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; - } else if (checkRunType().equalsIgnoreCase("IDE")) { + } else if (getRunType().equalsIgnoreCase("IDE")) { path = new File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; if (path.contains(GlobalConstants.TESTCLASSES)) @@ -293,7 +294,7 @@ public static Properties getproperty(String path) { * * @return */ - public static String checkRunType() { + public static String getRunType() { if (MosipTestRunner.class.getResource("MosipTestRunner.class").getPath().contains(".jar")) return "JAR"; else