Package org.martinlaw.util

Examples of org.martinlaw.util.SearchTestCriteria


    testContract3.setLocalReference("MY/FIRM/CONTRACTS/2013/21");
    testContract3.getConsiderations().add(getTestUtils().getTestConsideration());
    testMaintenanceRoutingInitToFinal(docType, testContract3);
   
    // no document criteria given, so both documents should be found
    SearchTestCriteria crit1 = new SearchTestCriteria();
    crit1.setExpectedDocuments(3);
    // search for exact local reference
    SearchTestCriteria crit2 = new SearchTestCriteria();
    crit2.setExpectedDocuments(1);
    crit2.getFieldNamesToSearchValues().put("localReference", testContract.getLocalReference());
    // search for name
    SearchTestCriteria crit3 = new SearchTestCriteria();
    crit3.setExpectedDocuments(1);
    crit3.getFieldNamesToSearchValues().put("name", "*temporary*");
    // search for local reference wild-card
    SearchTestCriteria crit5 = new SearchTestCriteria();
    crit5.setExpectedDocuments(2);
    crit5.getFieldNamesToSearchValues().put("localReference", "*2013*");
    // search for main client
    SearchTestCriteria crit6 = new SearchTestCriteria();
    crit6.setExpectedDocuments(1);
    crit6.getFieldNamesToSearchValues().put("clientPrincipalName", "patrick_kamau");
    // search for summary of terms
    SearchTestCriteria crit7 = new SearchTestCriteria();
    crit7.setExpectedDocuments(3);
    crit7.getFieldNamesToSearchValues().put("summaryOfTerms", "*see*");
    // search for summary of terms
    SearchTestCriteria crit8 = new SearchTestCriteria();
    crit8.setExpectedDocuments(3);
    crit8.getFieldNamesToSearchValues().put("serviceOffered", "*flat*");
   
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit1);
    crits.add(crit2);
    crits.add(crit3);
View Full Code Here


  @Test
  public void testDocSearch() {
    Long annexTypeId = 10024l; // does not require approval
    Long matterId = 1002l;
    // search before routing docs
    SearchTestCriteria crit2 = new SearchTestCriteria();
    crit2.setExpectedDocuments(0);
    crit2.getFieldNamesToSearchValues().put("annexTypeId", String.valueOf(annexTypeId));
    // search for comment wildcard
    SearchTestCriteria crit3 = new SearchTestCriteria();
    crit3.setExpectedDocuments(0);
    crit3.getFieldNamesToSearchValues().put("matterId", String.valueOf(matterId));
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit2);
    crits.add(crit3);
    getTestUtils().runDocumentSearch(crits, getDocTypeName());
   
    try {
      MatterWork work1;
      work1 = getTestUtils().populateMatterWork((MatterWork) KRADServiceLocatorWeb.getDocumentService().getNewDocument(
          getDocTypeName()));
      work1.setAnnexTypeId(annexTypeId );
      getTestUtils().testTransactionalRoutingInitToFinal(work1);
     
      MatterWork work2 = getTestUtils().populateMatterWork((MatterWork) KRADServiceLocatorWeb.getDocumentService().getNewDocument(
          getDocTypeName()));
      work2.setMatterId(matterId );
      getTestUtils().testTransactionalRoutingInitToFinal(work2);
     
      crit2.setExpectedDocuments(1);
      crit3.setExpectedDocuments(1);
      getTestUtils().runDocumentSearch(crits, getDocTypeName());
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
    }
View Full Code Here

    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();
    crit1.setExpectedDocuments(2);
    // search for local reference
    SearchTestCriteria crit2 = new SearchTestCriteria();
    crit2.setExpectedDocuments(1);
    crit2.getFieldNamesToSearchValues().put("localReference", conv.getLocalReference());
    // search for name
    SearchTestCriteria crit3 = new SearchTestCriteria();
    crit3.setExpectedDocuments(1);
    crit3.getFieldNamesToSearchValues().put("name", "*plot*");
    // search for main client
    SearchTestCriteria crit4 = new SearchTestCriteria();
    crit4.setExpectedDocuments(1);
    crit4.getFieldNamesToSearchValues().put("clientPrincipalName", "angela_chibalonza");
   
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit1);
    crits.add(crit2);
    crits.add(crit3);
View Full Code Here

   
    String localRef = "EN/CN/002";
    String name = "*supply*";
    // test for active, hasphysical file
    // no document criteria given, so both documents should be found
    SearchTestCriteria crit1 = new SearchTestCriteria();
    crit1.setExpectedDocuments(2);
    // search for local reference
    SearchTestCriteria crit2 = new SearchTestCriteria();
    crit2.setExpectedDocuments(1);
    crit2.getFieldNamesToSearchValues().put("matter.localReference", localRef);
    // search for name
    SearchTestCriteria crit3 = new SearchTestCriteria();
    crit3.setExpectedDocuments(1);
    crit3.getFieldNamesToSearchValues().put("matter.name", name);
    // search using has physical file
    SearchTestCriteria crit4 = new SearchTestCriteria();
    crit4.setExpectedDocuments(1);
    crit4.getFieldNamesToSearchValues().put("hasPhysicalFile", "Y");
    // search using active
    SearchTestCriteria crit5 = new SearchTestCriteria();
    crit5.setExpectedDocuments(1);
    crit5.getFieldNamesToSearchValues().put("active", "Y");
    // search using principal name
    SearchTestCriteria crit6 = new SearchTestCriteria();
    crit6.setExpectedDocuments(1);
    crit6.getFieldNamesToSearchValues().put("principalName", principalName);
   
   
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit1);
    crits.add(crit2);
