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 0810976 commit 1f6b099
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ public static void main(String[] arg) {
LOGGER.info(String.format("ENV %s = %s%n", envName, envMap.get(envName)));
}
ExtractResource.removeOldMosipTestTestResource();
if (checkRunType().equalsIgnoreCase("JAR")) {
if (getRunType().equalsIgnoreCase("JAR")) {
ExtractResource.extractCommonResourceFromJar();
} else {
ExtractResource.copyCommonResources();
}
PreRegConfigManager.init();
BaseTestCase.suiteSetup();
BaseTestCase.suiteSetup(getRunType());
SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt");
setLogLevels();

Expand All @@ -94,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;
Expand Down Expand Up @@ -125,7 +125,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 @@ -156,10 +156,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 @@ -173,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))
Expand All @@ -192,9 +192,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 @@ -294,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
Expand Down

0 comments on commit 1f6b099

Please sign in to comment.