From c107f193c97d42c7208943225a97785982a95741 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 1 Oct 2020 11:16:22 +0200 Subject: [PATCH] refactoring --- .../project/EXCELParserTest.java | 49 ++----------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java index 11ee0eef15..c64459472d 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/EXCELParserTest.java @@ -7,6 +7,7 @@ import java.nio.file.Path; import java.util.List; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -35,52 +36,8 @@ public class EXCELParserTest { List pl = excelParser .parse(httpConnector.getInputSourceAsStream(URL), "eu.dnetlib.dhp.actionmanager.project.utils.ExcelTopic"); - System.out.println(pl.size()); + Assertions.assertEquals(3837, pl.size()); + -// OPCPackage pkg = OPCPackage.open(httpConnector.getInputSourceAsStream(URL)); -// XSSFWorkbook wb = new XSSFWorkbook(pkg); -// -// XSSFSheet sheet = wb.getSheet("cordisref-H2020topics"); -// -// DataFormatter dataFormatter = new DataFormatter(); -// Iterator rowIterator = sheet.rowIterator(); -// List headers = new ArrayList<>(); -// int count = 0; -// while (rowIterator.hasNext() && count <= 10) { -// Row row = rowIterator.next(); -// -// -// if(count == 0){ -// // Now let's iterate over the columns of the current row -// Iterator cellIterator = row.cellIterator(); -// -// while(cellIterator.hasNext()){ -// Cell cell = cellIterator.next(); -// headers.add(dataFormatter.formatCellValue(cell)); -// } -// }else{ -// Class clazz = Class.forName("eu.dnetlib.dhp.actionmanager.project.utils.EXCELTopic"); -// final Object cc = clazz.newInstance(); -// -// for(int i =0; i iterator = wb.sheetIterator(); -//// System.out.println("Retrieving Sheets using Iterator"); -//// while (iterator.hasNext()) { -//// Sheet sheet = iterator.next(); -//// System.out.println("=> " + sheet.getSheetName()); -//// } -// -// pkg.close(); } }