Package com.opengamma.master.security

Examples of com.opengamma.master.security.SecuritySearchRequest


    assertEquals(0, test.getDocuments().size());
  }

  @Test
  public void test_search_noKeys_Any_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.setExternalIdSearch(new ExternalIdSearch());
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.ANY);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here


    assertEquals(0, test.getDocuments().size());
  }

  @Test
  public void test_search_noKeys_None_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.setExternalIdSearch(new ExternalIdSearch());
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.NONE);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(_totalSecurities, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_oneKey_Any_AB() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("A", "B"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(2, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

    assert102(test.getDocuments().get(1));
  }

  @Test
  public void test_search_oneKey_Any_CD() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("C", "D"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

    }
  }

  private Iterable<SecurityDocument> readEquitySecurities() {
    final SecurityMaster securityMaster = getToolContext().getSecurityMaster();
    final SecuritySearchRequest request = new SecuritySearchRequest();
    request.setSecurityType(EquitySecurity.SECURITY_TYPE);
    return SecuritySearchIterator.iterable(securityMaster, request);
  }
View Full Code Here

    assert202(test.getDocuments().get(2));
  }

  @Test
  public void test_search_oneKey_Any_EF() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("E", "F"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(2, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert202(test.getDocuments().get(1));
View Full Code Here

    assert202(test.getDocuments().get(1));
  }

  @Test
  public void test_search_oneKey_Any_GHI() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("GH", "HI"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert102(test.getDocuments().get(0));
  }
View Full Code Here

    assert102(test.getDocuments().get(0));
  }

  @Test
  public void test_search_oneKey_Any_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("A", "HI"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_twoKeys_Any_AB_CD() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("A", "B"), ExternalId.of("C", "D"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

    assert202(test.getDocuments().get(2));
  }

  @Test
  public void test_search_twoKeys_EF_GHI() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("E", "F"), ExternalId.of("GH", "HI"));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
    assert102(test.getDocuments().get(1));
View Full Code Here

TOP

Related Classes of com.opengamma.master.security.SecuritySearchRequest

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.