Package org.martinlaw.bo

Examples of org.martinlaw.bo.MatterTransactionDoc


   * retrieves object that was inserted via sql and compares it with expected info
   * @throws ParseException
   */
  @Test
  public void testTransactionDocRetrieve() throws ParseException {
    MatterTransactionDoc transactionDoc = getBoSvc().findBySinglePrimaryKey(
        getMatterTransactionDocumentClass(), "1001");
    testTransactionDocFields(transactionDoc, "mawanja", new Date(sdf.parse("22-Oct-2012").getTime()), new BigDecimal(2501));
    //getTestUtils().testRetrievedConsiderationFields(transactionDoc.getConsideration());
  }
View Full Code Here


  @Test
  public void testTransactionDocCRUD() throws InstantiationException,
      IllegalAccessException {
    // C
    String documentNumber = "2001";
    MatterTransactionDoc transactionDoc = getTestUtils().getTestTransactionDocForCRUD(
        getMatterTransactionDocumentClass(), documentNumber);
    getBoSvc().save(transactionDoc);

    // R
    String clientPrincipalName = "pkk";
    transactionDoc = (MatterTransactionDoc) getBoSvc()
        .findBySinglePrimaryKey(getMatterTransactionDocumentClass(), documentNumber);
    testTransactionDocFields(transactionDoc, clientPrincipalName, new Date(System.currentTimeMillis()),
        new BigDecimal(2000));
    //getTestUtils().testConsiderationFields(transactionDoc.getConsideration());
    // U
    String clientPrincipalName2 = "hwn";
    transactionDoc.setClientPrincipalName(clientPrincipalName2);
    transactionDoc.refresh();
    assertEquals("principal name differs", clientPrincipalName2, transactionDoc.getClientPrincipalName());

    // D
    getBoSvc().delete(transactionDoc);
    assertNull("object should not exist", getBoSvc()
        .findBySinglePrimaryKey(getMatterTransactionDocumentClass(), documentNumber));
View Full Code Here

   */
  public MatterTxForm getMockForm() throws InstantiationException,
      IllegalAccessException {
    MatterTxForm txForm = mock(MatterTxForm.class);

    MatterTransactionDoc transactionDoc = getMatterTransactionDocumentClass().newInstance();
    transactionDoc.setMatterId(1001l);
    when(txForm.getDocument()).thenReturn(transactionDoc);
    return txForm;
  }
View Full Code Here

   * @param tx - the descendant of {@code MatterTransaction} to be populated
   * @return - the populated doc
   * @throws WorkflowException
   */
  public MatterTransactionDoc populateTransactionDocForRouting(Class<? extends MatterTransactionDoc> klass) throws WorkflowException {
    MatterTransactionDoc doc = (MatterTransactionDoc) KRADServiceLocatorWeb.getDocumentService().getNewDocument(klass);
    doc.getDocumentHeader().setDocumentDescription("testing");
    doc.setMatterId(1001l);
    populateMatterTransactionDocData(doc);
    return doc;
  }
View Full Code Here

   * @throws InstantiationException
   * @throws IllegalAccessException
   */
  public <A extends MatterTransactionDoc> MatterTransactionDoc
    getTestTransactionDocForCRUD(Class<A> txDoc, String documentNumber) throws InstantiationException, IllegalAccessException {
    MatterTransactionDoc transactionDoc = txDoc.newInstance();
    transactionDoc.setDocumentNumber(documentNumber);
    transactionDoc.getDocumentHeader().setDocumentNumber(documentNumber);
    transactionDoc.getDocumentHeader().setDocumentDescription("cash");
    transactionDoc.setMatterId(1001l);
    populateMatterTransactionDocData(transactionDoc);
   
    return transactionDoc;
  }
View Full Code Here

   * @throws WorkflowException
   */
  public void testMatterTransactionDocSearch(Class<? extends MatterTransactionDoc> txDocClass, String docType) throws InstantiationException, IllegalAccessException, WorkflowException {
    // route some test documents then search
    GlobalVariables.setUserSession(new UserSession("lawyer1"));
    MatterTransactionDoc txDoc1 = populateTransactionDocForRouting(txDocClass);
    testTransactionalRoutingInitToFinal(txDoc1);
   
    MatterTransactionDoc txDoc2 = populateTransactionDocForRouting(txDocClass);
    txDoc2.setAmount(new BigDecimal(50001));
    final String clientPrincipalName = "kyaloda";
    txDoc2.setClientPrincipalName(clientPrincipalName);
    testTransactionalRoutingInitToFinal(txDoc2);
   
    MatterTransactionDoc txDoc3 = populateTransactionDocForRouting(txDocClass);
    txDoc3.setAmount(new BigDecimal(45000));
    txDoc3.setClientPrincipalName("sirarthur");
    final int transactionTypeId = 10028;
    txDoc3.setTransactionTypeId(transactionTypeId);
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy");
    try {
      txDoc3.setDate(new Date(sdf.parse("21-Apr-2013").getTime()));
    } catch (ParseException e) {
      log.error(e);
      fail("unable to set date");
    }
    testTransactionalRoutingInitToFinal(txDoc3);
View Full Code Here

   * @return
   * @throws IllegalAccessException
   * @throws InstantiationException
   */
  public MatterTransactionDoc getMockTransaction(BigDecimal amount) throws InstantiationException, IllegalAccessException {
    MatterTransactionDoc tx = mock(MatterTransactionDoc.class);
    when(tx.getAmount()).thenReturn(amount);
    return tx;
  }
View Full Code Here

TOP

Related Classes of org.martinlaw.bo.MatterTransactionDoc

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.