Package com.opengamma.master.orgs

Examples of com.opengamma.master.orgs.OrganizationSearchResult


    ArgumentChecker.notNull(request.getPagingRequest(), "request.pagingRequest");
    ArgumentChecker.notNull(request.getVersionCorrection(), "request.versionCorrection");
    s_logger.debug("search {}", request);
   
    final VersionCorrection vc = request.getVersionCorrection().withLatestFixed(now());
    final OrganizationSearchResult result = new OrganizationSearchResult(vc);
   

    final List<ObjectId> organizationObjectIds = request.getOrganizationObjectIds();
    if (organizationObjectIds != null && organizationObjectIds.size() == 0) {
      result.setPaging(Paging.of(request.getPagingRequest(), 0));
      return result;
    }
   
    final DbMapSqlParameterSource args = new DbMapSqlParameterSource()
        .addTimestamp("version_as_of_instant", vc.getVersionAsOf())
View Full Code Here


 
  @Test
  public void test_searchOrganizations_documents() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(Integer.MAX_VALUE, test.getPaging().getPagingSize());
    assertEquals(_totalOrganizations, test.getPaging().getTotalItems());

    assertEquals(_totalOrganizations, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
    assert202(test.getDocuments().get(2));
  }
View Full Code Here

 
  @Test
  public void test_search_pageOne() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setPagingRequest(PagingRequest.ofPage(1, 2));
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(1, test.getPaging().getFirstItemOneBased());
    assertEquals(2, test.getPaging().getPagingSize());
    assertEquals(_totalOrganizations, test.getPaging().getTotalItems());

    assertEquals(2, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_search_pageTwo() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setPagingRequest(PagingRequest.ofPage(2, 2));
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(3, test.getPaging().getFirstItemOneBased());
    assertEquals(2, test.getPaging().getPagingSize());
    assertEquals(_totalOrganizations, test.getPaging().getTotalItems());

    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

 
  @Test
  public void test_search_name_noMatch() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorShortName("FooBar");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  @Test
  public void test_search_name() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorShortName("TestOrganization102");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_search_name_case() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorShortName("TestOrganization102");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_search_name_wildcard() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorShortName("TestOrganization1*");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(2, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
  }
View Full Code Here

  @Test
  public void test_search_name_wildcardCase() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorShortName("TestOrganization1*");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(2, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
  }
View Full Code Here

 
  @Test
  public void test_search_red_code() {
    OrganizationSearchRequest request = new OrganizationSearchRequest();
    request.setObligorREDCode("RED_code_201");
    OrganizationSearchResult test = _orgMaster.search(request);

    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.orgs.OrganizationSearchResult

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.