Package com.opengamma.master.region

Examples of com.opengamma.master.region.RegionSearchRequest


   * Creates the output root data.
   * @return the output root data, not null
   */
  protected FlexiBean createRootData() {
    FlexiBean out = super.createRootData();
    RegionSearchRequest searchRequest = new RegionSearchRequest();
    out.put("searchRequest", searchRequest);
    return out;
  }
View Full Code Here


    _regionMaster = new InMemoryRegionMaster();
    RegionFileReader.createPopulated(_regionMaster);
  }

  public void test_search_regionType() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setClassification(RegionClassification.INDEPENDENT_STATE);
    assertEquals(193, _regionMaster.search(request).getDocuments().size());
  }
View Full Code Here

    request.setClassification(RegionClassification.INDEPENDENT_STATE);
    assertEquals(193, _regionMaster.search(request).getDocuments().size());
  }

  public void test_search_all() {
    RegionSearchRequest request = new RegionSearchRequest();
    int all = _regionMaster.search(request).getDocuments().size();
    request.setClassification(RegionClassification.MUNICIPALITY);
    int municipalities = _regionMaster.search(request).getDocuments().size();
    assertEquals(283, all - municipalities);
  }
View Full Code Here

    int municipalities = _regionMaster.search(request).getDocuments().size();
    assertEquals(283, all - municipalities);
  }

  public void test_search_name() {
    RegionSearchRequest request = new RegionSearchRequest();
    request.setName("United Kingdom");
    assertEquals(1, _regionMaster.search(request).getDocuments().size());
    RegionDocument doc = _regionMaster.search(request).getFirstDocument();
    ManageableRegion ukRegion = doc.getRegion();
    assertNotNull(ukRegion);
    assertEquals("United Kingdom", ukRegion.getName());
View Full Code Here

    RegionDocument gotDoc = _regionMaster.get(doc.getUniqueId());
    assertEquals(doc, gotDoc);
  }

  public void test_search_unknownName() {
    RegionSearchRequest searchReq = new RegionSearchRequest();
    searchReq.setName("Unknown");
    assertEquals(0, _regionMaster.search(searchReq).getDocuments().size());
  }
View Full Code Here

    assertEquals(addedDoc, result);
  }

  //-------------------------------------------------------------------------
  public void test_search_oneId_noMatch() {
    RegionSearchRequest request = new RegionSearchRequest(ID_OTHER1);
    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_oneId_mic() {
    RegionSearchRequest request = new RegionSearchRequest(ID_COUNTRY);
    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_oneId_ccid() {
    RegionSearchRequest request = new RegionSearchRequest(ID_COUNTRY);
    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_oneBundle_noMatch() {
    RegionSearchRequest request = new RegionSearchRequest(BUNDLE_OTHER);
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.ALL);
    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_oneBundle_full() {
    RegionSearchRequest request = new RegionSearchRequest(BUNDLE_FULL);
    RegionSearchResult result = master.search(request);
    assertEquals(1, result.getDocuments().size());
    assertEquals(addedDoc, result.getFirstDocument());
  }
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.