You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by co...@apache.org on 2018/08/21 20:19:10 UTC

[1/2] fineract git commit: Fixes for integration tests

Repository: fineract
Updated Branches:
  refs/heads/develop 2a3aaecf6 -> e29e37ebb


Fixes for integration tests


Project: http://git-wip-us.apache.org/repos/asf/fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/693c7f2c
Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/693c7f2c
Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/693c7f2c

Branch: refs/heads/develop
Commit: 693c7f2c9c92c354cbe437a13093fe66a4b18c88
Parents: 2a3aaec
Author: conradsp <sc...@gmail.com>
Authored: Tue Aug 21 14:47:04 2018 -0500
Committer: conradsp <sc...@gmail.com>
Committed: Tue Aug 21 14:47:04 2018 -0500

----------------------------------------------------------------------
 .../client/ClientEntityImportHandlerTest.java   |  4 +-
 .../loan/LoanImportHandlerTest.java             | 51 +++++++++++---------
 .../office/OfficeImportHandlerTest.java         |  6 +--
 .../savings/SavingsImportHandlerTest.java       | 14 +++---
 ..._force_password_reset_in_c_configuration.sql |  6 ++-
 5 files changed, 44 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/fineract/blob/693c7f2c/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/client/ClientEntityImportHandlerTest.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/client/ClientEntityImportHandlerTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/client/ClientEntityImportHandlerTest.java
index 95174e2..ee5e734 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/client/ClientEntityImportHandlerTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/client/ClientEntityImportHandlerTest.java
@@ -115,10 +115,10 @@ public class ClientEntityImportHandlerTest {
         firstClientRow.createCell(ClientEntityConstants.SUBMITTED_ON_COL).setCellValue(submittedDate);
         firstClientRow.createCell(ClientEntityConstants.ADDRESS_ENABLED).setCellValue("False");
 
-        File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\client") ;
+        File directory=new File(System.getProperty("user.home")+File.separator+"Fineract"+File.separator+"bulkimport"+File.separator+"integration_tests"+File.separator+"importhandler"+File.separator+"client") ;
         if (!directory.exists())
             directory.mkdirs();
-        File file= new File(directory+"\\ClientEntity.xls");
+        File file= new File(directory+File.separator+"ClientEntity.xls");
         OutputStream outputStream=new FileOutputStream(file);
         workbook.write(outputStream);
         outputStream.close();

http://git-wip-us.apache.org/repos/asf/fineract/blob/693c7f2c/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/loan/LoanImportHandlerTest.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/loan/LoanImportHandlerTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/loan/LoanImportHandlerTest.java
index 66a3539..91bb0bd 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/loan/LoanImportHandlerTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/loan/LoanImportHandlerTest.java
@@ -80,27 +80,28 @@ public class LoanImportHandlerTest {
         Integer outcome_staff_creation =staffHelper.createStaff(requestSpec,responseSpec);
         Assert.assertNotNull("Could not create staff",outcome_staff_creation);
 
-        LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
-        LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
-        String jsonLoanProduct=loanProductTestBuilder.build(null);
-        Integer outcome_lp_creaion=loanTransactionHelper.getLoanProductId(jsonLoanProduct);
-        Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creaion);
-
-        FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
-        String jsonFund="{\n" +
-                "\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
-                "}";
-        Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec);
-        Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
-
-        PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
-        String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
-        String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
-        Boolean isCashPayment = true;
-        Integer position = 1;
-        Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position);
-        Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
+       // LoanTransactionHelper ltHelper=new LoanTransactionHelper(requestSpec,responseSpec);
+       // LoanProductTestBuilder loanProductTestBuilder=new LoanProductTestBuilder();
+       // String jsonLoanProduct=loanProductTestBuilder.build(null);
+       // Integer outcome_lp_creaion=ltHelper.getLoanProductId(jsonLoanProduct);
+       // Assert.assertNotNull("Could not create Loan Product" ,outcome_lp_creaion);
+
+       // FundsResourceHandler fundsResourceHandler=new FundsResourceHandler();
+       // String jsonFund="{\n" +
+       //         "\t\"name\": \""+Utils.randomNameGenerator("Fund_Name",9)+"\"\n" +
+       //         "}";
+       // Integer outcome_fund_creation=fundsResourceHandler.createFund(jsonFund,requestSpec,responseSpec);
+       // Assert.assertNotNull("Could not create Fund" ,outcome_fund_creation);
+
+       // PaymentTypeHelper paymentTypeHelper=new PaymentTypeHelper();
+       // String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
+       // String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
+       // Boolean isCashPayment = true;
+       // Integer position = 1;
+       // Integer outcome_payment_creation= paymentTypeHelper.createPaymentType(requestSpec, responseSpec,name,description,isCashPayment,position);
+       // Assert.assertNotNull("Could not create payment type" ,outcome_payment_creation);
 
