fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] 01/02: Fixed OfficeImportTest
Date Mon, 08 Jun 2020 05:00:26 GMT
This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit 6eb3873a5bf03d99c8661cfde0bc02408b4bd0ff
Author: Petri Tuomola <petri@tuomola.org>
AuthorDate: Thu Jun 4 05:27:23 2020 +0300

    Fixed OfficeImportTest
---
 .../importhandler/office/OfficeImportHandlerTest.java  | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/office/OfficeImportHandlerTest.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/office/OfficeImportHandlerTest.java
index d96d764..a0d3c49 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/office/OfficeImportHandlerTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/office/OfficeImportHandlerTest.java
@@ -30,6 +30,7 @@ import java.io.OutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import org.apache.fineract.infrastructure.bulkimport.constants.LoanConstants;
 import org.apache.fineract.infrastructure.bulkimport.constants.OfficeConstants;
 import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants;
 import org.apache.fineract.integrationtests.common.OfficeHelper;
@@ -40,10 +41,14 @@ import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class OfficeImportHandlerTest {
+    
+    private final static Logger LOG = LoggerFactory.getLogger(OfficeImportHandlerTest.class);
+
     private ResponseSpecification responseSpec;
     private RequestSpecification requestSpec;
 
@@ -60,7 +65,6 @@ public class OfficeImportHandlerTest {
     }
 
     @Test
-    @Ignore
     public void testOfficeImport() throws IOException, InterruptedException, NoSuchFieldException,
ParseException {
         OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
         Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy");
@@ -80,7 +84,7 @@ public class OfficeImportHandlerTest {
                 "resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"office");
         if (!directory.exists()) {
             directory.mkdirs();
-        }
+        } 
         File file= new File(directory+File.separator+"Office.xls");
         OutputStream outputStream=new FileOutputStream(file);
         workbook.write(outputStream);
@@ -91,7 +95,7 @@ public class OfficeImportHandlerTest {
         Assert.assertNotNull(importDocumentId);
 
         // Wait for the creation of output excel
-        Thread.sleep(3000);
+        Thread.sleep(10000);
 
         //check  status column of output excel
         String location=officeHelper.getOutputTemplateLocation(importDocumentId);
@@ -99,7 +103,11 @@ public class OfficeImportHandlerTest {
         Workbook outputWorkbook=new HSSFWorkbook(fileInputStream);
         Sheet officeSheet = outputWorkbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME);
         Row row= officeSheet.getRow(1);
+        
+        LOG.info("Output location: {}", location);
+        LOG.info("Failure reason column: {}", row.getCell(OfficeConstants.STATUS_COL).getStringCellValue());
+        
         Assert.assertEquals("Imported",row.getCell(OfficeConstants.STATUS_COL).getStringCellValue());
-
+        outputWorkbook.close();
     }
 }


Mime
View raw message