Package org.martinlaw.bo.conveyance

Examples of org.martinlaw.bo.conveyance.Conveyance


  @Test
  /**
   * test retrieving the {@link Conveyance} populated from sql
   */
  public void testConveyanceRetrieve() {
    Conveyance conv = getBoSvc().findBySinglePrimaryKey(Conveyance.class, 1008l);
    assertNotNull(conv);
    assertEquals("Sale of LR4589", conv.getName());
    assertEquals("c1", conv.getLocalReference());
    assertEquals("Sale of Urban Land", conv.getType().getName());
    assertEquals("pending", conv.getStatus().getName());
    // clients
    assertEquals("number of clients differs", 2, conv.getClients().size());
    assertEquals("client name differs", "client1", conv.getClients().get(0).getPrincipalName());
    // assignees
    assertEquals("number of clients differs", 1, conv.getAssignees().size());
    assertEquals("assignee principal name differs", "edwin_njogu", conv.getAssignees().get(0).getPrincipalName());
    //type
    assertNotNull("matter type should not be null", conv.getType());
    assertEquals("matter type name differs", "Sale of Urban Land", conv.getType().getName());
   
    getTestUtils().testWorkList(conv.getWork());
   
    getTestUtils().testRetrievedConsiderationFields(conv.getConsiderations().get(0));
    getTestUtils().testMatterClient(conv, "Client");
  }
View Full Code Here


    }
    String expected = "<div class=\"" + MartinlawConstants.Styles.EVEN + "\">" + event.toHtml() +
        "</div><div class=\"" + MartinlawConstants.Styles.ODD + "\">" + event.toHtml() +
        "</div><div class=\"" + MartinlawConstants.Styles.EVEN + "\">" + event.toHtml() +
        "</div>";
    Conveyance matter = new Conveyance();
    matter.setEvents(events);
    assertEquals("html markup differs", expected, matter.getEventsHtml());
  }
View Full Code Here

   * @throws IllegalAccessException
   * @throws InstantiationException
   */
  @Test
  public void testGetConsiderationsHtml() throws InstantiationException, IllegalAccessException {
    Conveyance conv = new Conveyance();
    assertEquals("considerations html differs", "", conv.getConsiderationsHtml());
   
    MatterConsideration csd1 = (MatterConsideration) getTestConsiderationWithType("reserve");
   
    MatterConsideration csd2 = (MatterConsideration) getTestConsiderationWithType("penalty");
    csd2.getTransactions().add((MatterTransactionDoc) utils.getMockTransaction(new BigDecimal(42)));
    csd2.getTransactions().add((MatterTransactionDoc) utils.getMockTransaction(new BigDecimal(38)));
   
    MatterConsideration csd3 = (MatterConsideration) getTestConsiderationWithType("donation");
    csd3.setAmount(new BigDecimal(0));
   
    MatterConsideration csd4 = (MatterConsideration) getTestConsiderationWithType("bail");
    csd4.setAmount(new BigDecimal(1200));
   
   
    conv.getConsiderations().add(csd1);
    conv.getConsiderations().add(csd2);
    conv.getConsiderations().add(csd3);
    conv.getConsiderations().add(csd4);
   
    String expected = "<div class=\"mlaw_even\"><b>reserve</b>:&nbsp;KES 1,000.00</div>" +
        "<div class=\"mlaw_odd\"><b>penalty</b>:&nbsp;KES 1,080.00</div>" +
        "<div class=\"mlaw_even\"><b>bail</b>:&nbsp;KES 1,200.00</div>";
    assertEquals("considerations html differs", expected, conv.getConsiderationsHtml());
  }
View Full Code Here

    when(boSvc.findBySinglePrimaryKey(same(Matter.class), same(matterId))).thenReturn(matter);
    assertNotNull("Qualified Matter Class Name should not be null", keyValues.getQualifiedMatterClassName(model));
    assertEquals("Qualified Matter Class Name differs", concreteClass, keyValues.getQualifiedMatterClassName(model));
   
    // when the data object being maintained is an instance of Matter, return its class
    when(maintainable.getDataObject()).thenReturn(new Conveyance());
    assertNotNull("Qualified Matter Class Name should not be null", keyValues.getQualifiedMatterClassName(model));
    assertEquals("Qualified Matter Class Name differs", Conveyance.class.getCanonicalName(), keyValues.getQualifiedMatterClassName(model));
  }
