Skip to content

Commit

Permalink
MOSIP-36192
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <[email protected]>
  • Loading branch information
Sohandey committed Oct 3, 2024
1 parent 41cbabb commit 5faae00
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ 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();
}
IdAuthConfigManager.init();
BaseTestCase.suiteSetup();

BaseTestCase.suiteSetup(getRunType());
SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt");
setLogLevels();

Expand Down Expand Up @@ -115,7 +117,7 @@ public static void main(String[] arg) {
LOGGER.error("Exception " + e.getMessage());
}

MockSMTPListener.bTerminate = true;
OTPListener.bTerminate = true;

if (BaseTestCase.isTargetEnvLTS())
HealthChecker.bTerminate = true;
Expand Down Expand Up @@ -146,7 +148,7 @@ public static void startTestRunner() {
List<String> 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 {
Expand Down Expand Up @@ -177,10 +179,10 @@ public static void startTestRunner() {
*/
/*
* public static String getGlobalResourcePath() { if
* (checkRunType().equalsIgnoreCase("JAR")) { return new
* (getRunType().equalsIgnoreCase("JAR")) { return new
* File(jarUrl).getParentFile().getAbsolutePath() +
* "/MosipTestResource/MosipTemporaryTestResource"; } else if
* (checkRunType().equalsIgnoreCase("IDE")) { String path = new
* (getRunType().equalsIgnoreCase("IDE")) { String path = new
* File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).
* getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; if
* (path.contains(GlobalConstants.TESTCLASSES)) path =
Expand All @@ -194,9 +196,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))
Expand All @@ -213,9 +215,9 @@ public static String getGlobalResourcePath() {

public static String getResourcePath() {
return getGlobalResourcePath();
// if (checkRunType().equalsIgnoreCase("JAR")) {
// if (getRunType().equalsIgnoreCase("JAR")) {
// return new File(jarUrl).getParentFile().getAbsolutePath();
// } else if (checkRunType().equalsIgnoreCase("IDE")) {
// } else if (getRunType().equalsIgnoreCase("IDE")) {
// String path = new File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath();
// if (path.contains(GlobalConstants.TESTCLASSES))
// path = path.replace(GlobalConstants.TESTCLASSES, "classes");
Expand Down Expand Up @@ -315,7 +317,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
Expand Down

0 comments on commit 5faae00

Please sign in to comment.