Skip to content

Commit

Permalink
Merge pull request #1651 from mohanachandran-s/release-1.2.2
Browse files Browse the repository at this point in the history
MOSIP-36480 - Syncing release branch with develop branch
  • Loading branch information
lsivanand authored Oct 18, 2024
2 parents 38dd528 + 3163c40 commit f5be0c7
Show file tree
Hide file tree
Showing 33 changed files with 447 additions and 281 deletions.
5 changes: 5 additions & 0 deletions apitest-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>io.mosip.authentication</groupId>
<artifactId>authentication-core</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package io.mosip.testrig.apirig.dataprovider;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
//import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
//import java.net.URL;
Expand All @@ -23,7 +19,6 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

Expand All @@ -32,6 +27,17 @@
import javax.xml.transform.TransformerException;

import org.apache.commons.codec.binary.Hex;
import org.apache.log4j.Logger;
import org.xml.sax.SAXException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jamesmurty.utils.XMLBuilder;
//import java.util.Date;

import io.mosip.kernel.biometrics.commons.CbeffValidator;
import io.mosip.kernel.biometrics.entities.BIR;
import io.mosip.mock.sbi.test.CentralizedMockSBI;
import io.mosip.testrig.apirig.dataprovider.mds.MDSClient;
import io.mosip.testrig.apirig.dataprovider.mds.MDSClientInterface;
import io.mosip.testrig.apirig.dataprovider.models.BioModality;
Expand All @@ -47,18 +53,6 @@
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.response.Response;

import org.apache.log4j.Logger;
import org.xml.sax.SAXException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jamesmurty.utils.XMLBuilder;
//import java.util.Date;

import io.mosip.kernel.biometrics.commons.CbeffValidator;
import io.mosip.kernel.biometrics.entities.BIR;
import io.mosip.mock.sbi.test.CentralizedMockSBI;

