Search in sources :

Example 36 with OfficeDetailsDto

use of org.mifos.dto.domain.OfficeDetailsDto in project head by mifos.

the class OfficeActionStrutsTest method testLoadLevel.

@Test
public void testLoadLevel() throws Exception {
    setRequestPathInfo("/offAction.do");
    addRequestParameter("method", Methods.load.toString());
    addRequestParameter("officeLevel", "5");
    addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
    actionPerform();
    verifyForward(ActionForwards.load_success.toString());
    List<OfficeDetailsDto> parents = (List<OfficeDetailsDto>) SessionUtils.getAttribute(OfficeConstants.PARENTS, request);
    Assert.assertEquals(2, parents.size());
    List<OfficeDetailsDto> levels = (List<OfficeDetailsDto>) SessionUtils.getAttribute(OfficeConstants.OFFICELEVELLIST, request);
    Assert.assertEquals(4, levels.size());
    OffActionForm offActionForm = (OffActionForm) request.getSession().getAttribute("offActionForm");
    Assert.assertNotNull(offActionForm);
    Assert.assertEquals("5", offActionForm.getOfficeLevel());
}
Also used : List(java.util.List) OffActionForm(org.mifos.customers.office.struts.actionforms.OffActionForm) OfficeDetailsDto(org.mifos.dto.domain.OfficeDetailsDto) Test(org.junit.Test)

Example 37 with OfficeDetailsDto

use of org.mifos.dto.domain.OfficeDetailsDto in project head by mifos.

the class TableTagParserTest method testParser.

@Test
public void testParser() throws Exception {
    Table table = TableTagParser.getInstance().parser("org/mifos/framework/util/resources/customTableTag/example.xml");
    Assert.assertNotNull(table);
    HeaderDetails details = table.getHeaderDetails();
    Assert.assertEquals("drawtablerowbold", details.getHeaderStyle());
    StringBuilder builder = new StringBuilder();
    details.getHeaderInfo(builder);
    assertContains("drawtablerowbold", builder.toString());
    Row row = table.getRow();
    Assert.assertEquals("true", row.getBottomLineRequired());
    Assert.assertEquals("100", row.getTotWidth());
    Column[] columns = row.getColumn();
    for (int i = 0; i < columns.length; i++) {
        if (i == 0) {
            Assert.assertEquals("text", columns[i].getColumnType());
            Assert.assertEquals("Name", columns[i].getLabel());
            Assert.assertEquals("Name", columns[i].getValue());
            Assert.assertEquals("method", columns[i].getValueType());
            StringBuilder builder2 = new StringBuilder();
            Locale locale = new Locale("en", "GB");
            OfficeDetailsDto officeDetailsDto = new OfficeDetailsDto(Short.valueOf("1"), "abcd", Short.valueOf("1"), "branch", Integer.valueOf("1"));
            ColumnDetails columnDetails = new ColumnDetails();
            columnDetails.setRowStyle("drawtablerowbold");
            columnDetails.setAlign("Down");
            columns[i].setColumnDetials(columnDetails);
            columns[i].generateTableColumn(builder2, officeDetailsDto, locale, locale, 0);
            Assert.assertEquals("<td class=\"drawtablerowbold\"   align=\"Down\" > </td>", builder2.toString());
        }
    }
}
Also used : Locale(java.util.Locale) OfficeDetailsDto(org.mifos.dto.domain.OfficeDetailsDto) Test(org.junit.Test)

Aggregations

OfficeDetailsDto (org.mifos.dto.domain.OfficeDetailsDto)37 PersonnelDto (org.mifos.dto.domain.PersonnelDto)19 ArrayList (java.util.ArrayList)13 Test (org.junit.Test)13 CustomerDto (org.mifos.dto.domain.CustomerDto)10 Date (java.util.Date)7 OfficeBO (org.mifos.customers.office.business.OfficeBO)7 UserContext (org.mifos.security.util.UserContext)6 CollectionSheetEntryGridDto (org.mifos.application.collectionsheet.business.CollectionSheetEntryGridDto)5 OfficePersistence (org.mifos.customers.office.persistence.OfficePersistence)5 OfficeDto (org.mifos.dto.domain.OfficeDto)5 CollectionSheetEntryDto (org.mifos.application.collectionsheet.business.CollectionSheetEntryDto)4 MessageLookup (org.mifos.application.master.MessageLookup)4 MeetingBO (org.mifos.application.meeting.business.MeetingBO)4 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 MifosUser (org.mifos.security.MifosUser)4 LoanAccountDto (org.mifos.accounts.loan.util.helpers.LoanAccountDto)3 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)3 SavingsOfferingBO (org.mifos.accounts.productdefinition.business.SavingsOfferingBO)3 CustomValueListElementDto (org.mifos.application.master.business.CustomValueListElementDto)3