Package org.martinlaw.bo

Examples of org.martinlaw.bo.Status


  private Logger log = Logger.getLogger(getClass());
 
  @Test
  public void testCaseStatusMaintenanceRouting() throws WorkflowException {
    //testTransactionalRouting("CaseStatusMaintenanceDocument");
    Type status = new Status();
    String statusText = "deadlock";
    status.setName(statusText);
    Scope statusScope = new Scope();
    statusScope.setQualifiedClassName("org.martinlaw.Aclass");
    status.getScope().add(statusScope);
    try {
      testMaintenanceRoutingInitToFinal(getDocTypeName(), status);
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("name", statusText);
      Collection<Status> result = KRADServiceLocator.getBusinessObjectService().findMatching(Status.class, params);
View Full Code Here


    Class<? extends BusinessObject> scopedClass = Status.class;
   
    List<Status> statusList = new ArrayList<Status>(3);
   
    final String statusChristian = "Christian";
    Status status1 = new Status(1l, statusChristian);
    Scope[] scope1 = {new Scope(marriageClassName), new Scope(weddingClassName)};
    status1.setScope(Arrays.asList(scope1));
   
    final String statusFulfld = "Fulfilled";
    Status status2 = new Status(1l, statusFulfld);
    Scope[] scope2 = {new Scope(marriageClassName)};
    status2.setScope(Arrays.asList(scope2));
   
    // status 'good applies to all classes, so leave scope blank
    final String statusGd = "Good";
    Status status3 = new Status(1l, statusGd);
    statusList.add(status1);
    statusList.add(status2);
    statusList.add(status3);
    when(boSvc.findAll(same(Status.class))).thenReturn(statusList);
   
View Full Code Here

    matter.setLocalReference(localReference);
    matter.setName(matterName);
    matter.setTags(matterTags );
    matter.setTypeId(10011l);
 
    Status status = new Status();
    status.setName(statusText);
    // save status since it is not updated from the court case - ojb config to prevent object modified errors when the status is changed
    getBoSvc().save(status);
    status.refresh();
    matter.setStatusId(status.getId());
    matter.setClientPrincipalName(getTestUtils().getTestClientPrincipalName());
    getTestUtils().addClients(matter);
   
    return matter;
  }
View Full Code Here

  /**
   * tests CRUD on annex type
   */
  public void testStatusCRUD() {
    // create
    Status status = new Status();
    status.setName("pending");
    //test scopes
    Scope scope1 = new Scope();
    final String canonicalName1 = Matter.class.getCanonicalName();
    scope1.setQualifiedClassName(canonicalName1);
    status.getScope().add(scope1);
    Scope scope2 = new Scope();
    final String canonicalName2 = Contract.class.getCanonicalName();
    scope2.setQualifiedClassName(canonicalName2);
    status.getScope().add(scope2);
   
    getBoSvc().save(status);
    //refresh
    status.refresh();
    // retrieve
    assertEquals("the Status does not match", "pending", status.getName());
    assertFalse("scope should not be empty", status.getScope().isEmpty());
    assertEquals("scope size differs", 2, status.getScope().size());
    assertEquals("class name differs", canonicalName1, status.getScope().get(0).getQualifiedClassName());
    assertEquals("class name differs", canonicalName2, status.getScope().get(1).getQualifiedClassName());
    //update
    status.setName("appealed");
    status.getScope().remove(0);
    getBoSvc().save(status);
    //refresh
    status.refresh();
    assertEquals("the Status does not match", "appealed", status.getName());
    assertEquals("scope size differs", 1, status.getScope().size());
    assertEquals("class name differs", canonicalName2, status.getScope().get(0).getQualifiedClassName());
    // delete
    getBoSvc().delete(status);
    assertNull("status should have been deleted", getBoSvc().findBySinglePrimaryKey(Status.class, status.getId()));
    Map<String, String> criteria = new HashMap<String, String>();
    criteria.put("typeId", String.valueOf(status.getId()));
    assertTrue("scopes should have been deleted", getBoSvc().findMatching(Scope.class, criteria).isEmpty());
  }
View Full Code Here

  @Test(expected=DataIntegrityViolationException.class)
  /**
   * tests that annex type generates errors when non-nullable fields are blank
   */
  public void testStatusNullableFields() {
    Status status = new Status();
    status.setId(25l);
    getBoSvc().save(status);
  }
View Full Code Here

   
  }

  @Override
  public Type getExpectedOnRetrieve() {
    Type status = new Status();
    status.setName("adjourned");
    status.setId(10037l);
   
    return status;
  }
View Full Code Here

   * @throws IllegalAccessException
   * @throws InstantiationException
   */
  public <M extends Matter> Matter getTestMatter(String localRef, Class<M> klass) throws InstantiationException, IllegalAccessException {
    //set up test status
    Status status = new Status();
    status.setName("Testing");
    getBoSvc().save(status);
    status.refresh();
    assertNotNull(status.getId());
    //create new case bo
    Matter matter = klass.newInstance();
   
    matter.setLocalReference(localRef);
    matter.setClientPrincipalName("client1");
    String name = "Fatuma Zainab Mohammed vs \n" +
        "Ghati Dennitah \n"+
        "IEBC\n" +
        "Benson Njau (Kuria East Returning Officer)\n" +
        "Lilina Liluma (Returning Officer Awendo Constituency)\n" +
        "Moses Omondo Daula (Returning Officer Nyatike Constituency)\n"+
        "Jakton Nyonje (Returning Officer Oriri Constituency)\n" +
        "Noah Bowen (Rongo Constituency)\n" +
        "Alex Uyuga (Returning officer Suna East Constituency)\n" +
        "Jairus Obago (Returning Officer Migori County)\n" +
        "Adam Mohamed (Returning officer Kuria West Constituency)\n";
    matter.setName(name);
    matter.setStatus(status);
    // side step validation error - error.required
    matter.setStatusId(status.getId());
    matter.setTypeId(10011l);
    // clients & witnesses
    addClients(matter);
   
    return matter;
View Full Code Here

TOP

Related Classes of org.martinlaw.bo.Status

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.