+        LoanTransactionHelper loanTransactionHelper=new LoanTransactionHelper(requestSpec,responseSpec);
         Workbook workbook=loanTransactionHelper.getLoanWorkbook("dd MMMM yyyy");
 
         //insert dummy data into loan Sheet
@@ -127,7 +128,7 @@ public class LoanImportHandlerTest {
         firstLoanRow.createCell(LoanConstants.NO_OF_REPAYMENTS_COL).setCellValue(loanProductSheet.getRow(1).getCell(6).getNumericCellValue());
         firstLoanRow.createCell(LoanConstants.REPAID_EVERY_COL).setCellValue(loanProductSheet.getRow(1).getCell(9).getNumericCellValue());
         firstLoanRow.createCell(LoanConstants.REPAID_EVERY_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(10).getStringCellValue());
-        firstLoanRow.createCell(LoanConstants.LOAN_TERM_COL).setCellValue(loanProductSheet.getRow(1).getCell(8).getNumericCellValue());
+        firstLoanRow.createCell(LoanConstants.LOAN_TERM_COL).setCellValue(60);
         firstLoanRow.createCell(LoanConstants.LOAN_TERM_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(10).getStringCellValue());
         firstLoanRow.createCell(LoanConstants.NOMINAL_INTEREST_RATE_COL).setCellValue(loanProductSheet.getRow(1).getCell(11).getNumericCellValue());
         firstLoanRow.createCell(LoanConstants.NOMINAL_INTEREST_RATE_FREQUENCY_COL).setCellValue(loanProductSheet.getRow(1).getCell(14).getStringCellValue());
@@ -144,10 +145,12 @@ public class LoanImportHandlerTest {
         firstLoanRow.createCell(LoanConstants.LAST_REPAYMENT_DATE_COL).setCellValue(date);
         firstLoanRow.createCell(LoanConstants.REPAYMENT_TYPE_COL).setCellValue(extrasSheet.getRow(1).getCell(3).getStringCellValue());
 
-        File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\loan") ;
+        String currentdirectory = new File("").getAbsolutePath();
+        File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
+                "resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"loan") ;
         if (!directory.exists())
             directory.mkdirs();
-        File file= new File(directory+"\\Loan.xls");
+        File file= new File(directory+File.separator+"Loan.xls");
         OutputStream outputStream=new FileOutputStream(file);
         workbook.write(outputStream);
         outputStream.close();
@@ -157,7 +160,7 @@ public class LoanImportHandlerTest {
         Assert.assertNotNull(importDocumentId);
 
         //Wait for the creation of output excel
-        Thread.sleep(3000);
+        Thread.sleep(10000);
 
         //check status column of output excel
         String location=loanTransactionHelper.getOutputTemplateLocation(importDocumentId);

http://git-wip-us.apache.org/repos/asf/fineract/blob/693c7f2c/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/office/OfficeImportHandlerTest.java
----------------------------------------------------------------------
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 e4dd0aa..9bd80bc 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
@@ -74,11 +74,11 @@ public class OfficeImportHandlerTest {
         firstOfficeRow.createCell(OfficeConstants.OPENED_ON_COL).setCellValue(date);
 
         String currentdirectory = new File("").getAbsolutePath();
-        File directory=new File(currentdirectory+"\\src\\integrationTest\\" +
-                "resources\\bulkimport\\importhandler\\office");
+        File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
+                "resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"office");
         if (!directory.exists())
             directory.mkdirs();
-        File file= new File(directory+"\\Office.xls");
+        File file= new File(directory+File.separator+"Office.xls");
         OutputStream outputStream=new FileOutputStream(file);
         workbook.write(outputStream);
         outputStream.close();

http://git-wip-us.apache.org/repos/asf/fineract/blob/693c7f2c/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/savings/SavingsImportHandlerTest.java
----------------------------------------------------------------------
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/savings/SavingsImportHandlerTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/savings/SavingsImportHandlerTest.java
index 50d7d57..c22ec1f 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/savings/SavingsImportHandlerTest.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/bulkimport/importhandler/savings/SavingsImportHandlerTest.java
@@ -118,17 +118,19 @@ public class SavingsImportHandlerTest {
         firstSavingsRow.createCell(SavingsConstants.INTEREST_POSTING_PERIOD_COL).setCellValue(savingsProductSheet.getRow(1).getCell(4).getStringCellValue());
         firstSavingsRow.createCell(SavingsConstants.INTEREST_CALCULATION_COL).setCellValue(savingsProductSheet.getRow(1).getCell(5).getStringCellValue());
         firstSavingsRow.createCell(SavingsConstants.INTEREST_CALCULATION_DAYS_IN_YEAR_COL).setCellValue(savingsProductSheet.getRow(1).getCell(6).getStringCellValue());
-        firstSavingsRow.createCell(SavingsConstants.MIN_OPENING_BALANCE_COL).setCellValue(savingsProductSheet.getRow(1).getCell(7).getNumericCellValue());
-        firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_COL).setCellValue(savingsProductSheet.getRow(1).getCell(8).getNumericCellValue());
-        firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_FREQUENCY_COL).setCellValue(savingsProductSheet.getRow(1).getCell(9).getStringCellValue());
+        firstSavingsRow.createCell(SavingsConstants.MIN_OPENING_BALANCE_COL).setCellValue(1000.0);
+        firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_COL).setCellValue(1);
+        firstSavingsRow.createCell(SavingsConstants.LOCKIN_PERIOD_FREQUENCY_COL).setCellValue("Weeks");
         firstSavingsRow.createCell(SavingsConstants.APPLY_WITHDRAWAL_FEE_FOR_TRANSFERS).setCellValue("False");
         firstSavingsRow.createCell(SavingsConstants.ALLOW_OVER_DRAFT_COL).setCellValue("False");
         firstSavingsRow.createCell(SavingsConstants.OVER_DRAFT_LIMIT_COL).setCellValue(savingsProductSheet.getRow(1).getCell(15).getNumericCellValue());
 
-        File directory=new File(System.getProperty("user.home")+"\\Fineract\\bulkimport\\integration_tests\\importhandler\\savings") ;
+        String currentdirectory = new File("").getAbsolutePath();
+        File directory=new File(currentdirectory+File.separator+"src"+File.separator+"integrationTest"+File.separator+
+                "resources"+File.separator+"bulkimport"+File.separator+"importhandler"+File.separator+"savings") ;
         if (!directory.exists())
             directory.mkdirs();
-        File file= new File(directory+"\\Savings.xls");
+        File file= new File(directory+File.separator+"Savings.xls");
         OutputStream outputStream=new FileOutputStream(file);
         workbook.write(outputStream);
         outputStream.close();
@@ -138,7 +140,7 @@ public class SavingsImportHandlerTest {
         Assert.assertNotNull(importDocumentId);
 
         //Wait for the creation of output excel
-        Thread.sleep(3000);
+        Thread.sleep(10000);
 
         //check status column of output excel
         String location=savingsAccountHelper.getOutputTemplateLocation(importDocumentId);

http://git-wip-us.apache.org/repos/asf/fineract/blob/693c7f2c/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql
----------------------------------------------------------------------
diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql
index 61b3eb3..d3d7b83 100644
--- a/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql
+++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V145__add_force_password_reset_in_c_configuration.sql
@@ -19,10 +19,12 @@
 
 INSERT INTO `c_configuration` (`id`, `name`, `value`, `enabled`) VALUES (NULL, 'force-password-reset-days', '0', '0');
 
-ALTER TABLE  `m_appuser` ADD  `last_time_password_updated` DATE NOT NULL ,
+ALTER TABLE  `m_appuser` ADD  `last_time_password_updated` DATE NULL,
 ADD INDEX (  `last_time_password_updated` ) ;
 
-UPDATE  `m_appuser` SET  `last_time_password_updated` =  NOW() WHERE  `m_appuser`.`last_time_password_updated` ='0000-00-00';
+UPDATE  `m_appuser` SET  `last_time_password_updated` =  NOW() WHERE  `m_appuser`.`last_time_password_updated` IS NULL;
+
+ALTER TABLE `m_appuser` modify `last_time_password_updated` DATE NOT NULL;
 
 CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,


[2/2] fineract git commit: Merge branch 'conradsp-fix-integration-tests' into develop

Posted by co...@apache.org.
Merge branch 'conradsp-fix-integration-tests' into develop


Project: http://git-wip-us.apache.org/repos/asf/fineract/repo
Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/e29e37eb
Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/e29e37eb
Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/e29e37eb

Branch: refs/heads/develop
Commit: e29e37ebbc9832487a515718104b3ad531519b52
Parents: 2a3aaec 693c7f2
Author: conradsp <sc...@gmail.com>
Authored: Tue Aug 21 15:18:47 2018 -0500
Committer: conradsp <sc...@gmail.com>
Committed: Tue Aug 21 15:18:47 2018 -0500

----------------------------------------------------------------------
 .../client/ClientEntityImportHandlerTest.java   |  4 +-
 .../loan/LoanImportHandlerTest.java             | 51 +++++++++++---------
 .../office/OfficeImportHandlerTest.java         |  6 +--
 .../savings/SavingsImportHandlerTest.java       | 14 +++---
 ..._force_password_reset_in_c_configuration.sql |  6 ++-
 5 files changed, 44 insertions(+), 37 deletions(-)
----------------------------------------------------------------------