Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-30000 | Commons cleanup | removed mosiptestrunner from commons and their dependency #1659

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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(
Expand Down

This file was deleted.

Loading