public class BiometricDataProvider {

public static HashMap<String, Integer> portmap = new HashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.Files;

import io.mosip.biometrics.util.CommonUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

import static io.restassured.RestAssured.given;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;

import org.json.JSONArray;
Expand All @@ -17,14 +14,11 @@

import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.testrig.apirig.dataprovider.models.IrisDataModel;
import io.mosip.testrig.apirig.dataprovider.models.JWTTokenModel;
import io.mosip.testrig.apirig.dataprovider.models.ResidentBiometricModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDevice;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDeviceCaptureModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSRCaptureModel;
import io.mosip.testrig.apirig.dataprovider.util.CommonUtil;
import io.mosip.testrig.apirig.dataprovider.util.DataProviderConstants;
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.List;

import io.mosip.testrig.apirig.dataprovider.models.ResidentBiometricModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDevice;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSRCaptureModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.mosip.testrig.apirig.dataprovider.models;

import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Hashtable;
import java.util.List;

Expand All @@ -12,6 +9,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.Data;

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -32,7 +34,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.mifmif.common.regex.Generex;
import java.io.*;

public class CommonUtil {
private static final Logger logger = LoggerFactory.getLogger(CommonUtil.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.hibernate.cfg.Environment;
import org.hibernate.jdbc.Work;

import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
public class DBManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public class EmailableReport implements IReporter {
private static final String JVM_ARG = GlobalConstants.EMAILABLEREPORT2NAME;

private int totalPassedTests = 0;
private int totalSkippedTests = 0;
private static int totalSkippedTests = 0;
private int totalIgnoredTests = 0;
private int totalKnownIssueTests = 0;
private int totalFailedTests = 0;
private static int totalFailedTests = 0;
private long totalDuration = 0;

public void setFileName(String fileName) {
Expand All @@ -74,6 +74,16 @@ public void setFileName(String fileName) {
public String getFileName() {
return fileName;
}

public static int getFailedCount() {
return totalFailedTests;
}

public static int getSkippedCount() {
return totalSkippedTests;
}



@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
Expand Down Expand Up @@ -328,7 +338,6 @@ protected void writeSuiteSummary() {

writer.print("<tr>");
writer.print("<th>Test Scenario</th>");
writer.print("<th>Prerequisite Step</th>");
writer.print("<th># Total</th>");
writer.print("<th># Passed</th>");
writer.print("<th># Skipped</th>");
Expand Down Expand Up @@ -379,8 +388,6 @@ protected void writeSuiteSummary() {
writeTableData(buffer.append("<a href=\"#t").append(testIndex).append("\">")
.append(Utils.escapeHtml(testResult.getTestName())).append("</a>").toString(), "num");

writeTableData(testResult.getPrerequisiteTest(), "num");

writeTableData(integerFormat.format(totalTests), "num");
writeTableData(integerFormat.format(passedTests), (passedTests > 0 ? "num green-bg" : "num"));
writeTableData(integerFormat.format(skippedTests), (skippedTests > 0 ? "num orange-bg" : "num"));
Expand Down Expand Up @@ -413,7 +420,6 @@ protected void writeSuiteSummary() {
if (testIndex > 1) {
writer.print("<tr>");
writer.print("<th>Total</th>");
writeTableHeader("", "num");

if (reportIgnoredTestCases && reportKnownIssueTestCases) {
writeTableHeader(integerFormat.format(totalPassedTests + totalSkippedTests + totalFailedTests
Expand Down Expand Up @@ -507,9 +513,9 @@ protected void writeScenarioSummary() {
writer.print("<table id='summary'>");
writer.print("<thead>");
writer.print("<tr>");
writer.print("<th>Unique Identifier</th>");
writer.print("<th>Test Case</th>");
writer.print("<th>Test Case Description</th>");
writer.print("<th>TestCase Number</th>");
writer.print("<th>TestCase</th>");
writer.print("<th>TestCase Description</th>");
writer.print("<th>Execution Time (HH:MM:SS)</th>");
writer.print(GlobalConstants.TR);
writer.print("</thead>");
Expand Down Expand Up @@ -935,7 +941,6 @@ public int compare(ITestResult o1, ITestResult o2) {
};

private final String testName;
private final String prerequisiteTest;
private final List<ClassResult> failedConfigurationResults;
private final List<ClassResult> failedTestResults;
private final List<ClassResult> skippedConfigurationResults;
Expand All @@ -954,8 +959,6 @@ public int compare(ITestResult o1, ITestResult o2) {

public TestResult(ITestContext context) {
testName = context.getName();
prerequisiteTest = context.getCurrentXmlTest().getParameter("prerequisite") == null ? ""
: context.getCurrentXmlTest().getParameter("prerequisite");

Set<ITestResult> failedConfigurations = context.getFailedConfigurations().getAllResults();
Set<ITestResult> failedTests = context.getFailedTests().getAllResults();
Expand Down Expand Up @@ -1044,10 +1047,6 @@ public String getTestName() {
return testName;
}

public String getPrerequisiteTest() {
return prerequisiteTest;
}

/**
* @return the results for failed configurations (possibly empty)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.SecureRandom;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand All @@ -16,12 +15,10 @@
import javax.ws.rs.core.MediaType;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.json.JSONArray;
import org.json.simple.JSONObject;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
Expand All @@ -31,10 +28,7 @@
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.nimbusds.jose.jwk.RSAKey;

import io.mosip.testrig.apirig.admin.fw.config.BeanConfig;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthTestsUtil;
import io.mosip.testrig.apirig.utils.CommonLibrary;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
Expand All @@ -50,7 +44,6 @@
* All suite level before and after tests will be completed here.
*
*/
@ContextConfiguration(classes = { BeanConfig.class })
public class BaseTestCase extends AbstractTestNGSpringContextTests {

protected static Logger logger = Logger.getLogger(BaseTestCase.class);
Expand Down Expand Up @@ -78,8 +71,10 @@ public class BaseTestCase extends AbstractTestNGSpringContextTests {
public String zonalAdminCookie = null;
public String zonalApproverCookie = null;
public String adminCookie = null;
public String testrigCookie = null;
public String partnerCookie = null;
public String partnerrevampCookie = null;
public String partnerrevampdeviceCookie = null;
public String partnerNewCookie = null;
public String withoutpartnerCookie = null;
public String withoutpolicyCookie = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;

import io.mosip.testrig.apirig.utils.GlobalConstants;

public class ExtractResource {

private static final Logger LOGGER = Logger.getLogger(ExtractResource.class);
Expand Down
Loading

0 comments on commit f5be0c7

Please sign in to comment.