View Full Code Here

      consideration2.setConsiderationTypeId(10004l);
      testMaintenanceRoutingInitToFinal(docType, consideration2);
     
     
      // blank document search
      SearchTestCriteria crit1 = new SearchTestCriteria();
      crit1.setExpectedDocuments(2);
      // search description
      SearchTestCriteria crit2 = new SearchTestCriteria();
      crit2.setExpectedDocuments(2);
      crit2.getFieldNamesToSearchValues().put("description", "*attach*");
      // search for consideration amount
      SearchTestCriteria crit3 = new SearchTestCriteria();
      crit3.setExpectedDocuments(0);
      crit3.getFieldNamesToSearchValues().put("amount", ">8000");
      // search for consideration amount range
      SearchTestCriteria crit4 = new SearchTestCriteria();
      crit4.setExpectedDocuments(2);
      crit4.getFieldNamesToSearchValues().put("amount", "1000 .. 7500");
      // search for consideration amount
      SearchTestCriteria crit5 = new SearchTestCriteria();
      crit5.setExpectedDocuments(1);
      crit5.getFieldNamesToSearchValues().put("amount", "1000");
      // search for consideration type
      SearchTestCriteria crit6 = new SearchTestCriteria();
      crit6.setExpectedDocuments(1);
      crit6.getFieldNamesToSearchValues().put("considerationTypeId", "10004");
     
      List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
      crits.add(crit1);
      crits.add(crit2);
      crits.add(crit3);
View Full Code Here

    Type type2 = getDataObjectClass().newInstance();
    type2.setName("supply of rain and shine");
    testMaintenanceRoutingInitToFinal(docType, type2);
   
    // no document criteria given, so both documents should be found
    SearchTestCriteria crit1 = new SearchTestCriteria();
    crit1.setExpectedDocuments(2);
    // search for name
    SearchTestCriteria crit2 = new SearchTestCriteria();
    crit2.setExpectedDocuments(1);
    crit2.getFieldNamesToSearchValues().put("name", "permanent*");
    // search for non-existent name
    SearchTestCriteria crit3 = new SearchTestCriteria();
    crit3.setExpectedDocuments(0);
    crit3.getFieldNamesToSearchValues().put("name", "*temp*");
   
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit1);
    crits.add(crit2);
    crits.add(crit3);
View Full Code Here

      testEvent2.setComment("optional for ict department");
      testEvent2.setStartDate(new Timestamp(System.currentTimeMillis()));
      testMaintenanceRoutingInitToFinal(docType, testEvent2);
     
      // blank document search
      SearchTestCriteria crit1 = new SearchTestCriteria();
      crit1.setExpectedDocuments(2);
      // search location
      SearchTestCriteria crit2 = new SearchTestCriteria();
      crit2.setExpectedDocuments(1);
      crit2.getFieldNamesToSearchValues().put("location", location);
      // search for comment wildcard
      SearchTestCriteria crit3 = new SearchTestCriteria();
      crit3.setExpectedDocuments(1);
      crit3.getFieldNamesToSearchValues().put("comment", "*ict*");
      // search for start date range
      SearchTestCriteria crit4 = new SearchTestCriteria();
      crit4.setExpectedDocuments(1);
      crit4.getFieldNamesToSearchValues().put("startDate", "01 mar 2013 .. 05 mar 2013");
     
      List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
      crits.add(crit1);
      crits.add(crit2);
      crits.add(crit3);
View Full Code Here

      Matter matter2 =  getTestMatter();
      matter2.setLocalReference(localRef);
      matter2.setName("Moto vs Maji");
      testMaintenanceRoutingInitToFinal(docType, matter2);
     
      SearchTestCriteria crit1 = new SearchTestCriteria();
      crit1.setExpectedDocuments(2);
      // search for local reference
      SearchTestCriteria crit2 = new SearchTestCriteria();
      crit2.setExpectedDocuments(1);
      crit2.getFieldNamesToSearchValues().put("localReference", localRef);
      // search for name
      SearchTestCriteria crit3 = new SearchTestCriteria();
      crit3.setExpectedDocuments(1);
      crit3.getFieldNamesToSearchValues().put("name", "Bingu*");
      // search for main client
      SearchTestCriteria crit4 = new SearchTestCriteria();
      crit4.setExpectedDocuments(2);
      crit4.getFieldNamesToSearchValues().put("clientPrincipalName", "client1");
     
      List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
      crits.add(crit1);
      crits.add(crit2);
      crits.add(crit3);
View Full Code Here

      final String lrValue = "LR GEN 1/1";
      landCase.setLandReference(lrValue);
      testMaintenanceRoutingInitToFinal(getDocTypeName(), landCase);
     
      // search for land reference
      SearchTestCriteria crit2 = new SearchTestCriteria();
      crit2.setExpectedDocuments(1);
      crit2.getFieldNamesToSearchValues().put("landReference", lrValue);
      List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
      crits.add(crit2);
      getTestUtils().runDocumentSearch(crits, getDocTypeName());
    } catch (Exception e) {
      fail(e.getMessage());
View Full Code Here

    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);
    List<SearchTestCriteria> crits = new ArrayList<SearchTestCriteria>();
    crits.add(crit1);
    getTestUtils().runDocumentSearch(crits, getDocTypeName());
  }
View Full Code Here

TOP

Related Classes of org.martinlaw.util.SearchTestCriteria

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.