Package com.opengamma.master.security

Examples of com.opengamma.master.security.SecuritySearchRequest


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

  @Test
  public void test_search_threeKeys_All_AB_CD_GHI() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("GH", "HI"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.ALL);
    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_threeKeys_All_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalIdBundle.of(ExternalId.of("C", "D"), ExternalId.of("E", "F"), ExternalId.of("A", "HI")));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.ALL);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_oneKey_None_AB() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("A", "B"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.NONE);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
  }
View Full Code Here

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

  @Test
  public void test_search_oneKey_None_CD_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ExternalId.of("C", "D"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.NONE);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_threeKeys_Exact_AB_CD_EF() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("E", "F"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.EXACT);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert101(test.getDocuments().get(0));
  }
View Full Code Here

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

  @Test
  public void test_search_threeKeys_Exact_AB_CD_GHI() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("A", "B"), ExternalId.of("C", "D"), ExternalId.of("GH", "HI"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.EXACT);
    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_threeKeys_Exact_noMatch() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalIds(ExternalId.of("A", "B"), ExternalId.of("C", "D"));
    request.getExternalIdSearch().setSearchType(ExternalIdSearchType.EXACT);
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_versionAsOf_below() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version1Instant.minusSeconds(5)));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

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

  @Test
  public void test_search_versionAsOf_mid() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version1Instant.plusSeconds(5)));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    SecurityDocument doc0 = test.getDocuments().get(0);
    SecurityDocument doc1 = test.getDocuments().get(1);
View Full Code Here

    assertEquals(UniqueId.of("DbSec", "201", "0"), doc2.getUniqueId())// old version
  }

  @Test
  public void test_search_versionAsOf_above() {
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.setVersionCorrection(VersionCorrection.ofVersionAsOf(_version2Instant.plusSeconds(5)));
    SecuritySearchResult test = _secMaster.search(request);
   
    assertEquals(3, test.getDocuments().size());
    SecurityDocument doc0 = test.getDocuments().get(0);
    SecurityDocument doc1 = 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.