Skip to content

Commit

Permalink
Merge pull request #654 from pg-techno123/develop
Browse files Browse the repository at this point in the history
MOSIP-35842
  • Loading branch information
lsivanand authored Sep 17, 2024
2 parents 37d8ca7 + 34dd613 commit 5a3d4ce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mosip-acceptance-tests/ivv-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mosipdev/openjdk-21-jdk:latest
FROM mosipdev/openjdk-21-jre:latest

ARG SOURCE
ARG COMMIT_HASH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.mosip.testrig.dslrig.ivv.orchestrator;

import java.io.File;

import java.io.FileWriter;
import java.lang.management.ManagementFactory;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -21,22 +21,19 @@
import java.util.regex.Pattern;

import org.apache.commons.collections4.CollectionUtils;
import org.testng.Assert;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
Expand All @@ -48,10 +45,12 @@
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.testrig.apirig.utils.ConfigManager;
import com.sun.management.OperatingSystemMXBean;

import io.mosip.testrig.apirig.admin.fw.config.BeanConfig;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.dslrig.ivv.core.base.StepInterface;
import io.mosip.testrig.dslrig.ivv.core.dtos.ParserInputDTO;
import io.mosip.testrig.dslrig.ivv.core.dtos.RegistrationUser;
Expand All @@ -61,9 +60,7 @@
import io.mosip.testrig.dslrig.ivv.core.exceptions.RigInternalError;
import io.mosip.testrig.dslrig.ivv.core.utils.Utils;
import io.mosip.testrig.dslrig.ivv.dg.DataGenerator;
import io.mosip.testrig.dslrig.ivv.e2e.methods.BioAuthentication;
import io.mosip.testrig.dslrig.ivv.parser.Parser;
import com.sun.management.OperatingSystemMXBean;


@ContextConfiguration(classes = {BeanConfig.class})
Expand Down Expand Up @@ -221,7 +218,7 @@ public void beforeMethod(Method method) {
}

private synchronized void updateRunStatistics(Scenario scenario)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
logger.info("Updating statistics for scenario: " + scenario.getId() + " -- updating the executed count to: "
+ counterLock.getAndIncrement());
if (scenario.getId().equalsIgnoreCase("0")) {
Expand All @@ -246,7 +243,7 @@ private synchronized void updateRunStatistics(Scenario scenario)
@Test(dataProvider = "ScenarioDataProvider")
private void run(int i, Scenario scenario, HashMap<String, String> configs, HashMap<String, String> globals,
Properties properties) throws SQLException, InterruptedException, ClassNotFoundException,
IllegalAccessException, InstantiationException {
IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {

OperatingSystemMXBean osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);

Expand Down Expand Up @@ -511,13 +508,25 @@ public void publishResult() {
return;
}


/*
* public StepInterface getInstanceOf(Scenario.Step step) throws
* ClassNotFoundException, IllegalAccessException, InstantiationException {
* String className = getPackage(step) + "." + step.getName().substring(0,
* 1).toUpperCase() + step.getName().substring(1); // return (StepInterface)
* Class.forName(className).newInstance(); return (StepInterface)
* appContext.getBean(Class.forName(className)); }
*/

@SuppressWarnings("deprecation")
public StepInterface getInstanceOf(Scenario.Step step)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
String className = getPackage(step) + "." + step.getName().substring(0, 1).toUpperCase()
+ step.getName().substring(1);
// return (StepInterface) Class.forName(className).newInstance();
return (StepInterface) appContext.getBean(Class.forName(className));
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
String className = getPackage(step) + "." + step.getName().substring(0, 1).toUpperCase()
+ step.getName().substring(1);
// Load the class
Class<?> clazz = Class.forName(className);
// Use the new approach to create an instance
return (StepInterface) clazz.getDeclaredConstructor().newInstance();
}

private void configToSystemProperties() {
Expand Down

0 comments on commit 5a3d4ce

Please sign in to comment.