use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class LegacyPersonnelDaoIntegrationTest method testSearch.
@Test
public void testSearch() throws Exception {
branchOffice = TestObjectFactory.getOffice(TestObjectFactory.SAMPLE_BRANCH_OFFICE);
personnel = createPersonnel(branchOffice, PersonnelLevel.LOAN_OFFICER);
QueryResult queryResult = legacyPersonnelDao.search(personnel.getUserName(), Short.valueOf("1"));
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustSearchActionStrutsTest method veryfyResults.
private void veryfyResults() throws Exception {
QueryResult queryResult = (QueryResult) SessionUtils.getAttribute(Constants.SEARCH_RESULTS, request);
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithoutOfficeId.
@Test
public void testSearchWithoutOfficeId() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().search("C", Short.valueOf("0"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(2, queryResult.getSize());
Assert.assertEquals(2, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchGropAndClient.
@Test
public void testSearchGropAndClient() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().searchGroupClient("C", Short.valueOf("1"), false);
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithCancelLoanAccounts.
@SuppressWarnings("unchecked")
@Test
public void testSearchWithCancelLoanAccounts() throws Exception {
groupAccount = getLoanAccount();
PersonnelBO loggedInUser = IntegrationTestObjectMother.testUser();
groupAccount.changeStatus(AccountState.LOAN_CANCELLED, AccountStateFlag.LOAN_WITHDRAW.getValue(), "WITHDRAW LOAN ACCOUNT", loggedInUser);
TestObjectFactory.updateObject(groupAccount);
StaticHibernateUtil.flushSession();
groupAccount = TestObjectFactory.getObject(LoanBO.class, groupAccount.getAccountId());
center = TestObjectFactory.getCustomer(center.getCustomerId());
group = TestObjectFactory.getCustomer(group.getCustomerId());
QueryResult queryResult = new CustomerPersistence().search(group.getGlobalCustNum(), Short.valueOf("3"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
List results = queryResult.get(0, 10);
Assert.assertEquals(1, results.size());
CustomerSearchDto customerSearchDto = (CustomerSearchDto) results.get(0);
Assert.assertEquals(0, customerSearchDto.getLoanGlobalAccountNum().size());
}
Aggregations