View Full Code Here

  /**
   * test that a conveyance document is routed to the lawyer
   */
  public void testConveyanceRouting() {
    int existingConveyances = getBoSvc().findAll(Conveyance.class).size();
    Conveyance conv = getTestUtils().getTestConveyance();
    try {
      testMaintenanceRoutingInitToFinal(getDocTypeName(), conv);
    } catch (Exception e) {
      log.error("error in testConveyanceRouting", e);
      fail(e.getMessage());
    }
    // confirm BO was saved
    assertEquals(existingConveyances + 1, getBoSvc().findAll(Conveyance.class).size());
    Map<String, String> params = new HashMap<String, String>();
    params.put("name", conv.getName());
    Collection<Conveyance> result = getBoSvc().findMatching(Conveyance.class, params);
    assertEquals(1, result.size());
    for (Conveyance conveyance: result) {
      // TODO - test fails - possibly something to do with the ojb framework - or delays in document processing?
      assertNotNull("status should not be null", conveyance.getStatus());
View Full Code Here

  @Test
  /**
   * test conveyance document searching
   */
  public void testConveyanceDocSearch() throws WorkflowException, InstantiationException, IllegalAccessException {
    Conveyance conv = getTestUtils().getTestConveyance();
    //conv.getConsiderations().add(new Consideration(new BigDecimal(1000), "EBS", null));
    final String docType = getDocTypeName();
    testMaintenanceRoutingInitToFinal(docType, conv);
   
    Conveyance conv2 = getTestUtils().getTestConveyance();
    conv2.setLocalReference("MY/FIRM/CONV/15");
    conv2.setName("sale of plot number 123");
    conv2.setClientPrincipalName("Angela Chibalonza");
    //conv.getConsiderations().add(new Consideration(new BigDecimal(1001), "TFX", null));
    testMaintenanceRoutingInitToFinal(docType, conv2);
 
    // no document criteria given, so both documents should be found
    SearchTestCriteria crit1 = new SearchTestCriteria();
View Full Code Here

  /**
   * test CRUD ops on {@link Conveyance}
   */
  public void testConveyanceCRUD() {
    // C
    Conveyance conv = getTestUtils().getTestConveyance();
    // add client
    MatterClient client = new MatterClient();
    String principalName = "clientX";
    client.setPrincipalName(principalName);
    conv.getClients().add(client);

    getBoSvc().save(conv);
   
    // R
    conv.refresh();

    assertEquals("conveyance name differs", getTestUtils().getTestConveyance().getName(), conv.getName());
    assertEquals("number of clients differs", 1, conv.getClients().size());
    assertEquals("principal name differs", principalName, conv.getClients().get(0).getPrincipalName());
    assertNotNull("matter type should not be null", conv.getType());
    assertEquals("matter type name differs", "Sale of Motor Vehicle", conv.getType().getName());
 
    getTestUtils().testConsiderationFields(conv.getConsiderations().get(0));
    assertNotNull("considerations should not be null", conv.getConsiderations());
    assertEquals("default number of considerations differs", 2, conv.getConsiderations().size());
    getTestUtils().testMatterClient(conv, getTestUtils().getTestClientFirstName());
    // U
    String name2 = "EN/C010";
    conv.setName(name2);

    conv.refresh();
    assertEquals(name2, conv.getName());
   
    // D
    getBoSvc().delete(conv);
    assertNull("client should have been deleted",
        getBoSvc().findBySinglePrimaryKey(MatterClient.class, conv.getClients().get(0).getId()));
    /*assertNull("conveyance fee should have been deleted",
        getBoSvc().findBySinglePrimaryKey(Transaction.class, conv.getFees().get(0).getId()));*/
  }
 
View Full Code Here

    String propertyName = "localReference";
    inquirable.buildInquirableLink(dataObject, propertyName, inq);
    verify(inq).buildInquiryLink(same(dataObject), same(propertyName), same(CourtCase.class), anyMapOf(String.class, String.class));
   
    // null concrete class
    final Conveyance conveyance = new Conveyance();
    inquirable.buildInquirableLink(conveyance, propertyName, inq);
    verify(inq).buildInquiryLink(same(conveyance), same(propertyName), same(Conveyance.class), anyMapOf(String.class, String.class));
   
    //concrete class is different from instantiated class
    CourtCase kase = new CourtCase();
View Full Code Here

  /**
   * get a test conveyance object
   * @return
   */
  public Conveyance getTestConveyance() {
    Conveyance conv = new Conveyance();
    conv.setName(getTestConveyanceName());
    conv.setLocalReference("EN/C001");
    conv.setTypeId(10010l);
    conv.setStatusId(10033l);
    conv.setClientPrincipalName(testClientPrincipalName);
    return conv;
  }
View Full Code Here

    comment = String.format(commentTemplate, expectedMatterScopeCount, dataObjectName, "matter", expectedEmptyScopeCount);
    when(newMaintainableObject.getDataObject()).thenReturn(new Matter());
    assertEquals(comment, expectedMatterScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
   
    comment = String.format(commentTemplate, expectedConveyanceScopeCount, dataObjectName, "Conveyance", expectedEmptyScopeCount);
    when(newMaintainableObject.getDataObject()).thenReturn(new Conveyance());
    assertEquals(comment, expectedConveyanceScopeCount + expectedEmptyScopeCount, kv.getKeyValues(form).size());
  }
View Full Code Here

TOP

Related Classes of org.martinlaw.bo.conveyance.Conveyance

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.