Package com.opengamma.master.region

Examples of com.opengamma.master.region.RegionSearchRequest


    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }

  public void test_search_oneBundle_part() {
    RegionSearchRequest request = new RegionSearchRequest(BUNDLE_PART);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
View Full Code Here


    assertEquals(addedDoc, result.getFirstDocument());
  }

  //-------------------------------------------------------------------------
  public void test_search_twoBundles_noMatch() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.addExternalId(ID_OTHER1);
    request.addExternalId(ID_OTHER2);
    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }
View Full Code Here

    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }

  public void test_search_twoBundles_oneMatch() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.addExternalId(ID_COUNTRY);
    request.addExternalId(ID_OTHER1);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
View Full Code Here

    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }

  public void test_search_twoBundles_bothMatch() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.addExternalId(ID_COUNTRY);
    request.addExternalId(ID_CURENCY);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
View Full Code Here

    assertEquals(addedDoc, result.getFirstDocument());
  }

  //-------------------------------------------------------------------------
  public void test_search_name_noMatch() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setName("No match");
    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }
View Full Code Here

    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }

  public void test_search_name_match() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setName(NAME);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
View Full Code Here

    assertEquals(addedDoc, result.getFirstDocument());
  }

  //-------------------------------------------------------------------------
  public void test_search_classification_noMatch() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setClassification(RegionClassification.DEPENDENCY);
    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }
View Full Code Here

    RegionSearchResult result = master.search(request);
    assertEquals(0, result.getDocuments().size());
  }

  public void test_search_classification_match() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setClassification(RegionClassification.INDEPENDENT_STATE);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  public void test_getRegion_ExternalId_found() throws Exception {
    RegionMaster mock = mock(RegionMaster.class);
    RegionSearchRequest request = new RegionSearchRequest(ID);
    request.setPagingRequest(PagingRequest.ONE);
    request.setVersionCorrection(VC);
   
    RegionSearchResult result = new RegionSearchResult();
    result.getDocuments().add(new RegionDocument(example()));
   
    when(mock.search(request)).thenReturn(result);
View Full Code Here

    assertEquals(example(), testResult);
  }

  public void test_getRegion_ExternalId_notFound() throws Exception {
    RegionMaster mock = mock(RegionMaster.class);
    RegionSearchRequest request = new RegionSearchRequest(ID);
    request.setPagingRequest(PagingRequest.ONE);
    request.setVersionCorrection(VC);
   
    RegionSearchResult result = new RegionSearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterRegionSource test = new MasterRegionSource(mock, VC);
View Full Code Here

TOP

Related Classes of com.opengamma.master.region.RegionSearchRequest

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.