Package org.martinlaw.bo.courtcase

Examples of org.martinlaw.bo.courtcase.CourtCase


   * @throws IllegalAccessException
   */
  @Test
  public void testLocalReference_validation()
  throws InstantiationException, IllegalAccessException {
    Matter kase = new CourtCase();
    kase.setLocalReference("my/firm/ cases/2013");
    final String attributeName = "localReference";
    getTestUtils().validate(kase, 1, attributeName);
   
    kase.setLocalReference("MY/FIRM/cases/2013");
    getTestUtils().validate(kase, 1, attributeName);
   
    kase.setLocalReference("MY/FIRM/CASES/2013");
    getTestUtils().validate(kase, 0, attributeName);
   
    kase.setLocalReference("MY/FIRM/CASES(5)/2013");
    getTestUtils().validate(kase, 0, attributeName);
  }
View Full Code Here


    //Class<? extends Matter> klass = Opinion.class;
    // when(doc.getMatterClass()).thenCallRealMethod();
    when(doc.isMatterIdValid()).thenReturn(true);
   
    //prepare the matter and clients
    kase = new CourtCase();
    MatterClient c1 = mock(MatterClient.class);
    when(c1.getPrincipalName()).thenReturn("signum");
    Person cp1 = mock(Person.class);
    when(cp1.getName()).thenReturn("Simon Gitahi");
    when(c1.getPerson()).thenReturn(cp1);
View Full Code Here

    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();
    kase.setConcreteClass(LandCase.class.getCanonicalName());
    inquirable.buildInquirableLink(kase, propertyName, inq);
    verify(inq).buildInquiryLink(same(kase), same(propertyName), same(LandCase.class), anyMapOf(String.class, String.class));
   
    // land case event should turn up a inquiry link to land case, not court case
    MatterEvent event = getBoSvc().findBySinglePrimaryKey(MatterEvent.class, new Long(1002));
View Full Code Here

   * @see org.martinlaw.test.courtcase.MatterRoutingTest#testCreatedCase(org.martinlaw.bo.courtcase.CourtCase)
   */
  @Override
  protected void testCreatedMatter(Matter kase) {
    super.testCreatedMatter(kase);
    CourtCase kase1 = (CourtCase)kase;
    assertEquals("court reference differs", courtReference, kase1.getCourtReference());
    assertEquals("number of witnesses expected differs", 1, kase1.getWitnesses().size());
    String msg = "expected principal name differs";
    assertEquals(msg, "thomas_kaberi_gitau", kase1.getWitnesses().get(0).getPrincipalName());
  }
View Full Code Here

  @Override
  public void testMatter_doc_search() throws WorkflowException, InstantiationException, IllegalAccessException {
    super.testMatter_doc_search();
   
    final String courtRef = "courtRef1";
    CourtCase kase = (CourtCase) getTestMatter();
    kase.setCourtReference(courtRef);
    testMaintenanceRoutingInitToFinal(getDocTypeName(), kase);
   
    SearchTestCriteria crit1 = new SearchTestCriteria();
    crit1.setExpectedDocuments(1);
    crit1.getFieldNamesToSearchValues().put("courtReference", courtRef);
View Full Code Here

  /* (non-Javadoc)
   * @see org.martinlaw.test.courtcase.MatterBoTest#testRetrievedMatterFields(org.martinlaw.bo.Matter)
   */
  @Override
  public void testRetrievedMatterFields(Matter matter) {
    CourtCase kase = (CourtCase)matter;
    super.testRetrievedMatterFields(kase);
   
    assertEquals("court ref differs", "c1", kase.getCourtReference());
      
      // witness
      List<CourtCaseWitness> witnesses = kase.getWitnesses();
      assertEquals(1, witnesses.size());
      CourtCaseWitness witness = witnesses.get(0);
      assertEquals("witness principal name differs", "witness1", witness.getPrincipalName());
      assertEquals("witness first name differs", "Witness",witness.getPerson().getFirstName());
     
      // type
      assertNotNull("case type should not be null", kase.getType());
      assertEquals("case type id differs", new Long(10001), kase.getType().getId());  
  }
View Full Code Here

   */
  @Override
  protected Matter getTestMatter(String localReference, String statusText,
      String matterName)
      throws InstantiationException, IllegalAccessException {
    CourtCase matter = (CourtCase) super.getTestMatter(localReference, statusText, matterName);
    MatterType type = new MatterType();
    type.setName(caseTypeName);
    getBoSvc().save(type);
    type.refresh();
    matter.setTypeId(type.getId());
    matter.setCourtReference(courtReference);
    getTestUtils().addWitnesses(matter);
   
    return matter;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.martinlaw.test.courtcase.MatterBoTest#additionalTestsForCreatedMatter(org.martinlaw.bo.Matter)
   */
  @Override
  public void additionalTestsForCreatedMatter(Matter matter) {
    CourtCase kase = (CourtCase)matter;
    assertNotNull("witnesses should not be null", kase.getWitnesses());
    assertEquals("number of witnesses expected differs", 1, kase.getWitnesses().size());
   
    assertEquals("court ref differs", courtReference, kase.getCourtReference());
    assertEquals("case type name differs", caseTypeName, kase.getType().getName());
  }
View Full Code Here

   * @return the test object
   * @throws IllegalAccessException
   * @throws InstantiationException
   */
  public <C extends Matter> Matter getTestCourtCase(String localRef, String courtRef, Class<C> klass) throws InstantiationException, IllegalAccessException {
    CourtCase caseBo = (CourtCase) getTestMatter(localRef, klass);
    caseBo.setCourtReference(courtRef);
    caseBo.setTypeId(10004l);
    // witnesses
    addWitnesses(caseBo);
   
    return caseBo;
  }
View Full Code Here

    caseEvent.setId(1001l);
    EventType eventType = new EventType();
    eventType.setName("judgement");
    caseEvent.setType(eventType);
   
    CourtCase theCase = new CourtCase();
    theCase.setLocalReference("my/cases/1");
    theCase.setName("water vs fire");
    theCase.setCourtReference("No 12 of 2015");
    theCase.setConcreteClass(CourtCase.class.getCanonicalName());
    caseEvent.setMatter(theCase);
   
    // create test date
    Calendar testCal = Calendar.getInstance();
    testCal.set(Calendar.YEAR, 2013);
View Full Code Here

TOP

Related Classes of org.martinlaw.bo.courtcase.CourtCase

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.