/*
package compare;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.exceptions.InvalidConfigurationException;
import com.capgemini.framework.teamcenter.exceptions.KurtException;
import com.capgemini.framework.teamcenter.exceptions.NoTeamcenterConnectionException;
import com.capgemini.framework.teamcenter.policies.PolicyLocation;
import com.capgemini.reports.builder.R01Builder;
import com.capgemini.reports.database.javabean.enumeration.ReportCriteriaEnum;
import com.capgemini.reports.execution.strategies.ImmediateExecutionStrategy;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.testng.annotations.*;
import org.testng.annotations.Optional;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;

import static org.assertj.core.api.Assertions.assertThat;


@Slf4j
public abstract class ExcelTest {
  private static final TcSession session = new TcSession();
  // Dossier parent du fichier de référence
  private static final String INPUT_FOLDER = "com.capgemini.report.location.default.input";
  // Sous-dossier du fichier de référence
  private static final String SPECIFIC_INPUT_FOLDER = "";
  // Dossier de stockage temporaire des fichiers générés initialement
  private static final String TEMPORARY_OUTPUT_FOLDER = "com.capgemini.report.location.default.output";
  // Dossier de stockage final des fichiers
  private static final String RECORDS_FOLDER = "com.capgemini.report.location.default.records";
  // Type de fichier traités
  private static final String SUFFIX = "";
  private static final PolicyLocation XML_POLICY =
      PolicyLocation.make("test_policy", "/test_policy.xml");
  private Properties localproperties;


  @BeforeClass
  public void login() throws NoTeamcenterConnectionException, InvalidConfigurationException, IOException {
    session.login();
    session.setObjectPropPolicy(XML_POLICY);
    localproperties = new Properties();
    localproperties.load(getClass().getResourceAsStream("/reporting.properties"));
  }

  @AfterClass
  public void logout() {
    session.close();
  }

  //@BeforeMethod
  //TODO : Supprimer xls files dans Generated, checker Tempfile TempDirectory


  @Parameters({"productID", "unit", "monomulti", "effectivityDate", "genericAssemb", "generic", "refFile"})
  @Test
  public void test01 (String productID, Integer unit, String monomulti, @Optional String
      effectivityDate, @Optional String genericAssemb, @Optional String generic, String refFile) throws
      KurtException, IOException {
    // Génération du rapport de test
    Map<ReportCriteriaEnum, String> data = new HashMap<>();
    data.put(ReportCriteriaEnum.PRODUCT, productID);
    data.put(ReportCriteriaEnum.UNIT, unit.toString());
    data.put(ReportCriteriaEnum.MONO_MULTI, monomulti);
    data.put(ReportCriteriaEnum.GENERIC, generic);
    data.put(ReportCriteriaEnum.GENERIC_ASSEMB, genericAssemb);
    data.put(ReportCriteriaEnum.EFFECTIVITY_DATE, effectivityDate);

    ExecutionR01 execution = new R01Builder().build(data);
    String print = new DataReportPreparatorR01().print(session, execution, new ImmediateExecutionStrategy());

    FileInputStream fileInput = new FileInputStream(
        new File(localproperties.getProperty(INPUT_FOLDER) + "/" + SPECIFIC_INPUT_FOLDER + "/" + refFile));
    XSSFWorkbook workbookRef = new XSSFWorkbook(fileInput);

    File generatedFile = new File(localproperties.getProperty(TEMPORARY_OUTPUT_FOLDER) + execution.getFileNameOnDisc() + SUFFIX);
    FileInputStream fileOutput = new FileInputStream(generatedFile);
    XSSFWorkbook workbookGen = new XSSFWorkbook(fileOutput);

    if (workbookRef.getNumberOfSheets() == workbookGen.getNumberOfSheets()) {
      for (int h = 0; h < workbookGen.getNumberOfSheets() && h < workbookRef.getNumberOfSheets(); h++) {
        // Un fichier excel est composé de plusieurs feuilles, on y accède de la manière suivante
        XSSFSheet sheetRef = workbookRef.getSheetAt(h);
        XSSFSheet sheetGen = workbookRef.getSheetAt(h);
        DataFormatter df = new DataFormatter();
        for (int i = 2; i < sheetRef.getLastRowNum(); i++) {
          XSSFRow rowRef = sheetRef.getRow(i);
          XSSFRow rowGen = sheetGen.getRow(i);
          for (int j = 0; j < rowRef.getLastCellNum(); j++) {
            XSSFCell cellRef = rowRef.getCell(j);
            XSSFCell cellGen = rowGen.getCell(j);
            assertThat(df.formatCellValue(cellGen)).isEqualTo(df.formatCellValue(cellRef));
          }
        }
      }
    }
    move(generatedFile);
  }

  private void move (File file) {
    file.renameTo(new File (localproperties.getProperty(RECORDS_FOLDER) + SPECIFIC_INPUT_FOLDER + "/" + file.getName()));
    System.out.println("File is moved successfully!");
  }
}




*/
/*    for (int i = 2; i < sheetRef.getLastRowNum() + 1; i++) {
      Cell cell = sheetRef.getRow(i).getCell(i);
      if (df.formatCellValue(cell).equals(df.formatCellValue(sheetGen.getRow(i).getCell(0))))
      { //If cell is the same value as the one in the row below it
        System.out.println("Test réussi");
      } else
      {//If cell has a different value as the one in the row below it
        System.out.println("Test échec");
      }
    }*//*



*/
/*    for (int i = 0; i < sheetRef.getPhysicalNumberOfRows(); i++) {
      assertThat(sheetRef.getRow(i).equals(sheetGen.getRow(i))).isTrue();
    }*//*


*/
/*
  List<String> sheetNamesRef = new ArrayList<String>();
  List<String> sheetNamesGen = new ArrayList<String>();
      for (int i=0; i<workbookGen.getNumberOfSheets(); i++) {
    sheetNamesRef.add(workbookGen.getSheetName(i));
    sheetNamesGen.add(workbookGen.getSheetName(i));
    }

    *//*




*/
