use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class PersonnelBusinessServiceIntegrationTest method testSearch.
@Test
public void testSearch() throws Exception {
personnel = createPersonnel();
QueryResult queryResult = personnelBusinessService.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 GroupActionStrutsTest method testSearch.
@Test
public void testSearch() throws Exception {
createGroupWithCenter();
addRequestParameter("searchString", "gr");
addActionAndMethod(Methods.search.toString());
addCurrentFlowKey();
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.search_success.toString());
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 GroupPersistenceIntegrationTest method testSearchForAddingClientToGroup.
@Test
public void testSearchForAddingClientToGroup() throws Exception {
createGroup_ON_HOLD_STATUS();
QueryResult queryResult = groupPersistence.searchForAddingClientToGroup(group.getDisplayName(), Short.valueOf("1"));
Assert.assertNotNull(queryResult);
Assert.assertEquals(0, queryResult.getSize());
Assert.assertEquals(0, queryResult.get(0, 10).size());
}
use of org.mifos.framework.hibernate.helper.QueryResult in project head by mifos.
the class CustomerPersistenceIntegrationTest method testSearchWithGovernmentId.
@Test
public void testSearchWithGovernmentId() throws Exception {
OfficeBO office = IntegrationTestObjectMother.sampleBranchOffice();
PersonnelBO testUser = IntegrationTestObjectMother.testUser();
MeetingBO weeklyMeeting = new MeetingBuilder().customerMeeting().monthly().every(1).onDayOfMonth(1).build();
IntegrationTestObjectMother.saveMeeting(weeklyMeeting);
center = new CenterBuilder().with(weeklyMeeting).withName(this.getClass().getSimpleName() + " Center").with(office).withLoanOfficer(testUser).build();
IntegrationTestObjectMother.createCenter((CenterBO) center, weeklyMeeting);
group = new GroupBuilder().withMeeting(weeklyMeeting).withName("Group").withOffice(office).withLoanOfficer(testUser).withParentCustomer(center).withStatus(CustomerStatus.GROUP_ACTIVE).build();
IntegrationTestObjectMother.createGroup((GroupBO) group, weeklyMeeting);
String clientGovernmentId = "76346793216";
client = new ClientBuilder().withMeeting(weeklyMeeting).withName("Client 1").withOffice(office).withLoanOfficer(testUser).withParentCustomer(group).withStatus(CustomerStatus.CLIENT_ACTIVE).withGovernmentId(clientGovernmentId).buildForIntegrationTests();
IntegrationTestObjectMother.createClient(client, weeklyMeeting);
QueryResult queryResult = new CustomerPersistence().search(clientGovernmentId, office.getOfficeId(), testUser.getPersonnelId(), testUser.getOffice().getOfficeId(), filters);
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 testSearchActiveClients.
@Test
public void testSearchActiveClients() throws Exception {
createCustomers(CustomerStatus.GROUP_ACTIVE, CustomerStatus.CLIENT_ACTIVE);
StaticHibernateUtil.flushSession();
Integer activeStatus = CustomerStatus.CLIENT_ACTIVE.getValue().intValue();
filters.getCustomerStates().put(CustomerLevel.CLIENT.toString(), activeStatus);
QueryResult queryResult = new CustomerPersistence().search("Client", Short.valueOf("0"), Short.valueOf("1"), Short.valueOf("1"), filters);
Assert.assertNotNull(queryResult);
Assert.assertEquals(1, queryResult.getSize());
Assert.assertEquals(1, queryResult.get(0, 10).size());
}
Aggregations