Search in sources :

Example 11 with AdminDocumentBO

use of org.mifos.reports.admindocuments.business.AdminDocumentBO in project head by mifos.

the class BirtAdminDocumentUploadActionStrutsTest method testShouldSubmitSucessWhenUploadNewAdminDocument.

@Test
public void testShouldSubmitSucessWhenUploadNewAdminDocument() throws Exception {
    setRequestPathInfo("/birtAdminDocumentUploadAction.do");
    BirtAdminDocumentUploadActionForm form = new BirtAdminDocumentUploadActionForm();
    form.setAdminiDocumentTitle("testShouldSubmitSucessWhenUploadNewAdminDocumentWithAVeryLongNameThatExceedsOneHundredCharactersInLength");
    form.setIsActive("1");
    form.setFile(new MockFormFile("testFileName1.rptdesign"));
    setActionForm(form);
    addRequestParameter("method", "upload");
    actionPerform();
    AdminDocumentBO adminDocument = (AdminDocumentBO) request.getAttribute(Constants.BUSINESS_KEY);
    Assert.assertNotNull(adminDocument);
    ReportsPersistence rp = new ReportsPersistence();
    ReportsJasperMap jasper = rp.getPersistentObject(ReportsJasperMap.class, adminDocument.getAdmindocId());
    Assert.assertNotNull(jasper);
    verifyNoActionErrors();
    verifyForward("create_success");
    removeReport(adminDocument.getAdmindocId());
}
Also used : MockFormFile(org.mifos.reports.business.MockFormFile) ReportsPersistence(org.mifos.reports.persistence.ReportsPersistence) AdminDocumentBO(org.mifos.reports.admindocuments.business.AdminDocumentBO) BirtAdminDocumentUploadActionForm(org.mifos.reports.admindocuments.struts.actionforms.BirtAdminDocumentUploadActionForm) ReportsJasperMap(org.mifos.reports.business.ReportsJasperMap) Test(org.junit.Test)

Aggregations

AdminDocumentBO (org.mifos.reports.admindocuments.business.AdminDocumentBO)11 ArrayList (java.util.ArrayList)6 AdminDocAccStateMixBO (org.mifos.reports.admindocuments.business.AdminDocAccStateMixBO)6 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)5 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)5 Test (org.junit.Test)4 BirtAdminDocumentUploadActionForm (org.mifos.reports.admindocuments.struts.actionforms.BirtAdminDocumentUploadActionForm)4 List (java.util.List)3 AdminDocAccActionMixBO (org.mifos.reports.admindocuments.business.AdminDocAccActionMixBO)3 FormFile (org.apache.struts.upload.FormFile)2 AccountActionEntity (org.mifos.accounts.business.AccountActionEntity)2 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)2 AccountBusinessService (org.mifos.accounts.business.service.AccountBusinessService)2 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)2 MifosRuntimeException (org.mifos.core.MifosRuntimeException)2 UserContext (org.mifos.security.util.UserContext)2 File (java.io.File)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 AccountBO (org.mifos.accounts.business.AccountBO)1