Package org.kuali.rice.krad.maintenance

Examples of org.kuali.rice.krad.maintenance.MaintenanceDocument


  public void testGetQualifiedMatterClassName_maintenance() {

    MaintenanceDocumentForm model = mock(MaintenanceDocumentForm.class);
    final String message = "no qualified class name without document+maintainable+dataobject and valid matter id";
    assertTrue(message,StringUtils.isEmpty(keyValues.getQualifiedMatterClassName(model)));
    MaintenanceDocument doc = mock(MaintenanceDocument.class);
    when(model.getDocument()).thenReturn(doc);
    assertTrue(message,StringUtils.isEmpty(keyValues.getQualifiedMatterClassName(model)));
    Maintainable maintainable = mock(Maintainable.class);
    when(doc.getNewMaintainableObject()).thenReturn(maintainable);
    assertTrue(message,StringUtils.isEmpty(keyValues.getQualifiedMatterClassName(model)));
   
    MatterExtensionHelper matterHelper = getTestDataObject();
    matterHelper.setMatterId(matterId);
    when(maintainable.getDataObject()).thenReturn(matterHelper);
View Full Code Here


   */
  protected Document getPopulatedMaintenanceDocument(String docType, PersistableBusinessObject bo, String principalName)
      throws WorkflowException, InstantiationException,
      IllegalAccessException {
        GlobalVariables.setUserSession(new UserSession(principalName));
        MaintenanceDocument doc = (MaintenanceDocument) KRADServiceLocatorWeb.getDocumentService().getNewDocument(docType);
        //old bo
        doc.getOldMaintainableObject().setDataObjectClass(bo.getClass());
        doc.getOldMaintainableObject().setDataObject(bo.getClass().newInstance());
        //new object
        doc.getNewMaintainableObject().setDataObjectClass(bo.getClass());
        doc.getNewMaintainableObject().setDataObject(bo);
        doc.getNewMaintainableObject().setMaintenanceAction(KRADConstants.MAINTENANCE_NEW_ACTION);
        //required fields
        doc.getDocumentHeader().setDocumentDescription("new test maint doc");
        return doc;
      }
View Full Code Here

   * <p> so that form.getDocument().getNewMaintainableObject().getDataObject() can work</p>
   * @return
   */
  public MaintenanceDocumentForm createMockMaintenanceDocForm() {
    MaintenanceDocumentForm form = mock(MaintenanceDocumentForm.class);
    MaintenanceDocument doc = mock(MaintenanceDocument.class);
    when(form.getDocument()).thenReturn(doc);
    Maintainable maintainable = mock(Maintainable.class);
    when(doc.getNewMaintainableObject()).thenReturn(maintainable);
    return form;
  }
View Full Code Here

TOP

Related Classes of org.kuali.rice.krad.maintenance.MaintenanceDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.