use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class LegacyPersonnelDaoIntegrationTest method testSearchFirstNameAndLastName.
@Test
public void testSearchFirstNameAndLastName() throws Exception {
branchOffice = TestObjectFactory.getOffice(TestObjectFactory.SAMPLE_BRANCH_OFFICE);
personnel = createPersonnelWithName(branchOffice, PersonnelLevel.LOAN_OFFICER, new Name("Rajender", null, "singh", "saini"));
QueryResult queryResult = legacyPersonnelDao.search(personnel.getPersonnelDetails().getName().getFirstName() + " " + personnel.getPersonnelDetails().getName().getLastName(), 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 CustomerPersistenceIntegrationTest method testSearchCustForSavings.
@Test
public void testSearchCustForSavings() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
QueryResult queryResult = new CustomerPersistence().searchCustForSavings("C", Short.valueOf("1"));
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 testSearchWithoutGroups.
@Test
public void testSearchWithoutGroups() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
setCustomerSearch(CustomerLevel.GROUP, false);
QueryResult queryResult = new CustomerPersistence().search("%", 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 testSearchWithEthnicityExists.
@Test
public void testSearchWithEthnicityExists() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
filters.setEthnicity("SC");
QueryResult queryResult = new CustomerPersistence().search("%", Short.valueOf("0"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(3, queryResult.getSize());
Assert.assertEquals(3, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithEthnicityNotExists.
@Test
public void testSearchWithEthnicityNotExists() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
filters.setEthnicity("wrongEthnicity");
QueryResult queryResult = new CustomerPersistence().search("%", 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());
}
Aggregations