Package com.opengamma.master.position

Examples of com.opengamma.master.position.PositionSearchRequest$Meta


    _posMaster.search(request);
  }

  @Test
  public void test_search_positionAndTradeIds_matchSome() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addPositionObjectId(ObjectId.of("DbPos", "120"));
    request.addPositionObjectId(ObjectId.of("DbPos", "122"));
    request.addTradeObjectId(ObjectId.of("DbPos", "402"));
    request.addTradeObjectId(ObjectId.of("DbPos", "403"));
    request.addTradeObjectId(ObjectId.of("DbPos", "407"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert122(test.getDocuments().get(0));
  }
View Full Code Here


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

  @Test
  public void test_search_positionAndTradeIds_matchNone() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addPositionObjectId(ObjectId.of("DbPos", "120"));
    request.addPositionObjectId(ObjectId.of("DbPos", "121"));
    request.addTradeObjectId(ObjectId.of("DbPos", "402"));
    request.addTradeObjectId(ObjectId.of("DbPos", "403"));
    request.addTradeObjectId(ObjectId.of("DbPos", "407"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_noKeys_Exact_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setSecurityIdSearch(new ExternalIdSearch());
    request.getSecurityIdSearch().setSearchType(ExternalIdSearchType.EXACT);
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

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

  @Test
  public void test_search_noKeys_All_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setSecurityIdSearch(new ExternalIdSearch());
    request.getSecurityIdSearch().setSearchType(ExternalIdSearchType.ALL);
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

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

  @Test
  public void test_search_noKeys_Any_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setSecurityIdSearch(new ExternalIdSearch());
    request.getSecurityIdSearch().setSearchType(ExternalIdSearchType.ANY);
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

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

  @Test
  public void test_search_noKeys_None_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setSecurityIdSearch(new ExternalIdSearch());
    request.getSecurityIdSearch().setSearchType(ExternalIdSearchType.NONE);
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(_totalPositions, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_oneKey_Any_1() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addSecurityExternalId(ExternalId.of("TICKER", "S100"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert100(test.getDocuments().get(0));
  }
View Full Code Here

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

  @Test
  public void test_search_oneKey_Any_1_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addSecurityExternalId(ExternalId.of("A", "Z"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_search_twoKeys_Any_2() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addSecurityExternalIds(ExternalId.of("TICKER", "MSFT"), ExternalId.of("TICKER", "S100"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(2, test.getDocuments().size());
    assert100(test.getDocuments().get(0));
    assert121(test.getDocuments().get(1));
View Full Code Here

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

  @Test
  public void test_search_twoKeys_Any_2_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.addSecurityExternalIds(ExternalId.of("E", "H"), ExternalId.of("A", "D"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.position.PositionSearchRequest$Meta

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.